Skip to content
中文

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

  • sandboxIDstringrequired

    path:

  • timeoutintegerrequired

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

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/e2b/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.
from e2b import Sandbox

opts = dict(
    api_key="$PRAXIS_API_KEY",
    api_url="https://api.deepraxis.com/e2b",
    domain="sandbox.praxisusercontent.com",
)

Sandbox.set_timeout("sbx_123", 300, **opts)
TypeScript
// Call Create sandbox first and replace sbx_123 with its returned sandboxID.
import { Sandbox } from "e2b";

const opts = {
  apiKey: "$PRAXIS_API_KEY",
  apiUrl: "https://api.deepraxis.com/e2b",
  domain: "sandbox.praxisusercontent.com",
};

await Sandbox.setTimeout("sbx_123", 300_000, opts);

Response 204

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

Response

HTTP 204

Successfully set the sandbox timeout

No response body is declared.