Skip to main content

Endpoint

POST /v1/sandboxes/{id}/exec

Parameters

ParameterTypeRequiredDescription
idstringYesSandbox ID returned from create.

Request

{
  "filename": "main.py"
}
FieldTypeRequiredDescription
filenamestringYesFile to execute inside the workspace.

Response

{
  "output": "hello from jhansi.io\n"
}

Example

curl -X POST http://localhost:8000/v1/sandboxes/sb_abc123/exec \
  -H "Content-Type: application/json" \
  -d '{"filename": "main.py"}'
Each exec spins up a fresh container. The workspace survives — the container does not.