E2B-compatible API

2026-10-22

E2B-compatible API

Base URL

Loading…

Get started

Loading…

Control plane and data plane

  • Control plane: the endpoints listed on this page (create, list, pause, connect, kill …) live at the base URL above and authenticate with your API key (the X-API-Key header; the official SDK sends it for you).
  • Data plane: running commands and reading files inside a sandbox goes straight to <port>-<sandbox ID>.praxisusercontent.com with the access token returned when the sandbox was created — so besides api_url the SDK also needs domain set to praxisusercontent.com.

Or leave the code alone and set environment variables:

Loading…

Endpoints

MethodPathDescriptionSupport
POST/sandboxesCreate a sandbox● Supported
GET/sandboxesList running sandboxes● Supported
GET/sandboxes/{sandboxID}Get a sandbox● Supported
GET/sandboxes/{sandboxID}/metricsGet sandbox metrics● Supported
POST/sandboxes/{sandboxID}/timeoutSet sandbox timeout● Supported
POST/sandboxes/{sandboxID}/pausePause a sandbox● Supported
POST/sandboxes/{sandboxID}/connectConnect to a sandbox● Supported
DELETE/sandboxes/{sandboxID}Kill a sandbox● Supported
POST/v2/sandboxesCreate a sandbox (v2)● Supported
GET/v2/sandboxesList sandboxes (v2)● Supported
POST/v2/sandboxes/{sandboxID}/connectConnect to a sandbox (v2)● Supported
GET/templatesList templates● Supported
GET/v2/templatesList templates (v2)● Supported
POST/volumesCreate team volume● Supported
GET/volumesList team volumes● Supported
GET/volumes/{volumeID}Team volume● Supported
DELETE/volumes/{volumeID}Delete team volume● Supported
POST/sandboxes/{sandboxID}/forkFork a sandbox● Supported
POST/sandboxes/{sandboxID}/snapshotsCreate a snapshot● Supported
GET/snapshotsList snapshots● Supported
DELETE/templates/{templateID}Delete a snapshot● Supported
PUT/sandboxes/{sandboxID}/networkUpdate sandbox network● Supported
GET/v2/sandboxes/{sandboxID}/logsGet sandbox logs● Supported

Differences from E2B

  • Create a sandbox:Deprecated: the latest official SDK uses v2. The platform does not provide E2B's default base template yet: Sandbox.create() without a template returns 404, so name a template explicitly (see List templates for what is available).
  • List running sandboxes:Deprecated: the latest official SDK uses v2.
  • Connect to a sandbox:Deprecated: the latest official SDK uses v2.
  • List templates:Deprecated: the latest official SDK uses v2.

For authoritative parameter definitions, see the official E2B documentation.

Errors follow the E2B format, see errors; quotas and response headers are covered in rate limits.

Create a sandbox

POST /e2b/sandboxes● Supported

Official E2B docs ↗

