沙箱

创建快照

保存沙箱状态,返回本平台的快照 ID 与原始别名。

先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。

POST /sandbox/v1/sandboxes/{sandboxID}/snapshots● 支持

E2B 官方文档 ↗

请求参数

  • sandboxIDstring必填

    path: 沙箱 ID。

  • namestring可选

    可选别名。同一主体重复使用该别名会更新既有快照,保留本平台快照 ID。

返回

201

错误按 E2B 格式返回,参见 错误码

响应

HTTP 201

Snapshot created successfully

application/json

名称类型说明
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)

自有入口在响应对象(列表为每行)追加 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 返回。