Skip to content
中文

Set sandbox timeout

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

POST/sandbox/v1/sandboxes/{sandboxID}/timeout● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstringrequired

    path: Sandbox ID.

  • timeoutintegerrequired

    New lifetime in seconds from now, replacing the current expiry rather than adding to it. May shorten the remaining lifetime.

Returns

204

Errors follow the E2B format — see error codes

Request

curl
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
curl https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/timeout \
  -H "X-API-Key: $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"timeout":300}'
Python
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
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/timeout",
    headers={"X-API-Key": api_key},
    json={"timeout": 300},
)
print(resp.status_code, resp.text)
TypeScript
// Call Create sandbox first and replace sbx_123 with its returned sandboxID.
const apiKey = "$PRAXIS_API_KEY";

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

Response 204

(204 No Content:成功,无响应体)

Response

HTTP 204

Successfully set the sandbox timeout

No response body is declared.