Request body

  • templateIDstring必填

    Template ID or alias from templates.list; resolves to your ready Environment first, then a public Base. Supply it explicitly.

  • timeoutinteger可选
    默认 15

    Time to live for the sandbox in seconds.

  • autoPauseboolean可选
    默认 false

    Automatically pauses the sandbox after the timeout

  • metadataany可选
  • envVarsany可选
  • secureboolean可选

    Secure all system communication with sandbox

  • allow_internet_accessboolean可选

    Allow sandbox to access the internet. When set to false, it behaves the same as specifying denyOut to 0.0.0.0/0 in the network config.

  • autoPauseMemoryboolean可选
    默认 true

    Controls the snapshot kind taken when the sandbox auto-pauses on timeout (only relevant when autoPause is true). When false, the auto-pause drops the in-memory state and persists only the filesystem (a filesystem-only snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such a snapshot cannot be auto-resumed by traffic and must be resumed explicitly, so it cannot be combined with autoResume. Defaults to true (full memory snapshot).

  • autoResumeobject可选

    Auto-resume configuration for paused sandboxes.

    ▸ 展开子字段(1)
    • enabledboolean必填
      默认 false

      Auto-resume enabled flag for paused sandboxes. Default false.

  • networkobject可选
    ▸ 展开子字段(7)
    • allowPublicTrafficboolean可选
      默认 true

      Specify if the sandbox URLs should be accessible only with authentication.

    • allowOutarray可选

      List of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com", "*.example.com"). Allowed entries always take precedence over denied entries.

    • denyOutarray可选

      List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.

    • egressProxyobject可选

      SOCKS5 proxy for sandbox egress. Outbound TCP is tunneled through the proxy after allow/deny filtering; the sandbox is unaware. Domain-matched flows use remote DNS (ATYP=domain).

    • maskRequestHoststring可选

      Specify host mask which will be used for all sandbox requests

    • httpsPortsarray可选

      Unlike E2B, network.httpsPorts is rejected; omit it and serve plaintext HTTP inside the sandbox. The public port URL still uses HTTPS. The upstream field denotes HTTPS-speaking internal ports, permits self-signed certificates and excludes envd port 49983.

    • rulesobject可选

      Per-domain transform rules applied to matching outbound HTTPS requests. Keys may be exact DNS names (for example, "api.example.com") or a leading wildcard (for example, "*.example.com"), and are normalized to lowercase on write. Wildcards match subdomains at any depth but not the apex domain; a bare "*" is invalid. Exact rules take precedence, followed by the longest matching wildcard suffix, and matching rule sets are not merged. Broad wildcards such as "*.com" are allowed and may expose transformed credentials to every matching destination the sandbox contacts. Rules do not grant network access; configure allowOut separately to permit the destination.

  • ▸ 更多参数(3)
    • mcpobject可选

      MCP configuration for the sandbox

    • iamobject可选

      Sandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.

      ▸ 展开子字段(1)
      • tokensobject可选

        Named workload-token definitions, keyed by a caller-chosen token name.

    • volumeMountsarray可选
      ▸ 展开子字段(2)
      • namestring必填

        Name of the volume

      • pathstring必填

        Path of the volume

Returns

201

Deprecated: the latest official SDK uses v2. The platform does not provide E2B's default base template yet: Sandbox.create() without a template returns 404, so name a template explicitly (see List templates for what is available).

Errors follow the E2B format — see error codes

Response

HTTP 201

The sandbox was created successfully

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
sandboxIDstringIdentifier of the sandbox
aliasstringAlias of the template
clientIDstringIdentifier of the client
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
trafficAccessTokenstringToken required for accessing sandbox via proxy.
domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.

List running sandboxes

GET /e2b/sandboxes● Supported

Official E2B docs ↗

Request parameters

  • metadatastring可选

    query: Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod"). Each key and values must be URL encoded.

Returns

200

Deprecated: the latest official SDK uses v2.

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned all running sandboxes

application/json

NameTypeDescription
[].templateIDstringIdentifier of the template from which is the sandbox created
[].aliasstringAlias of the template
[].sandboxIDstringIdentifier of the sandbox
[].clientIDstringIdentifier of the client
[].startedAtstringTime when the sandbox was started
[].endAtstringTime when the sandbox will expire
[].cpuCountintegerCPU cores for the sandbox
[].memoryMBintegerMemory for the sandbox in MiB
[].diskSizeMBintegerDisk size for the sandbox in MiB
[].metadataany
[].statestringState of the sandbox
[].envdVersionstringVersion of the envd running in the sandbox
[].volumeMountsarray<object>
[].volumeMounts[].namestringName of the volume
[].volumeMounts[].pathstringPath of the volume

Get a sandbox

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

GET /e2b/sandboxes/{sandboxID}● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned the sandbox

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
aliasstringAlias of the template
sandboxIDstringIdentifier of the sandbox
clientIDstringIdentifier of the client
startedAtstringTime when the sandbox was started
endAtstringTime when the sandbox will expire
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
allowInternetAccessbooleanWhether internet access was explicitly enabled or disabled for the sandbox. Null means it was not explicitly set.
domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.
cpuCountintegerCPU cores for the sandbox
memoryMBintegerMemory for the sandbox in MiB
diskSizeMBintegerDisk size for the sandbox in MiB
metadataany
statestringState of the sandbox
networkobject
network.allowPublicTrafficbooleanSpecify if the sandbox URLs should be accessible only with authentication.
network.allowOutarray<string>List of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com", "*.example.com"). Allowed entries always take precedence over denied entries.
network.denyOutarray<string>List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.
network.egressProxyobjectSOCKS5 proxy for sandbox egress. Outbound TCP is tunneled through the proxy after allow/deny filtering; the sandbox is unaware. Domain-matched flows use remote DNS (ATYP=domain).
network.maskRequestHoststringSpecify host mask which will be used for all sandbox requests
network.httpsPortsarray<integer>Unlike E2B, network.httpsPorts is rejected; omit it and serve plaintext HTTP inside the sandbox. The public port URL still uses HTTPS. The upstream field denotes HTTPS-speaking internal ports, permits self-signed certificates and excludes envd port 49983.
network.rulesobjectPer-domain transform rules applied to matching outbound HTTPS requests. Keys may be exact DNS names (for example, "api.example.com") or a leading wildcard (for example, ".example.com"), and are normalized to lowercase on write. Wildcards match subdomains at any depth but not the apex domain; a bare "" is invalid. Exact rules take precedence, followed by the longest matching wildcard suffix, and matching rule sets are not merged. Broad wildcards such as "*.com" are allowed and may expose transformed credentials to every matching destination the sandbox contacts. Rules do not grant network access; configure allowOut separately to permit the destination.
lifecycleobjectSandbox lifecycle policy returned by sandbox info.
lifecycle.autoResumebooleanWhether the sandbox can auto-resume.
lifecycle.onTimeoutstringAction taken when the sandbox times out.
volumeMountsarray<object>
volumeMounts[].namestringName of the volume
volumeMounts[].pathstringPath of the volume

Get sandbox metrics

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

GET /e2b/sandboxes/{sandboxID}/metrics● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • startinteger可选

    query: Unix timestamp for the start of the interval, in seconds, for which the metrics

  • endinteger可选

    query: Unix timestamp for the end of the interval, in seconds, for which the metrics

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned the sandbox metrics

application/json

NameTypeDescription
[].timestampstringTimestamp of the metric entry
[].timestampUnixintegerTimestamp of the metric entry in Unix time (seconds since epoch)
[].cpuCountintegerNumber of CPU cores
[].cpuUsedPctnumberCPU usage percentage
[].memUsedintegerMemory used in bytes
[].memTotalintegerTotal memory in bytes
[].memCacheintegerCached memory (page cache) in bytes
[].diskUsedintegerDisk used in bytes
[].diskTotalintegerTotal disk space in bytes

Set sandbox timeout

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

POST /e2b/sandboxes/{sandboxID}/timeout● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • timeoutinteger必填

    Timeout in seconds from the current time after which the sandbox should expire

Returns

204

Errors follow the E2B format — see error codes

Response

HTTP 204

Successfully set the sandbox timeout

No response body is declared.

Pause a sandbox

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

POST /e2b/sandboxes/{sandboxID}/pause● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • memoryboolean可选
    默认 true

    Whether to capture a full memory snapshot. When false, only the filesystem is persisted and resuming the sandbox cold-boots (reboots) it from disk, losing in-memory state, running processes, and open connections. Resume it with an explicit request (connect or resume); auto-resume, which can be triggered by arbitrary traffic, refuses such a sandbox. Defaults to true.

Returns

204

Errors follow the E2B format — see error codes

Response

HTTP 204

The sandbox was paused successfully and can be resumed

No response body is declared.

Connect to a sandbox

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

POST /e2b/sandboxes/{sandboxID}/connect● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • timeoutinteger必填

    Timeout in seconds from the current time after which the sandbox should expire

  • memoryboolean可选

    Defaults to true. When false and the sandbox is paused, resume from disk state only: the sandbox cold-boots fresh and any memory in the snapshot is ignored, never modified or deleted. Disk state has crash-recovery semantics — writes not flushed before the pause may be lost. A no-op for snapshots that contain no memory. Rejected with an error in environments where this capability is not enabled, never silently downgraded to a memory restore.

Returns

201

Deprecated: the latest official SDK uses v2.

Errors follow the E2B format — see error codes

Response

HTTP 200

The sandbox was already running

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
sandboxIDstringIdentifier of the sandbox
aliasstringAlias of the template
clientIDstringIdentifier of the client
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
trafficAccessTokenstringToken required for accessing sandbox via proxy.
domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.

HTTP 201

The sandbox was resumed successfully

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
sandboxIDstringIdentifier of the sandbox
aliasstringAlias of the template
clientIDstringIdentifier of the client
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
trafficAccessTokenstringToken required for accessing sandbox via proxy.
domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.

Kill a sandbox

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

DELETE /e2b/sandboxes/{sandboxID}● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

Returns

204

Errors follow the E2B format — see error codes

Response

HTTP 204

The sandbox was killed successfully

No response body is declared.

Create a sandbox (v2)

POST /e2b/v2/sandboxes● Supported

Official E2B docs ↗

Request body

  • templateIDstring必填

    Template ID or alias from templates.list; resolves to your ready Environment first, then a public Base. Supply it explicitly.

  • timeoutinteger可选
    默认 300

    Time to live for the sandbox in seconds.

  • autoPauseboolean可选
    默认 false

    Automatically pauses the sandbox after the timeout

  • metadataany可选
  • envVarsany可选
  • allow_internet_accessboolean可选

    Allow sandbox to access the internet. When set to false, it behaves the same as specifying denyOut to 0.0.0.0/0 in the network config.

  • autoPauseMemoryboolean可选
    默认 true

    Controls the snapshot kind taken when the sandbox auto-pauses on timeout (only relevant when autoPause is true). When false, the auto-pause drops the in-memory state and persists only the filesystem (a filesystem-only snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such a snapshot cannot be auto-resumed by traffic and must be resumed explicitly, so it cannot be combined with autoResume. Defaults to true (full memory snapshot).

  • autoResumeobject可选

    Auto-resume configuration for paused sandboxes.

    ▸ 展开子字段(1)
    • enabledboolean必填
      默认 false

      Auto-resume enabled flag for paused sandboxes. Default false.

  • networkobject可选
    ▸ 展开子字段(7)
    • allowPublicTrafficboolean可选
      默认 true

      Specify if the sandbox URLs should be accessible only with authentication.

    • allowOutarray可选

      List of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com", "*.example.com"). Allowed entries always take precedence over denied entries.

    • denyOutarray可选

      List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.

    • egressProxyobject可选

      SOCKS5 proxy for sandbox egress. Outbound TCP is tunneled through the proxy after allow/deny filtering; the sandbox is unaware. Domain-matched flows use remote DNS (ATYP=domain).

    • maskRequestHoststring可选

      Specify host mask which will be used for all sandbox requests

    • httpsPortsarray可选

      Unlike E2B, network.httpsPorts is rejected; omit it and serve plaintext HTTP inside the sandbox. The public port URL still uses HTTPS. The upstream field denotes HTTPS-speaking internal ports, permits self-signed certificates and excludes envd port 49983.

    • rulesobject可选

      Per-domain transform rules applied to matching outbound HTTPS requests. Keys may be exact DNS names (for example, "api.example.com") or a leading wildcard (for example, "*.example.com"), and are normalized to lowercase on write. Wildcards match subdomains at any depth but not the apex domain; a bare "*" is invalid. Exact rules take precedence, followed by the longest matching wildcard suffix, and matching rule sets are not merged. Broad wildcards such as "*.com" are allowed and may expose transformed credentials to every matching destination the sandbox contacts. Rules do not grant network access; configure allowOut separately to permit the destination.

  • mcpobject可选

    MCP configuration for the sandbox

  • ▸ 更多参数(2)
    • iamobject可选

      Sandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.

      ▸ 展开子字段(1)
      • tokensobject可选

        Named workload-token definitions, keyed by a caller-chosen token name.

    • volumeMountsarray可选
      ▸ 展开子字段(2)
      • namestring必填

        Name of the volume

      • pathstring必填

        Path of the volume

Returns

201

Errors follow the E2B format — see error codes

Response

HTTP 201

The sandbox was created successfully

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
sandboxIDstringIdentifier of the sandbox
aliasstringAlias of the template
clientIDstringIdentifier of the client
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
trafficAccessTokenstringToken required for accessing sandbox via proxy.
domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.

List sandboxes (v2)

GET /e2b/v2/sandboxes● Supported

Official E2B docs ↗

Request parameters

  • metadatastring可选

    query: Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod"). Each key and values must be URL encoded.

  • statearray可选

    query: Filter sandboxes by one or more states

  • orderstring可选
    默认 "desc"

    query: Sort direction by sandbox start time. Defaults to desc (newest first).

    取值 ascdesc
  • startedAfterstring可选

    query: Return sandboxes started at or after this timestamp.

  • templatestring可选

    query: Filter sandboxes by a template ID or alias.

  • nextTokenstring可选

    query: Cursor to start the list from

  • limitinteger可选
    默认 100

    query: Maximum number of items to return per page

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned all running sandboxes

application/json

NameTypeDescription
[].templateIDstringIdentifier of the template from which is the sandbox created
[].aliasstringAlias of the template
[].sandboxIDstringIdentifier of the sandbox
[].clientIDstringIdentifier of the client
[].startedAtstringTime when the sandbox was started
[].endAtstringTime when the sandbox will expire
[].cpuCountintegerCPU cores for the sandbox
[].memoryMBintegerMemory for the sandbox in MiB
[].diskSizeMBintegerDisk size for the sandbox in MiB
[].metadataany
[].statestringState of the sandbox
[].envdVersionstringVersion of the envd running in the sandbox
[].volumeMountsarray<object>
[].volumeMounts[].namestringName of the volume
[].volumeMounts[].pathstringPath of the volume

Connect to a sandbox (v2)

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

POST /e2b/v2/sandboxes/{sandboxID}/connect● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • timeoutinteger可选
    默认 300

    Timeout in seconds from the current time after which the sandbox should expire

  • memoryboolean可选

    Defaults to true. When false and the sandbox is paused, resume from disk state only: the sandbox cold-boots fresh and any memory in the snapshot is ignored, never modified or deleted. Disk state has crash-recovery semantics — writes not flushed before the pause may be lost. A no-op for snapshots that contain no memory. Rejected with an error in environments where this capability is not enabled, never silently downgraded to a memory restore.

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

The sandbox was already running

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
sandboxIDstringIdentifier of the sandbox
aliasstringAlias of the template
clientIDstringIdentifier of the client
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
trafficAccessTokenstringToken required for accessing sandbox via proxy.
domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.

HTTP 201

The sandbox was resumed successfully

application/json

NameTypeDescription
templateIDstringIdentifier of the template from which is the sandbox created
sandboxIDstringIdentifier of the sandbox
aliasstringAlias of the template
clientIDstringIdentifier of the client
envdVersionstringVersion of the envd running in the sandbox
envdAccessTokenstringAccess token used for envd communication
trafficAccessTokenstringToken required for accessing sandbox via proxy.
domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.

List templates

GET /e2b/templates● Supported

Official E2B docs ↗

Request parameters

  • teamIDstring可选

    query: Identifier of the team

Returns

200

Deprecated: the latest official SDK uses v2.

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned all templates

application/json

NameTypeDescription
[].templateIDstringIdentifier of the template
[].buildIDstringIdentifier of the last successful build for given template
[].cpuCountintegerCPU cores for the sandbox
[].memoryMBintegerMemory for the sandbox in MiB
[].diskSizeMBintegerDisk size for the sandbox in MiB
[].publicbooleanWhether the template is public or only accessible by the team
[].aliasesarray<string>Aliases of the template
[].namesarray<string>Names of the template (namespace/alias format when namespaced)
[].createdAtstringTime when the template was created
[].updatedAtstringTime when the template was last updated
[].createdByobject
[].createdBy.idstringIdentifier of the user
[].createdBy.emailstringEmail of the user
[].lastSpawnedAtstringTime when the template was last used
[].spawnCountintegerNumber of times the template was used
[].buildCountintegerNumber of times the template was built
[].envdVersionstringVersion of the envd running in the sandbox
[].buildStatusstringStatus of the template build

List templates (v2)

GET /e2b/v2/templates● Supported

Official E2B docs ↗

Request parameters

  • teamIDstring可选

    query: Identifier of the team

  • nextTokenstring可选

    query: Cursor to start the list from

  • limitinteger可选
    默认 100

    query: Maximum number of items to return per page

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned all templates

application/json

NameTypeDescription
[].templateIDstringIdentifier of the template
[].buildIDstringIdentifier of the last successful build for given template
[].cpuCountintegerCPU cores for the sandbox
[].memoryMBintegerMemory for the sandbox in MiB
[].diskSizeMBintegerDisk size for the sandbox in MiB
[].publicbooleanWhether the template is public or only accessible by the team
[].aliasesarray<string>Aliases of the template
[].namesarray<string>Names of the template (namespace/alias format when namespaced)
[].createdAtstringTime when the template was created
[].updatedAtstringTime when the template was last updated
[].createdByobject
[].createdBy.idstringIdentifier of the user
[].createdBy.emailstringEmail of the user
[].lastSpawnedAtstringTime when the template was last used
[].spawnCountintegerNumber of times the template was used
[].buildCountintegerNumber of times the template was built
[].envdVersionstringVersion of the envd running in the sandbox
[].buildStatusstringStatus of the template build

Create team volume

POST /e2b/volumes● Supported

Official E2B docs ↗

Request body

  • namestring必填

    Name of the volume

Returns

201

Errors follow the E2B format — see error codes

Response

HTTP 201

Successfully created a new team volume

application/json

NameTypeDescription
volumeIDstringID of the volume
namestringName of the volume
tokenstringAuth token to use for interacting with volume content
domainstringDomain to use as the destination for volume content requests, replacing the default `api.<E2B_DOMAIN>`. Only returned when the team is connected to a custom (BYOC) cluster; absent otherwise, in which case the default domain is used.

List team volumes

GET /e2b/volumes● Supported

Official E2B docs ↗

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully listed all team volumes

application/json

NameTypeDescription
[].volumeIDstringID of the volume
[].namestringName of the volume

Team volume

GET /e2b/volumes/{volumeID}● Supported

Official E2B docs ↗

Request parameters

  • volumeIDstring必填

    path:

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully retrieved a team volume

application/json

NameTypeDescription
volumeIDstringID of the volume
namestringName of the volume
tokenstringAuth token to use for interacting with volume content
domainstringDomain to use as the destination for volume content requests, replacing the default `api.<E2B_DOMAIN>`. Only returned when the team is connected to a custom (BYOC) cluster; absent otherwise, in which case the default domain is used.

Delete team volume

DELETE /e2b/volumes/{volumeID}● Supported

Official E2B docs ↗

Request parameters

  • volumeIDstring必填

    path:

Returns

204

Errors follow the E2B format — see error codes

Response

HTTP 204

Successfully deleted a team volume

No response body is declared.

Fork a sandbox

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

POST /e2b/sandboxes/{sandboxID}/fork● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • timeoutinteger可选
    默认 15

    Time to live for each fork in seconds.

  • countinteger可选
    默认 1

    Number of independent forks from one snapshot; each entry reports its own result or error.

Returns

201

Errors follow the E2B format — see error codes

Response

HTTP 201

The sandbox was snapshotted and the forks were attempted; each entry reports one fork's outcome

application/json

NameTypeDescription
[].sandboxobject
[].sandbox.templateIDstringIdentifier of the template from which is the sandbox created
[].sandbox.sandboxIDstringIdentifier of the sandbox
[].sandbox.aliasstringAlias of the template
[].sandbox.clientIDstringIdentifier of the client
[].sandbox.envdVersionstringVersion of the envd running in the sandbox
[].sandbox.envdAccessTokenstringAccess token used for envd communication
[].sandbox.trafficAccessTokenstringToken required for accessing sandbox via proxy.
[].sandbox.domainstringDomain returned for sandbox traffic. Build an HTTP service URL as https://<port>-<sandboxID>.<domain> using the returned values, without replacing or stripping the sandboxID suffix.
[].errorobject
[].error.codeintegerError code
[].error.error_codestringMachine-readable semantic error code. Not a closed set; initial values: sandbox_capacity_unavailable, sandbox_placement_timeout, sandbox_no_compatible_node, sandbox_create_failed, internal_server_error.
[].error.messagestringError

Create a snapshot

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

POST /e2b/sandboxes/{sandboxID}/snapshots● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • namestring可选

    Optional alias. Reusing it within your subject updates the existing snapshot and retains its platform ID.

Returns

201

Errors follow the E2B format — see error codes

Response

HTTP 201

Snapshot created successfully

application/json

NameTypeDescription
snapshotIDstringIdentifier of the snapshot template including the tag. Uses namespace/alias when a name was provided (e.g. team-slug/my-snapshot:default), otherwise falls back to the raw template ID (e.g. abc123:default).
namesarray<string>Full names of the snapshot template including team namespace and tag (e.g. team-slug/my-snapshot:v2)

List snapshots

GET /e2b/snapshots● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring可选

    query: Filter by source sandbox ID.

  • namestring可选

    query: Filter by the original user alias or platform snap_ snapshot ID.

  • limitinteger可选
    默认 100

    query: Maximum snapshots per page.

  • nextTokenstring可选

    query: Cursor from the previous response's X-Next-Token header.

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned snapshots

application/json

NameTypeDescription
[].snapshotIDstringIdentifier of the snapshot template including the tag. Uses namespace/alias when a name was provided (e.g. team-slug/my-snapshot:default), otherwise falls back to the raw template ID (e.g. abc123:default).
[].namesarray<string>Full names of the snapshot template including team namespace and tag (e.g. team-slug/my-snapshot:v2)

Delete a snapshot

DELETE /e2b/templates/{templateID}● Supported

Official E2B docs ↗

Request parameters

  • templateIDstring必填

    path: The snap_ snapshot ID returned by this platform. Vendor handles are not accepted.

Returns

204

Errors follow the E2B format — see error codes

Response

HTTP 204

The template was deleted successfully

No response body is declared.

Update sandbox network

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

PUT /e2b/sandboxes/{sandboxID}/network● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • allow_internet_accessboolean可选

    Allow internet access; false is equivalent to denyOut containing 0.0.0.0/0.

  • allowOutarray可选

    Allowed egress CIDRs, IPs or domains; allow rules take precedence over deny rules.

  • denyOutarray可选

    Denied egress CIDRs or IPs; domains are not supported.

  • egressProxyobject可选

    Upstream proxy configuration; not currently applied by this platform.

    ▸ 展开子字段(3)
    • addressstring必填

      SOCKS5 proxy address in host:port format (e.g. "proxy.example.com:1080").

    • usernamestring可选

      Optional SOCKS5 username (RFC 1929), max 255 bytes.

    • passwordstring可选

      Optional SOCKS5 password (RFC 1929), max 255 bytes.

  • rulesobject可选

    Upstream per-domain transform rules; not currently applied by this platform.

Returns

204

Errors follow the E2B format — see error codes

Response

HTTP 204

Successfully updated the sandbox network configuration

No response body is declared.

Get sandbox logs

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

GET /e2b/v2/sandboxes/{sandboxID}/logs● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstring必填

    path:

  • cursorinteger可选

    query: Starting timestamp in Unix milliseconds.

  • limitinteger可选
    默认 1000

    query: Maximum log entries to return.

  • directionstring可选

    query: Read forward or backward in time.

    取值 forwardbackward
  • levelstring可选

    query: Minimum log level to return.

    取值 debuginfowarnerror
  • searchstring可选

    query: Case-sensitive substring filter on log messages.

Returns

200

Errors follow the E2B format — see error codes

Response

HTTP 200

Successfully returned the sandbox logs

application/json

NameTypeDescription
logsarray<object>Sandbox logs structured
logs[].timestampstringTimestamp of the log entry
logs[].messagestringLog message content
logs[].levelstringState of the sandbox
logs[].fieldsobject