Time Portal Sandbox API

Read a command's output

Read stdout and stderr frames from the given byte offsets, along with exit once the command finishes. When wait is set, the request waits until new output arrives or the command exits. Keep polling from the updated offsets until exit is present. Output is retained only while the sandbox is live and returns 409 after it ends.

GET/v1/time-portal/sandbox/{id}/execs/{exec_id}/output
curl https://api.epochal.com/v1/time-portal/sandbox/sbx_7f3k9q2m4x8p1c6w/execs/exec_m3p8x2k7/output \
  -H "x-api-key: $EPOCHAL_API_KEY"

Output frames, and the exit status if finished.

{
  "frames": [
    {
      "stream": "stdout",
      "offset": 0,
      "data_b64": "MjAyNi0wMy0wMQo="
    }
  ],
  "exit": {
    "reason": "exited",
    "code": 0
  }
}

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_…"

Path parameters

idstringRequired

Unique sandbox ID.

Example

"sbx_7f3k9q2m4x8p1c6w"
exec_idstringRequired

Command ID returned when the command was started.

Example

"exec_m3p8x2k7"

Query parameters

stdout_offsetinteger

First stdout byte offset to read (the end of what was already read).

  • Minimum: 0

  • Default: 0

stderr_offsetinteger

First stderr byte offset to read.

  • Minimum: 0

  • Default: 0

waitstring

Maximum duration to hold the request until new output arrives or the command exits (capped at 55s). Returns immediately when unset.

Example

"55s"
max_bytesinteger

Maximum output bytes to return across both streams (up to 4 MiB, which is also the default).

  • Range: 1 to 4194304

Response

200

framesobject[]Required

Output in stream order; empty when wait passed with none.

streamunknownRequired

Stream the bytes came from (stdout or stderr).

offsetintegerRequired

Byte offset of the first byte in this stream.

  • Minimum: 0

data_b64stringRequired

Base64-encoded output bytes.

exitobject | nulloneOf · reason

Set once the command has ended and every frame up to its end is in frames; until then, call again from the end of each stream's last frame.

oneOf (reason)

Command exited with code.

reasonstringRequired
  • Constant: exited

codeintegerRequired

Exit status code.