Control plane vs. data plane
The two credentials are not interchangeable: the control plane rejects
X-Access-Token, and the
data plane rejects Authorization: Bearer. A data-plane token is bound to its sandbox — using
sandbox A’s token against sandbox B’s host fails.
Where the data-plane values come from
Every successful create (POST /sandboxes) or connect (POST /sandboxes/{id}/connect) response
returns three fields:
sandbox_key— the per-sandbox host label;domain— the host suffix. Combine them ashttps://{sandbox_key}.{domain}; never assemble or derive the domain yourself;sandbox_access_token— the data-plane credential, valid for the sandbox’s entire lifetime.
Typical flow
POST /sandboxeswith atemplate_id(send anIdempotency-Keyheader to make retries safe);- wait for the sandbox to reach
running(GET /sandboxes/{id}); - run commands and transfer files against the sandbox’s own host using
X-Access-Token; - extend the lifetime with
POST /sandboxes/{id}/timeoutas needed; DELETE /sandboxes/{id}when done — sandboxes also expire automatically atend_at.