Time Portal Sandbox API

Run a command

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.

POST/v1/time-portal/sandbox/{id}/execs
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.

Authorizations

x-api-key

x-api-keystringRequired

Send your API key in the x-api-key header. Create keys in the console; each belongs to one organization.

Example

"ek_…"

Headers

Idempotency-Keystring

Unique request identifier; retrying with the same key returns the same command. Reusing a key with a different body returns 409.

Path parameters

idstringRequired

Unique sandbox ID.

Example

"sbx_7f3k9q2m4x8p1c6w"

Body

application/json

argvstring[]Required

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"]
envobject

Environment variables added to the sandbox environment for this command (up to 128 variables and 32 KiB total).

cwdstring | null

Working directory for the command; defaults to the image's HOME. A missing directory exits with code 2.

timeoutstring | null

Terminate the command after this duration (up to 24h, default 1h).

Example

"10m"
stdin_b64string

Initial bytes written to stdin, base64-encoded (up to 1 MiB decoded). Upload larger inputs as a file.

stdin_openboolean

Keep stdin open after stdin_b64 for subsequent input requests; closed immediately if false.

Response

200

idstringRequired

Command ID within the sandbox.

Example

"exec_m3p8x2k7"