Last Updated: 3/7/2026
API Key
To use E2B, you need an API key. This guide will show you how to obtain and configure your API key.
Obtaining Your API Key
- Sign up for an E2B account at e2b.dev
- Navigate to your Dashboard
- Find your API key in the settings section
Setting Up Your API Key
Environment Variable (Recommended)
Set the E2B_API_KEY environment variable:
export E2B_API_KEY=your_api_key_hereIn Your Code
Alternatively, you can pass the API key directly when creating a sandbox:
import { Sandbox } from 'e2b'
const sandbox = await Sandbox.create({
apiKey: 'your_api_key_here'
})Security Best Practices
- Never commit your API key to version control
- Use environment variables for production deployments
- Rotate your API keys regularly
- Use separate keys for development and production
Next Steps
Once you have your API key configured, you’re ready to:
- Run your first sandbox
- Explore use cases
- Check out the SDK reference