cURL
curl --request POST \ --url https://api.gravixlayer.com/v1/agents/sandboxes/{sandbox_id}/code/run \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "code": "<string>", "timeout": 30 } '
{ "logs": { "stdout": "<string>", "stderr": "<string>" }, "error": "<string>", "execution_time_ms": 123 }
Executes code in the sandbox
API key authentication. Get your API key from the Gravix Layer Dashboard.
Sandbox ID
Code to execute
Example: print('Hello, world!')
print('Hello, world!')
Execution timeout in seconds (default: 30s)
Execution result
Show child attributes