Time Portal Sandbox API

Create a sandbox

Create and boot a Linux sandbox gated to Accept-Datetime. The sandbox starts in the creating state and becomes live once it is ready to run commands.

POST/v1/time-portal/sandbox
curl https://api.epochal.com/v1/time-portal/sandbox \
  -H "x-api-key: $EPOCHAL_API_KEY" \
  -H "Accept-Datetime: 2026-03-01T00:00:00Z" \
  -H "Content-Type: application/json" \
  -d '{
  "network": "time-portal",
  "vcpus": 1,
  "memory_gib": 2,
  "timeout": "1h"
}'

The accepted sandbox.

{
  "id": "sbx_7f3k9q2m4x8p1c6w",
  "state": "creating",
  "as_of": "2026-03-01T00:00:00Z",
  "network": "time-portal",
  "vcpus": 1,
  "memory_gib": 2,
  "timeout": "1h",
  "idle_timeout": "10m",
  "created_at": "2026-11-02T18:04:11Z",
  "booted_at": null,
  "expires_at": null,
  "ended_at": null,
  "error": null,
  "metadata": {},
  "apps": []
}

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

Accept-DatetimestringRequired

Point-in-time cutoff for the request: a past RFC 3339 timestamp, ISO 8601 date/time, or HTTP-date at or after 2023-04-01T00:00:00Z. Nothing published or captured after this time is included.

Example

"2026-03-01T00:00:00Z"
Idempotency-Keystring

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

Body

application/json

networkstring

Network access mode: time-portal enables archived web access and time-gated package mirrors, and none disables outbound network access.

  • One of: none (No outbound network access. DNS does not resolve and all outbound connections are blocked); time-portal (Archived web access as of the sandbox's as_of via Time Portal, plus time-gated package mirrors. Each web page fetched counts as one Time Portal fetch request)

  • Default: "none"

vcpusinteger

Virtual CPUs reserved for the sandbox: 1, 2, 4, 8, or 16.

  • Minimum: 1

  • Default: 1

Example

1
memory_gibinteger

Memory reserved for the sandbox, in GiB: 1, 2, 4, 8, 16, 32, or 64 (at most 8 GiB per vCPU).

  • Minimum: 1

  • Default: 2

Example

2
timeoutstring

Maximum sandbox lifetime after boot, from 1m to 24h. Cannot be extended.

  • Default: "1h"

Example

"1h"
idle_timeoutstring | null

Ends the sandbox after this duration with no running command and no exec, input, file write, or file delete request (reads and polls do not reset the timer). From 1m to timeout; defaults to 10m or timeout, whichever is shorter.

Example

"10m"
envobject

Environment variables available to every command run in the sandbox (at most 128 variables and 32 KiB total).

metadataobject

Custom key-value labels attached to the sandbox (at most 16 pairs).

appsstring[]

Prebuilt apps mounted read-only at /opt/epochal/bin, by name (at most 8). Each app is a current build rather than one from as_of, so a sandbox that uses apps is not strictly gated to its timestamp.

Response

202

idstringRequired

Unique sandbox ID.

Example

"sbx_7f3k9q2m4x8p1c6w"
statestringRequired

Current lifecycle state of the sandbox.

  • One of: creating (Accepted and booting); live (Booted and accepting requests); ended (Terminated, timed out, or idle-expired; files and command output have been deleted); failed (Failed to boot; see error for the reason)

as_ofstring (date-time)Required

Point-in-time cutoff for the sandbox's clock and network, resolved from Accept-Datetime.

networkstringRequired

Network access mode.

  • One of: none (No outbound network access. DNS does not resolve and all outbound connections are blocked); time-portal (Archived web access as of the sandbox's as_of via Time Portal, plus time-gated package mirrors. Each web page fetched counts as one Time Portal fetch request)

vcpusintegerRequired

Reserved virtual CPUs.

  • Minimum: 0

memory_gibintegerRequired

Reserved memory in GiB.

  • Minimum: 0

timeoutstringRequired

Maximum lifetime from boot.

Example

"1h"
idle_timeoutstringRequired

Maximum idle duration before automatic termination.

Example

"10m"
created_atstring (date-time)Required

Timestamp when sandbox creation was accepted.

booted_atstring (date-time) | null

Timestamp when the sandbox finished booting; metering starts here.

  • Default: null

expires_atstring (date-time) | null

Latest timestamp when the sandbox will end (booted_at + timeout).

  • Default: null

ended_atstring (date-time) | null

Timestamp when the sandbox ended.

  • Default: null

errorobject | null

Reason the sandbox failed or ended unexpectedly: lifetime_expired, idle_expired, out_of_memory, sandbox_lost, free_quota_exhausted, insufficient_credits, organization_suspended, or spend_limit_reached. null after normal termination.

  • Default: null

typeunknownRequired

A stable machine-readable code.

messagestringRequired

What went wrong, in one sentence.

request_idstring | null

Identifies this request in our logs; quote it when reporting a problem.

next_seqinteger (uint64) | null

On an input seq out of order: the seq the command expects next.

  • Minimum: 0

metadataobject

Custom labels provided at creation.

  • Default: {}

appsobject[]

Prebuilt apps mounted in the sandbox.

  • Default: []

namestringRequired

App name.

versionstringRequired

App version mounted in the sandbox.