Description
<p align="center"> <img width="100" src="https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-circle.png" alt="e2b logo"> </p> <h4 align="center"> <a href="https://pypi.org/project/e2b/"> <img alt="Last 1 month downloads for the Python SDK" loading="lazy" decoding="async" style="color:transparent;width:170px;height:18px" src="https://static.pepy.tech/personalized-badge/e2b?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=PyPi%20Monthly%20Downloads"> </a> </h4> ## What is E2B? [E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b). ## Run your first Sandbox ### 1. Install SDK ``` pip install e2b ``` ### 2. Get your E2B API key 1. Sign up to E2B [here](https://e2b.dev). 2. Get your API key [here](https://e2b.dev/dashboard?tab=keys). 3. Set environment variable with your API key ``` E2B_API_KEY=e2b_*** ``` ### 3. Start a sandbox and run commands ```py from e2b import Sandbox with Sandbox.create() as sandbox: result = sandbox.commands.run('echo "Hello from E2B!"') print(result.stdout) # Hello from E2B! ``` ### 4. Code execution with Code Interpreter If you need [`run_code()`](https://e2b.dev/docs/code-interpreting), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter): ``` pip install e2b-code-interpreter ``` ```py from e2b_code_interpreter import Sandbox with Sandbox.create() as sandbox: execution = sandbox.run_code("x = 1; x += 1; x") print(execution.text) # outputs 2 ``` ### 5. Check docs Visit [E2B documentation](https://e2b.dev/docs). ### 6. E2B cookbook Visit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 2.20.0 | Imported from PyPI (2.20.0) | Low | 4/21/2026 |
| @e2b/python-sdk@2.20.0 | ### Minor Changes - cf35f61: switch to application/octet-stream for file uploads - 1cc385a: Edit README ### Patch Changes - ef46004: Increase default timeout for volume file uploads to 1 hour | Medium | 4/2/2026 |
| e2b@2.19.0 | ### Minor Changes - cf35f61: switch to application/octet-stream for file uploads - 1cc385a: Edit README ### Patch Changes - ef46004: Increase default timeout for volume file uploads to 1 hour | Medium | 4/2/2026 |
| @e2b/python-sdk@2.19.0 | ### Minor Changes - 6d7e72e: added volumes support to the SDKs | Medium | 3/26/2026 |
| e2b@2.18.0 | ### Minor Changes - 6d7e72e: added volumes support to the SDKs | Medium | 3/26/2026 |
| e2b@2.17.0 | ### Minor Changes - f7f1f29: Update SDK READMEs | Medium | 3/25/2026 |
| @e2b/python-sdk@2.18.0 | ### Minor Changes - f7f1f29: Update SDK READMEs | Medium | 3/25/2026 |
| @e2b/cli@2.9.0 | ### Minor Changes - dcaca73: cli supports info command which is the equivilent of the getInfo ### Patch Changes - Updated dependencies [1c55083] - Updated dependencies [7c8d298] - e2b@2.16.0 | Medium | 3/23/2026 |
| e2b@2.16.0 | ### Minor Changes - 7c8d298: adds network configs and lifecycle handling to info responses ### Patch Changes - 1c55083: Fix missing instance config propagation in Sandbox pause/connect and add regression tests for config forwarding + overrides. | Medium | 3/23/2026 |
| @e2b/python-sdk@2.17.0 | ### Minor Changes - 7c8d298: adds network configs and lifecycle handling to info responses ### Patch Changes - 1c55083: Fix missing instance config propagation in Sandbox pause/connect and add regression tests for config forwarding + overrides. | Medium | 3/23/2026 |
| @e2b/python-sdk@2.16.0 | ### Minor Changes - ca85620: Add `fixMissing` / `fix_missing` option to `aptInstall` / `apt_install` to support the `--fix-missing` flag in apt-get install ### Patch Changes - 5a673d1: chore: distinguish between Sandbox and file not found | Medium | 3/23/2026 |
| e2b@2.15.0 | ### Minor Changes - ca85620: Add `fixMissing` / `fix_missing` option to `aptInstall` / `apt_install` to support the `--fix-missing` flag in apt-get install ### Patch Changes - 5a673d1: chore: distinguish between Sandbox and file not found | Medium | 3/23/2026 |
| @e2b/cli@2.8.2 | ### Patch Changes - ba7caa5: Fix update notifier not displaying by replacing update-notifier with simple-update-notifier - 8abfa62: fix(cli): use `name` parameter instead of deprecated `alias` in template init generated code - Updated dependencies [ca85620] - Updated dependencies [5a673d1] - e2b@2.15.0 | Medium | 3/23/2026 |
| @e2b/python-sdk@2.15.3 | ### Patch Changes - 710fae6: request_timeout applies to connect/pool/write | Low | 3/18/2026 |
| @e2b/python-sdk@2.15.2 | ### Patch Changes - 16c86d1: Support multiple asyncio loops | Low | 3/9/2026 |
| @e2b/cli@2.8.1 | ### Patch Changes - b0ab7f7: Add implicit limit for sandbox list query to CLI | Low | 3/9/2026 |
| @e2b/python-sdk@2.15.1 | ### Patch Changes - 222105d: include .dot files in template file upload | Low | 3/6/2026 |
| e2b@2.14.1 | ### Patch Changes - 222105d: include .dot files in template file upload - 3c56842: fix: pass sandbox headers to EnvdApiClient | Low | 3/6/2026 |
| e2b@2.14.0 | ### Minor Changes - 7027f36: Adds lifecycle prop to control pausing and auto-resume | Low | 3/4/2026 |
| @e2b/python-sdk@2.15.0 | ### Minor Changes - 7027f36: Adds lifecycle prop to control pausing and auto-resume | Low | 3/4/2026 |
| e2b@2.13.1 | ### Patch Changes - e83cf86: Add `getTags`/`get_tags` method to list all tags for a template | Low | 3/4/2026 |
| @e2b/python-sdk@2.14.1 | ### Patch Changes - 6371d0c: Fix sandbox not found error message in set_timeout - e83cf86: Add `getTags`/`get_tags` method to list all tags for a template | Low | 3/4/2026 |
| @e2b/cli@2.8.0 | ### Minor Changes - bcc6ea8: Add `pause` and `resume` commands to manage sandbox state. - `e2b sandbox pause <sandboxID>` - pause a running sandbox - `e2b sandbox resume <sandboxID>` - resume a paused sandbox ### Patch Changes - Updated dependencies [e83cf86] - e2b@2.13.1 | Low | 3/4/2026 |
| @e2b/cli@2.7.3 | ### Patch Changes - b989b29: fix crash on invalid status codes in error handler | Low | 2/26/2026 |
| @e2b/cli@2.7.2 | ### Patch Changes - 6c1db7d: fix issue with pagination on listSandboxes | Low | 2/25/2026 |
| @e2b/python-sdk@2.14.0 | ### Minor Changes - a55ca21: Add snapshot API for creating persistent sandbox snapshots | Low | 2/24/2026 |
| e2b@2.13.0 | ### Minor Changes - a55ca21: Add snapshot API for creating persistent sandbox snapshots | Low | 2/24/2026 |
| @e2b/cli@2.7.1 | ### Patch Changes - a2cd86c: added -d option to create sandbox in detached mode - 8f53fdc: set default template to spawn command - a26e213: Print Sandbox Inspect url for E2B Dashboard Inspection | Low | 2/21/2026 |
| @e2b/python-sdk@2.13.3 | ### Patch Changes - c38a181: fixes type errors when using with ty | Low | 2/21/2026 |
| @e2b/cli@2.7.0 | ### Minor Changes - 87ceec2: Implement closeStdin to allow piping commands into the CLI | Low | 2/12/2026 |
| @e2b/cli@2.6.1 | ### Patch Changes - 575d5bc: Fix CLI team ID resolution when E2B_API_KEY is set via environment variable. Add E2B_TEAM_ID env var support. Previously, the CLI always used the team ID from ~/.e2b/config.json, causing "Team ID param mismatch" errors when the API key belonged to a different team. | Low | 2/9/2026 |
| @e2b/python-sdk@2.13.2 | ### Patch Changes - 6395a5f: Fix type checker compatibility for class_method_variant descriptor | Low | 2/9/2026 |
| e2b@2.12.1 | ### Patch Changes - 8efc53c: Use chunked transfer encoding for tar uploads to reduce memory usage - 5e9c6d6: fix: validate copy src paths are relative and within context directory - 1780a0c: Fix error handling for API responses with empty body. | Low | 2/9/2026 |
| @e2b/python-sdk@2.13.1 | ### Patch Changes - 5e9c6d6: fix: validate copy src paths are relative and within context directory - 1a8fed0: Consolidate logic on the git functionality and tests to ensure parity on sync/async functionality | Low | 2/9/2026 |
| e2b@2.12.0 | ### Minor Changes - 77b08f5: Adds first class support to git commands to the sandbox sdk. | Low | 1/29/2026 |
| @e2b/python-sdk@2.13.0 | ### Minor Changes - 77b08f5: Adds first class support to git commands to the sandbox sdk. | Low | 1/29/2026 |
| @e2b/python-sdk@2.12.2 | ### Patch Changes - 4af9b4c: avoid reading files on upload | Low | 1/29/2026 |
| @e2b/cli@2.6.0 | ### Minor Changes - 631522d: Use v2 template update endpoint and display namespaced template name after publishing ### Patch Changes - Updated dependencies [631522d] - Updated dependencies [4af9b4c] - e2b@2.11.2 | Low | 1/29/2026 |
| e2b@2.11.2 | ### Patch Changes - 631522d: Add v2 template update endpoint with TemplateUpdateResponse containing namespaced names - 4af9b4c: avoid reading files on upload | Low | 1/29/2026 |
| @e2b/python-sdk@2.12.1 | ### Patch Changes - 07ef17f: deprecate aliasexists and add exists | Low | 1/27/2026 |
| e2b@2.11.1 | ### Patch Changes - 07ef17f: deprecate aliasexists and add exists | Low | 1/27/2026 |
| @e2b/cli@2.5.1 | ### Patch Changes - 10abab8: Update templates to use new `Template.build()` format - Updated dependencies [10abab8] - e2b@2.11.0 | Low | 1/27/2026 |
| @e2b/python-sdk@2.12.0 | ### Minor Changes - 10abab8: Add template versioning with tags support - `Template.build()` now accepts names in `name:tag` format (e.g., `"my-template:v1.0"`) - New `Template.assignTags()` / `Template.assign_tags()` to assign tags to existing builds - New `Template.removeTags()` / `Template.remove_tags()` to remove tags | Low | 1/27/2026 |
| e2b@2.11.0 | ### Minor Changes - 10abab8: Add template versioning with tags support - `Template.build()` now accepts names in `name:tag` format (e.g., `"my-template:v1.0"`) - New `Template.assignTags()` / `Template.assign_tags()` to assign tags to existing builds - New `Template.removeTags()` / `Template.remove_tags()` to remove tags | Low | 1/27/2026 |
| e2b@2.10.5 | ### Patch Changes - 1c5cf95: Use portable mode for deterministic gzip output | Low | 1/26/2026 |
| @e2b/python-sdk@2.11.0 | ### Minor Changes - ae48a0a: Drop support for Python 3.9 | Low | 1/26/2026 |
| e2b@2.10.4 | ### Patch Changes - c1ee183: Add writeFiles function to sync with Python SDK | Low | 1/23/2026 |
| @e2b/cli@2.5.0 | ### Minor Changes - 4ebabfe: Add exec command | Low | 1/22/2026 |
| e2b@2.10.3 | ### Patch Changes - 5fd71a2: Add user-agent header to EnvdApiClient | Low | 1/20/2026 |
| e2b@2.10.2 | ### Patch Changes - a8e5201: fix float timeout to int conversion for Go backend compatibility - ab906ad: fix: adjust timestamp conversion to remove milliseconds | Low | 1/15/2026 |
| @e2b/python-sdk@2.10.2 | ### Patch Changes - ab906ad: fix:timestamp conversion for metric endpoints | Low | 1/15/2026 |
