Skip to main content
Use the Box Public API from services, CI jobs, hosted workers, and product automation code. For typed clients, start with the Box SDKs, Python SDK, or TypeScript/JavaScript SDK.
  1. Create a Box API key with box api-key create or in the dashboard.
  2. Create a box with POST /boxes, or resume/fork an existing box when the user is continuing prior work.
  3. Poll GET /boxes/{boxId} until the box is ready or idle.
  4. Queue work with POST /boxes/{boxId}/prompt.
  5. Read GET /boxes/{boxId}/events while work is running.
  6. Use POST /boxes/{boxId}/desktop when the user or your support team needs live computer-use visibility.
  7. Stop/archive, resume, fork, or delete the box according to your retention policy.
Everything the Box CLI does programmatically is available here: first-class endpoints cover lifecycle, prompts, events, files, desktop, and snapshots. Anything else, including in-box tools like host and lux, package installs, or your own scripts, is driven through POST /boxes/{boxId}/commands. For high-frequency or streaming control, run your own daemon in the box; see the daemon pattern.

Base URL

Authentication

Pass a Box API key as a bearer token on every request:
Create, rotate, and revoke service keys with the box api-key CLI command or in the Box dashboard. For key lifecycle guidance, see API Keys.
Treat Box API keys and returned desktop URLs as secrets. Desktop and VNC URLs can contain access tokens and should not be logged or persisted unredacted.

Response envelope

Every v1 JSON response has an explicit success discriminator:

Error model

HTTP status remains authoritative. Error bodies also use a structured JSON envelope:

Box lifecycle

A Box moves through these states:
idle and running only reflect work queued through POST /boxes/{boxId}/prompt. Processes you run yourself, over SSH or the command endpoint, do not change the state: a box can show idle while your own agent works inside it.

Providers, models, and reasoning

POST /boxes/{boxId}/prompt accepts the same providers Box uses in the dashboard. The API accepts codex and claude-code; claude is accepted as an alias for claude-code by the current backend, but claude-code is the canonical value to store in integrations. Model ids come from the same catalog used by the dashboard model selector. If you omit model, Box uses the user’s saved dashboard default for that provider. Prefer the listed model ids for predictable behavior. Use the dashboard’s provider setup page to configure credentials before prompting. If credentials are missing, the API returns provider_not_configured with a setup URL.

Request examples

Set shared variables:
Create a one-hour box and store its id:
Create a box without automatic archival:
Poll readiness:
Prompt a Box to work in a repo:
Read Box work and lifecycle events:
Get a desktop streaming URL for live inspection:
To return a VNC URL that does not require an access token, send:
Stop/archive a box when the workflow is complete:

Endpoint reference