Learning resourcesReviewed · E2B

E2B SDK client configuration guide

E2B's SDK client guide shows JavaScript, TypeScript and Python developers how to configure explicit connections to E2B, a sandbox service where programs create sandboxes and run commands on managed cloud, BYOC or self-hosted deployments. Explicit clients support a program using multiple API keys, teams, deployments or regions. Regions keep projects, API keys, sandboxes, templates and volumes separate. The guide covers configuration precedence, synchronous and asynchronous Python resource classes, such as AsyncSandbox, exposed by the same client, and regional routing through the domain option.

Researched 15 Nov 2026

In short.

E2B's SDK client guide helps JavaScript, TypeScript and Python developers manage multiple connections to E2B, a sandbox service where SDK code creates sandboxes and runs commands on managed cloud, BYOC or self-hosted deployments. Each region has its own project, API key, sandboxes, templates and volumes. It explains how explicit clients supply defaults for sandbox, volume, template and secret operations while preserving per-call overrides. It provides practical examples, but installation requirements, SDK versions, pricing and licensing are unknown from this page, and runtime behavior was not assessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete page at [https://docs.e2b.dev/client.md], including its configuration-precedence notice, examples, regional endpoint table and regional-state constraints. Linked documentation, the documentation index, support and console pages are excluded. No code was executed. Installation, runtime behavior, deployment behavior, performance, costs and licensing were not independently assessed.

The overview

Resource and purpose

The resource is the SDK client documentation page at [https://docs.e2b.dev/client.md]. It explains the E2B client object, which supplies explicit configuration to SDK resources when environment variables alone are inconvenient. E2B provides sandboxes that SDK code creates and runs commands in, on its managed cloud in several regions or on BYOC or self-hosted deployments.

Practical fit

The guide is useful when one process needs different API keys, teams, deployment endpoints or regions. Its examples connect those needs to concrete client construction and resource calls. For a process using one region and one configuration, the page says environment variables and top-level exports are sufficient.

Who it helps

The examples suit developers separating production and staging, serving workloads in multiple regions, or connecting to BYOC or self-hosted deployments. Beginners get short examples in JavaScript, TypeScript and Python, including asynchronous Python, but the page assumes familiarity with package imports, API keys and sandbox creation.

What it covers

A client exposes Sandbox, Volume, Template and Secret classes, with asynchronous variants shown for Python. Examples create sandboxes and volumes, check template existence and create secrets. These classes retain the behavior of the corresponding top-level exports; the client changes their defaults.

Code Interpreter and Desktop packages also export E2B clients with their own Sandbox class bound to them. Their broader capabilities are outside this page.

Using it

Prerequisites

The examples assume the relevant E2B package and an API key are available. Installation commands, supported runtime versions and minimum SDK versions are not supplied.

Additional managed-cloud regions require support enablement. Each region needs its own project and API key, and custom templates must be built separately in every region where they are needed.

How configuration works

Per-call options override client options, which override environment variables. Clients are isolated from one another and from environment-configured top-level exports. Resource classes can also be extracted from a client for direct use.

Options include API key, domain, request timeout, proxy and API headers; logger is JavaScript-only. JavaScript's signal option applies only to individual calls because it cancels a single request.

Regional routing uses domain rather than a region option. US-West-1 is the managed-cloud default; the page also lists US-West-2, US-East-1, EU-West-1 and AP-Southeast-1.

Configuration approach

Import E2B from the relevant package and construct a client with apiKey in JavaScript or TypeScript, or api_key in Python. Supply the documented domain when targeting another deployment. Use client.Sandbox.create(), or await client.AsyncSandbox.create() in asynchronous Python.

For multiple regions, construct one client per region with its matching project key and domain. The examples select a client from a region mapping before creating a sandbox.

Documented example

The opening example creates an E2B client, creates a sandbox through it, runs echo "Hello from E2B!" with sandbox.commands.run and reads result.stdout. The source comment illustrates the expected output.

Another example creates production and staging clients with separate keys, then shows that the imported top-level Sandbox still uses E2B_API_KEY. These examples were not executed.

Assessment & evidence

Operational limits

Regions do not share state. Templates cannot be copied between regions and must be built in each one. A sandbox ID resolves only in its originating region, so connecting, listing or terminating it requires that region's client.

The page does not establish performance, availability, security guarantees, automatic failover or resource migration behavior beyond these stated regional constraints.

Adoption tradeoff

The documented configuration isolation makes explicit clients a useful fit for separating credentials and deployment defaults within one process. Regional separation also places practical responsibility on the application to choose the correct client and maintain templates in each region. That tradeoff follows from the documented routing and state boundaries; reliability under load remains unassessed.

Other approaches in the guide

For one region, configure E2B_API_KEY and E2B_DOMAIN and use top-level exports. Individual calls can also override defaults. For Code Interpreter or Desktop usage, import E2B from the corresponding package entrypoint. The page supplies no comparison with other providers or libraries.

Source basis

The evidence is the complete captured SDK client page at [https://docs.e2b.dev/client.md]. Its source revision is sha256:a1957138d22f0ae105fceaffa005ecaa62fb7c308c50bf04516d7a6bf47bcac9. The findings describe its explanations and examples; no execution results or independent measurements are available.

Access & freshness

Costs

The page provides no prices, free-tier allowances, usage quotas or billing rules. Costs for sandbox usage, regional deployments, template builds, BYOC and self-hosting are unknown from this evidence.

Licensing and reuse

The page does not state licences for its documentation, examples or SDK packages, or terms governing the service. Commercial-use and redistribution permissions cannot be established from this page.

Date and compatibility

The page was captured on 2026-11-15 at 06:38:34.313 UTC. It states no publication date, update date or SDK version. Compatibility with a particular installed release and subsequent changes to regional availability are unknown.

Before adoption

Choose whether environment configuration is sufficient or separate clients are needed. Confirm the installed SDK supports the documented client API, pair each regional project key with its documented domain, and arrange support enablement for additional regions.

Plan template builds and sandbox operations around regional boundaries. Obtain pricing and licence terms separately, then validate configuration overrides and client routing in the intended environment.

Evidence for this report

selected-page.txtselected · checked 2026-11-15