API key
To use the API key, you can either:
- Set the API key as the
E2B_API_KEYenvironment variable to avoid passing it each time you create a sandbox. - Or pass it directly to the
Sandboxconstructor as shown below:
import { Sandbox } from 'e2b'
const sandbox = await Sandbox.create({ apiKey: 'YOUR_API_KEY' })Where to find API key
You can get your API key at dashboard.
Access token
E2B_ACCESS_TOKEN is deprecated. New access tokens can no longer be generated after July 1, 2026, and all access tokens stop working on August 1, 2026. Authenticate with E2B_API_KEY instead. See the access token deprecation.
The access token is used only by the interactive CLI login commands e2b auth login and e2b auth configure, which set up your local workstation. It is not needed in the SDK, and you do not need to set it as an environment variable to use the CLI.
Where to find access token
You can get your Access token key at the dashboard. After July 1, 2026, new access tokens can no longer be generated.
Was this page helpful?Suggest editsRaise issue