kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

HTTP API / Code interpreter

Code interpreter

5 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.

Run a Python cell in a stateful context: globals persist between calls, charts come back as images#

POST/v1/sandboxes/{id}/codescope sandboxes:write

Needs a persistent sandbox (409 not_persistent otherwise) whose image has python3 (409 no_python). Runs through exec: a sleeping sandbox is woken first, with the same payment checks.

Parameters
idrequiredpath · string
Sandbox id (sbx_…)
JSON body
coderequiredstring
Max length 40960.
language"python"
—
contextstring
Default "default"; started on first use
timeout_snumber
Default 30. Past it the cell is interrupted (TimeoutError) and the context lives on Min 0. Max 80.
Responses
200400401403404409502504
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/code \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

The sandbox's running code contexts#

GET/v1/sandboxes/{id}/code/contextsscope sandboxes:write

Needs a persistent sandbox (409 not_persistent otherwise) whose image has python3 (409 no_python). Runs through exec: a sleeping sandbox is woken first, with the same payment checks.

Parameters
idrequiredpath · string
Sandbox id (sbx_…)
Responses
200401403404409
curl -s -X GET https://api.kosa8.com/v1/sandboxes/$SBX/code/contexts \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Start a context (its own globals)#

POST/v1/sandboxes/{id}/code/contextsscope sandboxes:write

Needs a persistent sandbox (409 not_persistent otherwise) whose image has python3 (409 no_python). Runs through exec: a sleeping sandbox is woken first, with the same payment checks.

Parameters
idrequiredpath · string
Sandbox id (sbx_…)
JSON body
namestring
—
Responses
201400401403404409
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/code/contexts \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Forget a context's globals#

POST/v1/sandboxes/{id}/code/contexts/{name}/resetscope sandboxes:write
Parameters
idrequiredpath · string
Sandbox id (sbx_…)
namerequiredpath · string
Context name: 1-32 of a-z, 0-9 and -
Responses
200401403404409
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/code/contexts/$NAME/reset \
  -H "Authorization: Bearer $KOSA8_API_KEY"

End a context's process#

DELETE/v1/sandboxes/{id}/code/contexts/{name}scope sandboxes:write
Parameters
idrequiredpath · string
Sandbox id (sbx_…)
namerequiredpath · string
Context name: 1-32 of a-z, 0-9 and -
Responses
200401403404409
curl -s -X DELETE https://api.kosa8.com/v1/sandboxes/$SBX/code/contexts/$NAME \
  -H "Authorization: Bearer $KOSA8_API_KEY"

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · AI Agent Sandbox: Secure and Sovereign for Enterprise · Local models served by llamay · Agent gateway: MAQPNA