# e2b

> E2B SDK that give agents cloud environments

- **URL**: https://www.freshcrate.ai/projects/e2b
- **Author**: e2b
- **Category**: AI Agents
- **Latest version**: `e2b@2.28.0` (2026-06-06)
- **License**: MIT
- **Source**: https://github.com/e2b-dev/e2b/issues
- **Homepage**: https://e2b.dev/
- **Language**: Python
- **GitHub**: 11,835 stars, 865 forks
- **Registry**: pypi (`e2b`)
- **Tags**: `pypi`

## 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.

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `e2b@2.28.0` | 2026-06-06 | High | ### Minor Changes  - 073661a: Add API-only custom header options for the JavaScript and Python SDKs.  ### Patch Changes  - e7a82ea: Remove unused internal code: `wait` helper (js-sdk), `asSandboxTemplate`/`asHeadline`/`selectOption`/`basicDockerfile` (cli), and `format_execution_timeout_error` (python-sdk). No public API changes. - 5b2bb94: Return a dedicated rate limit error for HTTP 429 responses from the envd API. Previously these were surfaced as a generic sandbox error, unlike the main API |
| `@e2b/python-sdk@2.25.1` | 2026-05-29 | High | ### Patch Changes  -   4b9cc04: Use the stable sandbox host for envd requests on supported E2B domains and give envd traffic a separate HTTP transport cache from API traffic. Sync envd transports are cached per thread to avoid sharing a single HTTP/2 connection across threaded sync workloads. |
| `@e2b/cli@2.10.2` | 2026-05-22 | High | ### Patch Changes  -   6d66d15: Fix `e2b auth login` crashing on headless machines where `xdg-open` is unavailable. The CLI now spawns the browser opener directly so it can catch the spawn `ENOENT` synchronously, prints the login URL so the user can open it manually, and suggests setting `E2B_API_KEY` when interactive login is not possible. |
| `e2b@2.21.0` | 2026-05-18 | High | ### Minor Changes  -   2ac5de2: Add `signal: AbortSignal` option to JS SDK methods to support cancelling in-flight requests. The signal can be passed to `Sandbox.create`, `Sandbox.connect`, `sandbox.commands.run`, `sandbox.files.*`, volume methods, and other request options. When the signal is aborted, the underlying `fetch` is aborted and the returned promise rejects with an `AbortError`.      `SandboxPaginator.nextItems` and `SnapshotPaginator.nextItems` now accept a `SandboxApiOpts` argument |
| `e2b@2.20.1` | 2026-05-14 | High | ### Patch Changes  -   eaf452a: add optional name parameter to createSnapshot and return snapshot names |
| `e2b@2.20.0` | 2026-05-11 | High | ### Minor Changes  -   b2a2786: Compatibility for turbopack |
| `e2b@2.19.5` | 2026-05-06 | High | ### Patch Changes  -   f7a97e6: Use HTTP/2 for JS SDK envd/api requests and require Node.js 20.18.1 or newer. |
| `e2b@2.19.4` | 2026-04-30 | High | ### Patch Changes  -   ae13876: drop unused `npm-check-updates` devDependency to clear remaining `tar@6` Dependabot security alerts |
| `e2b@2.19.2` | 2026-04-27 | High | ### Patch Changes  -   2c995d4: added opt-in `useOctetStream` / `use_octet_stream` option to sandbox file write; default is now `multipart/form-data` regardless of envd version |
| `e2b@2.19.1` | 2026-04-24 | High | ### Patch Changes  -   3167e19: fix(js-sdk): buffer template tar archive before upload so `fetch` sets `Content-Length` instead of falling back to `Transfer-Encoding: chunked`. S3 presigned PUT URLs reject chunked requests with `501 NotImplemented`, breaking template uploads in self-hosted deployments backed by S3-compatible storage. Aligns the JS SDK with the Python SDK, which already buffers via `io.BytesIO`. -   2f0ff5f: fix(sdk): prevent shell injection in MCP config by using proper shell es |

## Citation

- HTML: https://www.freshcrate.ai/projects/e2b
- Markdown: https://www.freshcrate.ai/projects/e2b.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/e2b/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
