from openapi import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.sandbox.terminate(session_id_param="demo-python-20260316", session_id="demo-python-20260316", session_token="sandbox_test_20260316_4f9c2b1a")
# Handle response
print(res){
"session": {
"session_id": "demo-python-20260316",
"user_id": "demo-user",
"status": "terminated",
"session_kind": "standard",
"ttl_seconds": 600,
"workspace_expires_at": "2026-03-23T20:40:00Z",
"sandbox_features": [],
"api_key_id": null,
"permissions": [],
"runner_id": "runner-usw2a-01",
"runner_url": "http://runner:8010",
"runner_zone": "us-west-2a",
"created_at": "2026-03-16T20:40:00Z",
"updated_at": "2026-03-16T20:45:30Z"
}
}Detener una sesión de sandbox y liberar los recursos de sandbox de respaldo.
from openapi import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.sandbox.terminate(session_id_param="demo-python-20260316", session_id="demo-python-20260316", session_token="sandbox_test_20260316_4f9c2b1a")
# Handle response
print(res){
"session": {
"session_id": "demo-python-20260316",
"user_id": "demo-user",
"status": "terminated",
"session_kind": "standard",
"ttl_seconds": 600,
"workspace_expires_at": "2026-03-23T20:40:00Z",
"sandbox_features": [],
"api_key_id": null,
"permissions": [],
"runner_id": "runner-usw2a-01",
"runner_url": "http://runner:8010",
"runner_zone": "us-west-2a",
"created_at": "2026-03-16T20:40:00Z",
"updated_at": "2026-03-16T20:45:30Z"
}
}Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Respuesta exitosa
Show child attributes
¿Esta página le ayudó?