Practical overview
When it fits
Use E2B when an AI application needs a controlled execution layer for generated commands, interpreted code or desktop interaction. Choose its self-hosting path when the documented runtime and Terraform deployment model fit the target infrastructure.
Who it is for
- Developers building AI agents that need to execute generated code
- Teams creating coding assistants or data-analysis agents
- Builders implementing browser or computer-use workflows
- Teams deploying a self-hosted agent execution service
Documented uses
- Run agent-generated commands in an isolated sandbox
- Execute Python or other programmatic code and retrieve output
- Provide desktop actions such as screenshots, keyboard, mouse and application launching
- Deploy the execution runtime on supported cloud or Linux infrastructure
Requirements & limits
The documented first-sandbox flow requires an E2B account, an API key and installation of the relevant SDK. The repository is public and licensed under Apache-2.0.
- The core sandbox flow is available through Python and JavaScript SDKs.
- Code interpretation uses separate Code Interpreter SDK packages.
- Desktop automation uses a separate Desktop SDK and exposes mouse, keyboard, screenshot, application and desktop streaming APIs.
- Self-hosting is documented through the E2B runtime and Terraform for AWS, Google Cloud, Azure and general Linux machines.
- The project is infrastructure for agent applications, not a standalone end-user agent.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up a first E2B command sandbox
Install an SDK, configure an API key and run a command in a created sandbox.
Before you start
- A JavaScript/TypeScript or Python environment
- An E2B account and API key
- The E2B JavaScript or Python SDK
Steps
Install the JavaScript SDK with npm i e2b or the Python SDK with pip install e2b.
Sign up to E2B and obtain an API key from the dashboard.
Set the E2B_API_KEY environment variable.
Create a sandbox with the SDK and run a command through sandbox.commands.run.
Expected outcome
A sandbox command returns execution output through the selected SDK.
Guide limitations
- This recipe covers command execution only; code interpretation and desktop interaction use separate SDK packages.
- The source documents setup and example execution, but does not specify pricing or service limits.
Add programmatic code execution
Install the Code Interpreter SDK and execute code through an E2B sandbox.
Before you start
- An E2B account and API key
- The JavaScript Code Interpreter SDK or Python Code Interpreter SDK
Steps
Install @e2b/code-interpreter with npm or e2b-code-interpreter with pip.
Create a sandbox through the Code Interpreter SDK.
Call runCode() in JavaScript or run_code() in Python with the code to execute.
Read the returned execution output.
Expected outcome
The agent application receives output from programmatic code execution.
Guide limitations
- The documented example demonstrates code execution but does not describe package compatibility beyond the named JavaScript and Python SDKs.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 2 October 2026
- Original website title
- e2b-dev/E2B · Official homepage title · retained in its source language

