E2B Code Interpreter

Active
GitHub Python Apache-2.0

Description

Python and JS/TS SDK for running AI-generated code in secure cloud sandboxes with Jupyter-style code interpretation

Key Features

  • Secure cloud sandboxes for running AI-generated code in isolated environments
  • Jupyter Notebook-style code execution with full Python runtime support
  • JavaScript/TypeScript SDK alongside Python SDK for multi-language support
  • Custom sandbox templates for adding extra packages or different runtimes
  • Stateful execution allowing variables to persist across multiple code runs
  • Simple API to create, start, and control sandboxes programmatically

Use Cases

πŸ’‘ Execute AI-generated code safely without risking host system security
πŸ’‘ Build code interpreter features into AI agents and chatbots
πŸ’‘ Run data analysis and visualization pipelines in ephemeral environments
πŸ’‘ Prototype and test AI coding assistants with real execution capabilities

Quick Start

Install via `pip install e2b-code-interpreter` or `npm i @e2b/code-interpreter`. Sign up at e2b.dev for an API key, set `E2B_API_KEY` environment variable, then create a Sandbox and call `run_code()` to execute Python interactively.

Related Projects