Skip to main content
Architecture: e2b-code-interpreter and e2b-desktop are built on top of the core e2b SDK. All classes, methods, and features from e2b are available in the specialized SDKs.

e2b

General-purpose sandboxes for running any code, commands, or processes. Use when: Building custom AI agents, running untrusted code, or need full control over the environment.

Installation

pip install e2b

Quick Start

from e2b import Sandbox

# Create sandbox
sbx = Sandbox.create()

# Run command
result = sbx.commands.run("echo 'Hello from E2B'")
print(result.stdout)

# Run Python code
result = sbx.commands.run("whoami")
print(result.stdout)

Full SDK Reference

Complete API documentation

e2b-code-interpreter

Built on top of e2b with added support for multi-language code execution (Python, JavaScript, R, Java, Bash), pre-installed data science libraries, and visualization capabilities.
Includes all features from e2b plus specialized code execution methods and pre-configured environment.
Use when: Building AI data analysts, code execution environments, or need chart generation.

Installation

pip install e2b-code-interpreter

Quick Start

from e2b_code_interpreter import Sandbox

# Create code interpreter
sbx = Sandbox.create()

# Execute code with results
execution = sbx.run_code("print('Hello from E2B'); 2 + 2")

# Access results
for result in execution.results:
    print(result)

View Full Code Interpreter Guide

Detailed documentation, examples, and supported languages

e2b-desktop

Built on top of e2b with a full Linux desktop environment including GUI, browser, and window management.
Includes all features from e2b plus desktop-specific methods like getDesktopUrl() and pre-configured GUI environment.
Use when: Browser automation, visual testing, or applications requiring a desktop UI.

Installation

pip install e2b-desktop

Quick Start

from e2b_desktop import Sandbox

# Create desktop sandbox
sbx = Sandbox.create()

# Get desktop URL
desktop_url = sbx.get_desktop_url()
print(f"Access desktop at: {desktop_url}")

# Run GUI application
sbx.commands.run("firefox https://example.com")

Linux Desktop Guide

Full walkthrough and examples

Choosing the Right SDK

  • AI data analysis and visualization
  • Multi-language code execution (Python, JavaScript, R, Java, Bash)
  • Need data science libraries pre-installed
  • Generating charts, plots, or reports
  • Jupyter-like code execution environment
  • Browser automation with visual feedback
  • Testing applications that require a GUI
  • Screen recording or screenshots
  • Running desktop applications in the cloud