Skip to Content
Api Key

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

  1. Sign up for an E2B account at e2b.dev 
  2. Navigate to your Dashboard 
  3. Find your API key in the settings section

Setting Up Your API Key

Set the E2B_API_KEY environment variable:

export E2B_API_KEY=your_api_key_here

In 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: