curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/sandbox/run' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"code": "string",
"env": {},
"language": "en-US",
"timeout_seconds": 250
}'
Execute code inline — creates a sandbox, runs the code, returns output.
This is the simplest way to run untrusted code. The sandbox is ephemeral and destroyed after execution. Required scope: sandbox:execute
POST
/
api
/
v1
/
sandbox
/
run
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/sandbox/run' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"code": "string",
"env": {},
"language": "en-US",
"timeout_seconds": 250
}'
This is the simplest way to run untrusted code. The sandbox is ephemeral
and destroyed after execution.
Required scope:
sandbox:execute
Request body
RunCodeRequest
string
required
Source code to execute.
object
Environment variables.
string
required
Programming language (‘python’, ‘node’, ‘bash’, ‘rust’).
integer (int32)
Execution timeout in seconds (default: 30).
Response
No response body. Code executed.Status codes
| Code | Meaning |
|---|---|
200 | Code executed |
401 | Unauthorized — missing or invalid credentials |
403 | Forbidden — the key/token lacks the required scope |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
503 | Sandbox infrastructure unavailable |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/sandbox/run' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"code": "string",
"env": {},
"language": "en-US",
"timeout_seconds": 250
}'
Last modified on August 31, 2026