E2B
APICloud sandboxes for running AI-generated code
- Access
- API key
About
Cloud sandboxes, each a Firecracker microVM, for running AI-generated code and agent workloads, controlled through Python and JavaScript SDKs. Sandboxes are CPU-only, with no GPUs. The open-source infrastructure can be self-hosted.
What you can do with it
- Run LLM-generated Python or JavaScript in an isolated cloud sandbox
- Give an agent its own Linux VM to run commands and edit files
- Pause, snapshot and resume sandboxes to keep an agent's state
Get started
- Sign up for E2B (new accounts get $100 in credits)
- Copy your API key into E2B_API_KEY
- Install the e2b-code-interpreter SDK
Example
# pip install e2b-code-interpreter; the SDK reads E2B_API_KEY from the environment
from e2b_code_interpreter import Sandbox
sbx = Sandbox.create()
execution = sbx.run_code("print('hello world')")
print(execution.logs)Details
- Hosting
- Hosted service, Self-hosted
- Available in
- Worldwide
- Official SDKs
- JavaScript/TypeScript, Python
- MCP server
- None