Time Portal Sandbox API
Start a command asynchronously in a live sandbox. Returns the command id immediately, and you can read output and exit status from the output endpoint. Commands run as root in the image's HOME. Multiple commands can run concurrently, and an active command resets idle_timeout. Send an Idempotency-Key header to make retries safe.
curl https://api.epochal.com/v1/time-portal/sandbox/sbx_7f3k9q2m4x8p1c6w/execs \
-H "x-api-key: $EPOCHAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"argv": [
"python3",
"-c",
"import datetime; print(datetime.date.today())"
]
}'The started command.
{
"id": "exec_m3p8x2k7"
}Read the Time Portal Sandbox API guide
A sandbox is a Linux virtual machine whose clock and network are set to an instant.
x-api-key
Send your API key in the x-api-key header. Create keys in the console; each belongs to one organization.
Example
"ek_…"Unique request identifier; retrying with the same key returns the same command. Reusing a key with a different body returns 409.
Unique sandbox ID.
Example
"sbx_7f3k9q2m4x8p1c6w"application/json
Program and arguments (executed directly without a shell, using PATH; up to 1,024 entries
and 128 KiB total). A missing program exits with code 127 rather than returning an HTTP error.
Example
["python3","analyze.py"]Environment variables added to the sandbox environment for this command (up to 128 variables and 32 KiB total).
Working directory for the command; defaults to the image's HOME. A missing directory exits with code 2.
Terminate the command after this duration (up to 24h, default 1h).
Example
"10m"Initial bytes written to stdin, base64-encoded (up to 1 MiB decoded). Upload larger inputs as a file.
Keep stdin open after stdin_b64 for subsequent input requests; closed immediately if false.
200
Command ID within the sandbox.
Example
"exec_m3p8x2k7"curl https://api.epochal.com/v1/time-portal/sandbox/sbx_7f3k9q2m4x8p1c6w/execs \
-H "x-api-key: $EPOCHAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"argv": [
"python3",
"-c",
"import datetime; print(datetime.date.today())"
]
}'The started command.
{
"id": "exec_m3p8x2k7"
}