Skip to content

Setup

Sign up at e2b.dev. Alchemy logs in to E2B in your browser, finds your team, and mints a separate API key for each host that uses a binding.

E2B keys are not scoped: a key reaches every sandbox, template, volume, and secret in the team. Use a separate team for tests.

Install @alchemy.run/e2b:

Terminal window
pnpm add https://pkg.alchemy.run/@alchemy.run/e2b/pr:2930:51c662a

Then add E2B.providers() next to your cloud’s providers:

alchemy.run.ts
import * as E2B from "@alchemy.run/e2b";
providers: Layer.mergeAll(Cloudflare.providers(), E2B.providers()),
Terminal window
alchemy profile edit --add E2B

Pick Browser login and sign in to E2B. The profile keeps the login, and its token refreshes itself. To paste an access token or API key instead, pick Access token or API key.

See Profiles to learn how profiles work.

Set E2B_ACCESS_TOKEN and Alchemy uses it instead of your profile:

Terminal window
E2B_ACCESS_TOKEN=sk_e2b_... alchemy deploy

An API key (E2B_API_KEY) is enough to deploy resources, but bindings and E2B.ApiKey need the access token: only it can mint keys.