2026-10-20
(待译)
Sandbox runs isolated environments for commands, files and HTTP services through /sandbox/v1, with an SDK-compatible face at /e2b. Concepts and behavior follow E2B (templates, sandboxes, envd files and commands, timeouts and pause/resume), so E2B experience applies. Differences: templateID resolves to your ready Environment or a public Base and must be supplied explicitly; light sandboxes are own-face only, preserve disk rather than memory on pause and provide a limited shell, line terminals and no metrics; port URLs use the returned sandboxID and domain, not an E2B hostname; network.httpsPorts is rejected; persistent sandboxes can resume on traffic even when autoResume is false. Files and command execution use the envd data plane; the sandbox management methods do not execute commands or write files. Start with praxis.sandbox.templates.list to choose an available template.
加载中…用 HTTP 直接调用 /sandbox/v1,请求携带 X-API-Key。官方 E2B SDK 请使用 E2B 兼容接口,不能只修改 API 地址来调用这里的接口。
HTTP 基础地址:。
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| POST | /v1/sandboxes | 创建沙箱 | ● 支持 |
| POST | /v1/sandboxes/{sandboxID}/upgrade | 升级为完整沙箱 | ● 支持 |
| GET | /v1/sandboxes | 列出沙箱 | ● 支持 |
| GET | /v1/sandboxes/{sandboxID} | 读取沙箱 | ● 支持 |
| PATCH | /v1/sandboxes/{sandboxID} | 重命名沙箱 | ● 支持 |
| GET | /v1/sandboxes/{sandboxID}/metrics | 沙箱指标 | ● 支持 |
| POST | /v1/sandboxes/{sandboxID}/timeout | 设置超时 | ● 支持 |
| POST | /v1/sandboxes/{sandboxID}/pause | 暂停沙箱 | ● 支持 |
| POST | /v1/sandboxes/{sandboxID}/connect | 连接沙箱 | ● 支持 |
| DELETE | /v1/sandboxes/{sandboxID} | 终止沙箱 | ● 支持 |
| GET | /v1/templates | 列出模板 | ● 支持 |
| POST | /v1/volumes | 创建卷 | ● 支持 |
| GET | /v1/volumes | 列出卷 | ● 支持 |
| GET | /v1/volumes/{volumeID} | 读取卷 | ● 支持 |
| DELETE | /v1/volumes/{volumeID} | 删除卷 | ● 支持 |
| POST | /v1/sandboxes/{sandboxID}/fork | 复制沙箱 | ● 支持 |
| POST | /v1/sandboxes/{sandboxID}/snapshots | 创建快照 | ● 支持 |
| GET | /v1/snapshots | 列出快照 | ● 支持 |
| DELETE | /v1/snapshots/{snapshotID} | 删除快照 | ● 支持 |
| PUT | /v1/sandboxes/{sandboxID}/network | 更新网络策略 | ● 支持 |
| GET | /v1/sandboxes/{sandboxID}/logs | 读取沙箱日志 | ● 支持 |
| POST | /v1/sandboxes/{sandboxID}/extend | 延长沙箱 | ● 支持 |
| GET | /v1/sandboxes/{sandboxID}/processes | 列出进程 | ● 支持 |
| GET | /v1/sandboxes/{sandboxID}/processes/{processID}/output | 读取输出 | ● 支持 |
参数与字段的权威定义以 E2B 官方文档为准。
/sandbox/v1/sandboxes● 支持templateIDstring必填Template ID or alias from templates.list; resolves to your ready Environment first, then a public Base. Supply it explicitly.
timeoutinteger可选Lifetime of the new sandbox in seconds. Defaults to 300 seconds when omitted.
autoPauseboolean可选Automatically pauses the sandbox after the timeout
metadataany可选Your own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes.
envVarsany可选Environment variables as name to value string pairs.
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可选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.
enabledboolean必填Auto-resume enabled flag for paused sandboxes. Default false.
networkobject可选Network policy of the sandbox: public access, egress allow and deny lists and proxy.
allowPublicTrafficboolean可选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
iamobject可选Sandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.
tokensobject可选Named workload-token definitions, keyed by a caller-chosen token name.
volumeMountsarray可选Volumes to mount into the sandbox, each with the volume name and the path inside the sandbox.
namestring必填Name of the volume
pathstring必填Path of the volume
201
平台暂未提供 E2B 默认的 base 模板:不带模板参数的 Sandbox.create() 会返回 404,请显式指定模板(可用模板见「列出模板」)。
错误按 E2B 格式返回,参见 错误码
The sandbox was created successfully
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| sandboxID | string | Identifier of the sandbox |
| alias | string | Alias of the template |
| clientID | string | Identifier of the client |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| trafficAccessToken | string | Token required for accessing sandbox via proxy. |
| domain | string | Domain 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. |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/upgrade● 支持sandboxIDstring必填path: 沙箱 ID。
templateIDstring可选目标模板,默认 base(node22 别名);必须包含 E2B 镜像,否则返回 INVALID_PARAMS。升级期间文件、进程与数据面操作返回 409。
200
错误按 E2B 格式返回,参见 错误码
Upgraded sandbox detail with a replacement access token
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| alias | string | Alias of the template |
| sandboxID | string | Identifier of the sandbox |
| clientID | string | Identifier of the client |
| startedAt | string | Time when the sandbox was started |
| endAt | string | Time when the sandbox will expire |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| allowInternetAccess | boolean | Whether internet access was explicitly enabled or disabled for the sandbox. Null means it was not explicitly set. |
| domain | string | Domain 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. |
| cpuCount | integer | CPU cores for the sandbox |
| memoryMB | integer | Memory for the sandbox in MiB |
| diskSizeMB | integer | Disk size for the sandbox in MiB |
| metadata | any | Your own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes. |
| state | string | State of the sandbox |
| network | object | Network policy of the sandbox: public access, egress allow and deny lists and proxy. |
| network.allowPublicTraffic | boolean | Specify if the sandbox URLs should be accessible only with authentication. |
| network.allowOut | array<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.denyOut | array<string> | List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules. |
| network.egressProxy | object | 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). |
| network.maskRequestHost | string | Specify host mask which will be used for all sandbox requests |
| network.httpsPorts | array<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.rules | object | 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. |
| lifecycle | object | Sandbox lifecycle policy returned by sandbox info. |
| lifecycle.autoResume | boolean | Whether the sandbox can auto-resume. |
| lifecycle.onTimeout | string | Action taken when the sandbox times out. |
| volumeMounts | array<object> | Volumes mounted into the sandbox. |
| volumeMounts[].name | string | Name of the volume |
| volumeMounts[].path | string | Path of the volume |
/sandbox/v1/sandboxes● 支持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: live:运行中;exited:已退出;all:全部保留记录。默认 live。
orderstring可选query: Sort direction by sandbox start time. Defaults to desc (newest first).
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可选query: Maximum number of items to return per page
namestring可选query: 按名称子串搜索,不区分大小写;中文、%、_ 和反斜杠按原样匹配。去除首尾空白后须为 1–64 个字符。可与状态及分页参数组合;历史空名称不匹配。
200
错误按 E2B 格式返回,参见 错误码
Successfully returned all running sandboxes
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].templateID | string | Identifier of the template from which is the sandbox created |
| [].alias | string | Alias of the template |
| [].sandboxID | string | Identifier of the sandbox |
| [].clientID | string | Identifier of the client |
| [].startedAt | string | Time when the sandbox was started |
| [].endAt | string | Time when the sandbox will expire |
| [].cpuCount | integer | CPU cores for the sandbox |
| [].memoryMB | integer | Memory for the sandbox in MiB |
| [].diskSizeMB | integer | Disk size for the sandbox in MiB |
| [].metadata | any | Your own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes. |
| [].state | string | State of the sandbox |
| [].envdVersion | string | Version of the envd running in the sandbox |
| [].volumeMounts | array<object> | Volumes mounted into the sandbox. |
| [].volumeMounts[].name | string | Name of the volume |
| [].volumeMounts[].path | string | Path of the volume |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
Successfully returned the sandbox
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| alias | string | Alias of the template |
| sandboxID | string | Identifier of the sandbox |
| clientID | string | Identifier of the client |
| startedAt | string | Time when the sandbox was started |
| endAt | string | Time when the sandbox will expire |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| allowInternetAccess | boolean | Whether internet access was explicitly enabled or disabled for the sandbox. Null means it was not explicitly set. |
| domain | string | Domain 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. |
| cpuCount | integer | CPU cores for the sandbox |
| memoryMB | integer | Memory for the sandbox in MiB |
| diskSizeMB | integer | Disk size for the sandbox in MiB |
| metadata | any | Your own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes. |
| state | string | State of the sandbox |
| network | object | Network policy of the sandbox: public access, egress allow and deny lists and proxy. |
| network.allowPublicTraffic | boolean | Specify if the sandbox URLs should be accessible only with authentication. |
| network.allowOut | array<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.denyOut | array<string> | List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules. |
| network.egressProxy | object | 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). |
| network.maskRequestHost | string | Specify host mask which will be used for all sandbox requests |
| network.httpsPorts | array<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.rules | object | 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. |
| lifecycle | object | Sandbox lifecycle policy returned by sandbox info. |
| lifecycle.autoResume | boolean | Whether the sandbox can auto-resume. |
| lifecycle.onTimeout | string | Action taken when the sandbox times out. |
| volumeMounts | array<object> | Volumes mounted into the sandbox. |
| volumeMounts[].name | string | Name of the volume |
| volumeMounts[].path | string | Path of the volume |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}● 支持sandboxIDstring必填path: 沙箱 ID。
namestring必填新名称;去除首尾空白后须为 1–64 个字符。同团队重名返回 409。请求只允许 name 字段。
200
错误按 E2B 格式返回,参见 错误码
Updated sandbox detail
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| alias | string | Alias of the template |
| sandboxID | string | Identifier of the sandbox |
| clientID | string | Identifier of the client |
| startedAt | string | Time when the sandbox was started |
| endAt | string | Time when the sandbox will expire |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| allowInternetAccess | boolean | Whether internet access was explicitly enabled or disabled for the sandbox. Null means it was not explicitly set. |
| domain | string | Domain 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. |
| cpuCount | integer | CPU cores for the sandbox |
| memoryMB | integer | Memory for the sandbox in MiB |
| diskSizeMB | integer | Disk size for the sandbox in MiB |
| metadata | any | Your own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes. |
| state | string | State of the sandbox |
| network | object | Network policy of the sandbox: public access, egress allow and deny lists and proxy. |
| network.allowPublicTraffic | boolean | Specify if the sandbox URLs should be accessible only with authentication. |
| network.allowOut | array<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.denyOut | array<string> | List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules. |
| network.egressProxy | object | 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). |
| network.maskRequestHost | string | Specify host mask which will be used for all sandbox requests |
| network.httpsPorts | array<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.rules | object | 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. |
| lifecycle | object | Sandbox lifecycle policy returned by sandbox info. |
| lifecycle.autoResume | boolean | Whether the sandbox can auto-resume. |
| lifecycle.onTimeout | string | Action taken when the sandbox times out. |
| volumeMounts | array<object> | Volumes mounted into the sandbox. |
| volumeMounts[].name | string | Name of the volume |
| volumeMounts[].path | string | Path of the volume |
| name | string | Current name of the sandbox. |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/metrics● 支持sandboxIDstring必填path: 沙箱 ID。
startinteger可选query: Unix timestamp for the start of the interval, in seconds, for which the metrics
endinteger可选query: Unix timestamp in seconds at which the metrics window ends. Omit it to read up to the latest sample.
200
错误按 E2B 格式返回,参见 错误码
Successfully returned the sandbox metrics
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].timestamp | string | Timestamp of the metric entry |
| [].timestampUnix | integer | Timestamp of the metric entry in Unix time (seconds since epoch) |
| [].cpuCount | integer | Number of CPU cores |
| [].cpuUsedPct | number | CPU usage percentage |
| [].memUsed | integer | Memory used in bytes |
| [].memTotal | integer | Total memory in bytes |
| [].memCache | integer | Cached memory (page cache) in bytes |
| [].diskUsed | integer | Disk used in bytes |
| [].diskTotal | integer | Total disk space in bytes |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/timeout● 支持sandboxIDstring必填path: 沙箱 ID。
timeoutinteger必填New lifetime in seconds from now, replacing the current expiry rather than adding to it. May shorten the remaining lifetime.
204
错误按 E2B 格式返回,参见 错误码
Successfully set the sandbox timeout
未声明响应体。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/pause● 支持sandboxIDstring必填path: 沙箱 ID。
memoryboolean可选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.
204
错误按 E2B 格式返回,参见 错误码
The sandbox was paused successfully and can be resumed
未声明响应体。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/connect● 支持sandboxIDstring必填path: 沙箱 ID。
timeoutinteger可选Requested remaining lifetime in seconds from the connection. Defaults to 300 seconds; an existing later expiry is preserved.
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.
201
错误按 E2B 格式返回,参见 错误码
The sandbox was already running
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| sandboxID | string | Identifier of the sandbox |
| alias | string | Alias of the template |
| clientID | string | Identifier of the client |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| trafficAccessToken | string | Token required for accessing sandbox via proxy. |
| domain | string | Domain 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. |
The sandbox was resumed successfully
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| sandboxID | string | Identifier of the sandbox |
| alias | string | Alias of the template |
| clientID | string | Identifier of the client |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| trafficAccessToken | string | Token required for accessing sandbox via proxy. |
| domain | string | Domain 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. |
/sandbox/v1/templates● 支持teamIDstring可选query: Id of the team whose templates to list. Omit it to list the templates of your own team; a team you do not belong to answers 403.
nextTokenstring可选query: Cursor to start the list from
limitinteger可选query: Maximum number of items to return per page
200
错误按 E2B 格式返回,参见 错误码
Successfully returned all templates
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].templateID | string | Identifier of the template |
| [].buildID | string | Identifier of the last successful build for given template |
| [].cpuCount | integer | CPU cores for the sandbox |
| [].memoryMB | integer | Memory for the sandbox in MiB |
| [].diskSizeMB | integer | Disk size for the sandbox in MiB |
| [].public | boolean | Whether the template is public or only accessible by the team |
| [].aliases | array<string> | Aliases of the template |
| [].names | array<string> | Names of the template (namespace/alias format when namespaced) |
| [].createdAt | string | Time when the template was created |
| [].updatedAt | string | Time when the template was last updated |
| [].createdBy | object | User who created the template; null for templates created by the platform. |
| [].createdBy.id | string | Identifier of the user |
| [].createdBy.email | string | Email of the user |
| [].lastSpawnedAt | string | Time when the template was last used |
| [].spawnCount | integer | Number of times the template was used |
| [].buildCount | integer | Number of times the template was built |
| [].envdVersion | string | Version of the envd running in the sandbox |
| [].buildStatus | string | Status of the template build |
/sandbox/v1/volumes● 支持namestring必填Volume name, unique within your team. Use one or more ASCII letters, digits, underscores or hyphens.
201
错误按 E2B 格式返回,参见 错误码
Successfully created a new team volume
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| volumeID | string | ID of the volume |
| name | string | Name of the volume |
| token | string | Auth token to use for interacting with volume content |
| domain | string | Domain 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. |
自有入口在响应对象(列表为每行)追加 createdAt:创建时间,ISO 8601 UTC 字符串。
网关自动设置 X-Praxis-Face: own-v1,客户端无需传入;/e2b 兼容入口会剥除该头,保留厂商响应形状。
/sandbox/v1/volumes/{volumeID}● 支持volumeIDstring必填path: Id of the team volume, the `volumeID` returned by createVolume or listVolumes.
200
错误按 E2B 格式返回,参见 错误码
Successfully retrieved a team volume
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| volumeID | string | ID of the volume |
| name | string | Name of the volume |
| token | string | Auth token to use for interacting with volume content |
| domain | string | Domain 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. |
自有入口在响应对象(列表为每行)追加 createdAt:创建时间,ISO 8601 UTC 字符串。
网关自动设置 X-Praxis-Face: own-v1,客户端无需传入;/e2b 兼容入口会剥除该头,保留厂商响应形状。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/fork● 支持sandboxIDstring必填path: 沙箱 ID。
timeoutinteger可选新副本的存活时间,单位为秒。
countinteger可选要创建的独立副本数。所有副本来自同一次快照,每个副本分别返回成功结果或错误。
201
错误按 E2B 格式返回,参见 错误码
The sandbox was snapshotted and the forks were attempted; each entry reports one fork's outcome
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].sandbox | object | Sandbox created from a template. |
| [].sandbox.templateID | string | Identifier of the template from which is the sandbox created |
| [].sandbox.sandboxID | string | Identifier of the sandbox |
| [].sandbox.alias | string | Alias of the template |
| [].sandbox.clientID | string | Identifier of the client |
| [].sandbox.envdVersion | string | Version of the envd running in the sandbox |
| [].sandbox.envdAccessToken | string | Access token used for envd communication |
| [].sandbox.trafficAccessToken | string | Token required for accessing sandbox via proxy. |
| [].sandbox.domain | string | Domain 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. |
| [].error | object | Error body: numeric code, machine-readable error_code and a message. |
| [].error.code | integer | Error code |
| [].error.error_code | string | Machine-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.message | string | Human-readable description of the error. |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/snapshots● 支持sandboxIDstring必填path: 沙箱 ID。
namestring可选可选别名。同一主体重复使用该别名会更新既有快照,保留本平台快照 ID。
201
错误按 E2B 格式返回,参见 错误码
Snapshot created successfully
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| snapshotID | string | Identifier 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). |
| names | array<string> | Full names of the snapshot template including team namespace and tag (e.g. team-slug/my-snapshot:v2) |
自有入口在响应对象(列表为每行)追加 createdAt:创建时间,ISO 8601 UTC 字符串。
快照还包括 sourceSandboxID(string,来源沙箱公开 ID)与 sourceSandboxName(string 或 null)。名称无法取得时返回 null,界面可回退显示 ID。
网关自动设置 X-Praxis-Face: own-v1,客户端无需传入;/e2b 兼容入口会剥除该头,保留厂商响应形状。
向 POST /sandbox/v1/sandboxes/{sandboxID}/snapshots 发送 JSON body {"name":"my-snapshot"} 即可命名;名称会持久保存,并通过 names 返回。
/sandbox/v1/snapshots● 支持sandboxIDstring可选query: 按来源沙箱 ID 筛选。
namestring可选query: 按原始别名或本平台 snap_ 快照 ID 筛选。
limitinteger可选query: 每页返回的快照数量上限。
nextTokenstring可选query: 上一页响应头 X-Next-Token 返回的游标。
200
错误按 E2B 格式返回,参见 错误码
Successfully returned snapshots
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].snapshotID | string | Identifier 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). |
| [].names | array<string> | Full names of the snapshot template including team namespace and tag (e.g. team-slug/my-snapshot:v2) |
自有入口在响应对象(列表为每行)追加 createdAt:创建时间,ISO 8601 UTC 字符串。
快照还包括 sourceSandboxID(string,来源沙箱公开 ID)与 sourceSandboxName(string 或 null)。名称无法取得时返回 null,界面可回退显示 ID。
网关自动设置 X-Praxis-Face: own-v1,客户端无需传入;/e2b 兼容入口会剥除该头,保留厂商响应形状。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/network● 支持sandboxIDstring必填path: 沙箱 ID。
allow_internet_accessboolean可选是否允许访问外网。false 等效于 denyOut 包含 0.0.0.0/0。
allowOutarray可选出站目标白名单,可用 CIDR、IP 或域名;白名单优先于拒绝规则。
denyOutarray可选出站目标黑名单,支持 CIDR 或 IP,不支持域名。
egressProxyobject可选上游代理配置字段,当前平台尚未应用。
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可选上游按域名转换规则字段,当前平台尚未应用。
204
错误按 E2B 格式返回,参见 错误码
Successfully updated the sandbox network configuration
未声明响应体。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/logs● 支持sandboxIDstring必填path: 沙箱 ID。
cursorinteger可选query: 起始时间戳,单位为 Unix 毫秒。
limitinteger可选query: 最多返回的日志条数。
directionstring可选query: forward 按时间向后读取;backward 按时间向前读取。
levelstring可选query: 最低日志级别,低于该级别的日志会被过滤。
searchstring可选query: 按日志正文的子串筛选,区分大小写。
200
错误按 E2B 格式返回,参见 错误码
Successfully returned the sandbox logs
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| logs | array<object> | Sandbox logs structured |
| logs[].timestamp | string | Timestamp of the log entry |
| logs[].message | string | Log message content |
| logs[].level | string | State of the sandbox |
| logs[].fields | object | Structured key/value fields attached to the log line. |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/extend● 支持sandboxIDstring必填path: 沙箱 ID。
timeoutnumber必填从当前时刻起计算的有效秒数:900、1800 或 3600。必须延长现有截止时间。
200
错误按 E2B 格式返回,参见 错误码
Authoritative extended deadline
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| endAt | string | New expiry time of the sandbox, UTC. |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/processes● 支持sandboxIDstring必填path: 沙箱 ID。
statestring可选query: live:运行中;exited:已退出;all:全部保留记录。默认 live。
200
错误按 E2B 格式返回,参见 错误码
Bounded observation with explicit completeness
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| processes | array<object> | Processes of the sandbox: running ones and retained observations of exited ones, newest first. |
| processes[].processId | string | Id of the process: `obs-<n>` for a process whose start was observed, `live-<pid>` for one that was only seen running. |
| processes[].pid | integer | Operating-system process id inside the sandbox. |
| processes[].tag | string | Tag the process was started with; absent when none. |
| processes[].config | object | Command the process was started with. |
| processes[].pty | boolean | Whether the process runs in a pseudo-terminal; present for observed processes. |
| processes[].startedAt | string | Time at which the process start was observed, UTC. |
| processes[].exitedAt | string | Time at which the process exit was observed, UTC; absent until an exit was witnessed. |
| processes[].exitCode | integer | Exit code; present only when the exit was witnessed. |
| processes[].state | string | Current state of the process. |
| processes[].observed | boolean | Whether the platform watched this process start. False for a process that was only seen running. |
| processes[].observationGap | boolean | True when observation was interrupted, so output or the exit may be missing; the state can then be unknown. |
| processes[].outputTruncated | boolean | True when old output chunks were dropped to stay within the retention limits. |
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
/sandbox/v1/sandboxes/{sandboxID}/processes/{processID}/output● 支持sandboxIDstring必填path: 沙箱 ID。
processIDstring必填path: 从进程列表取得的 processId。
200
错误按 E2B 格式返回,参见 错误码
Bounded observation with explicit completeness
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| chunks | array<object> | Retained output chunks of the process, oldest first. |
| chunks[].seq | integer | Sequence number of the chunk; it increases with time and orders chunks. |
| chunks[].stream | string | Which stream the chunk came from. |
| chunks[].data | string | Output bytes of the chunk, base64 encoded. |
| chunks[].timestamp | number | Time at which the chunk was recorded, in Unix milliseconds. |
| complete | boolean | True when the output is whole: the exit was witnessed, no gap occurred and nothing was truncated. |
| gap | boolean | True when observation was interrupted, so chunks or the exit may be missing. |
| truncated | boolean | True when old chunks were dropped to stay within the retention limits. |
| exitCode | integer | null | Exit code of the process; null until an exit was witnessed. |