- 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:
Where to find API key
You can get your API key at dashboard.Access Token
The access token is used only in the CLI and is not needed in the SDK. There’s no need to set it when logging into the CLI usinge2b auth login.
To authenticate without the browser, you can set
E2B_ACCESS_TOKEN as an environment variable. This is useful for CI/CD pipelines.