跳转到内容
EN

延长沙箱

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

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

请求参数

  • sandboxIDstring必填

    path: 沙箱 ID。

  • timeoutnumber必填

    从当前时刻起计算的有效秒数:900、1800 或 3600。必须延长现有截止时间。

返回

200

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

请求示例

curl
# 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
curl https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/extend \
  -H "X-API-Key: $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"timeout":900}'
Python
# 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
import requests

api_key = "$PRAXIS_API_KEY"

# Call /sandbox/v1 directly over HTTP.
resp = requests.post(
    "https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/extend",
    headers={"X-API-Key": api_key},
    json={"timeout": 900},
)
print(resp.status_code, resp.text)
TypeScript
// 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
const apiKey = "$PRAXIS_API_KEY";

// Call /sandbox/v1 directly over HTTP.
const resp = await fetch(`https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/extend`, {
  method: "POST",
  headers: { "X-API-Key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({ timeout: 900 }),
});
console.log(resp.status, await resp.text());

响应示例 200

{
  "endAt": "2026-10-23T01:52:43.591Z"
}

响应

HTTP 200

Authoritative extended deadline

application/json

名称 类型 说明
endAt string New expiry time of the sandbox, UTC.