> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from E2B

> Point the stock E2B SDK at Anona Compute, and what differs.

Anona Compute serves the E2B sandbox API, so existing code that uses the `e2b` SDK keeps working. Change two environment variables:

```bash migrate-env.sh theme={null}
export E2B_DOMAIN=compute.anonalabs.com     # the SDK derives https://api.compute.anonalabs.com
export E2B_API_KEY=e2b_YOUR_API_KEY          # an Anona Compute key from the dashboard
```

Set `E2B_DOMAIN`, not `E2B_API_URL`: recent SDKs ignore or deprecate `E2B_API_URL`. Sandbox traffic then goes to `https://<port>-<sandbox id>.sbx.compute.anonalabs.com`, which the SDK builds from the domain the API returns.

```python e2b_unchanged.py theme={null}
from e2b import Sandbox  # the stock SDK, unchanged

with Sandbox.create() as sbx:  # default template: base
    print(sbx.commands.run("echo hello from e2b code").stdout)
    sbx.files.write("/home/user/data.csv", "a,b\n1,2\n")
    print([e.name for e in sbx.files.list("/home/user")])
```

```typescript e2b_unchanged.ts theme={null}
import { Sandbox } from "e2b"; // the stock SDK, unchanged

const sbx = await Sandbox.create(); // default template: base
console.log((await sbx.commands.run("echo hello from e2b code")).stdout);
await sbx.files.write("/home/user/table.csv", "a,b\n1,2\n");
console.log((await sbx.files.list("/home/user")).map((e) => e.name));
await sbx.kill();
```

The Anona SDK extras (`anona`, `@anona/sdk`) are subclasses of the E2B `Sandbox`: swap the import to get `sandbox.live` and `sandbox.ssh` and the Anona domain as default. See [SDK extras](https://docs.anonalabs.com/compute/sdk/overview.md).

## Compatible

Checked with the stock SDK (e2b 2.20.3, 2.51.0 and 2.61.0) against the gateway:

| Area | Works |
| - | - |
| Sandboxes | `create` (v1 and v2 API), `connect`, `list`, `get_info`, `kill`, `set_timeout`, `is_running`, metadata, environment variables |
| Lifecycle | `pause`, `connect` / resume with memory kept, `lifecycle={"on_timeout": "pause"}` |
| Commands | `commands.run`, streaming callbacks, background commands, `send_stdin`, `kill`, `list`, `connect` |
| Files | `read`, `write`, `list`, `make_dir`, `remove`, `rename`, `exists`, `get_info`, `watch_dir`, signed `upload_url` / `download_url` |
| Terminal | `pty.create`, `send_stdin`, `resize` |
| Ports | `get_host(port)`; see [Preview links](https://docs.anonalabs.com/compute/guides/preview-links.md) |
| Network | `allow_internet_access`, `network` (`allow_out`, `deny_out`, `rules` with vault placeholders) on create, and `update_network` on a running sandbox; see [Networking](https://docs.anonalabs.com/compute/concepts/networking.md) |
| Desktop | The `e2b-desktop` SDK on the `desktop` template, including the noVNC stream on port 6080 |
| Templates | `Template.build` and the `e2b` CLI's template commands: build from steps or a Dockerfile, list, get, logs, delete, aliases; see [Templates](https://docs.anonalabs.com/compute/concepts/templates.md#build-your-own) |
| Errors | E2B-shaped error bodies, so the SDK raises its usual exceptions |

## Differences

| Topic | Anona Compute |
| - | - |
| API keys | Created in the Anona dashboard. They use the E2B format (`e2b_` + hex), so the SDK accepts them. E2B keys do not work here, and Anona keys do not work on E2B. |
| Templates | The built-in templates are `base`, `python`, `node`, `code-interpreter`, `desktop` and `coding-agent`. E2B template names you built yourself do not exist here. See [Templates](https://docs.anonalabs.com/compute/concepts/templates.md). |
| Lifetime | `timeout=-1` means no deadline on plans without a maximum lifetime. Paused sandboxes are kept until you delete them. See [Lifecycle](https://docs.anonalabs.com/compute/concepts/lifecycle.md). |
| Default user | Commands run as `user` (uid 1000) with passwordless `sudo`, as on E2B. |
| Metrics and logs | `get_metrics` and the sandbox log routes are served from the sandbox's own envd, so they need no log collector. Logs are envd's structured log: every process's stdout and stderr, process starts and exits, and file operations. The default minimum level is `info`; pass `level=debug` for envd's own internals. A paused sandbox returns an empty page, since its envd is frozen. |
| Default egress | Depends on your plan: paid plans allow public internet by default, the free plan has none. Private ranges and cloud metadata are always blocked. See [Networking](https://docs.anonalabs.com/compute/concepts/networking.md). |

## Not available yet

Calls to these return an error from the gateway today. They are **Coming soon**:

| E2B feature | Status |
| - | - |
| `fork`, `create_snapshot`, `list_snapshots` | Coming soon |
| Filesystem-only pause (`mode="filesystem"`, `autoPauseMemory: false`) | Not supported: a pause always keeps memory |
| Volumes, IAM, E2B secrets, team and admin APIs | Not supported; `volume_mounts` and `iam` are refused with 400. For secrets, use the Anona [credential vault](https://docs.anonalabs.com/compute/concepts/networking.md#credentials-without-exposing-them) |
| Resume on incoming traffic (`auto_resume`) | Accepted on create; waking a paused sandbox on a request to its URL is Coming soon. Call `Sandbox.connect(id)` to resume. |
| SOCKS egress proxy (`network.egress_proxy`) | Not supported |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.