# Annex > One API for every sandbox your agents use. Annex starts a sandbox on whichever connected provider account fits (cheapest, fastest, a region or a provider you name), fails over when one is full, saves a task's work with checkpoints and resumes it on any provider. Your own provider accounts bill you directly. Use Annex through MCP (no code) or the HTTP API. Both take an Annex API key, `Authorization: Bearer anx_live_…`, made by a person in the dashboard. A key belongs to one workspace: HTTP routes take that workspace's id (`wsp_…`) as `{wid}`, and MCP tools take none. Money is whole micro-dollars (`_micros`, millionths of a US dollar) and times are RFC 3339 in UTC. Starting a sandbox spends money on the user's provider account: send an `Idempotency-Key` header and retry with the same one. ## Docs - [Quickstart](https://annex.eversonder.com/docs/quickstart) - [Overview](https://annex.eversonder.com/docs/overview) - [Connect your agent](https://annex.eversonder.com/docs/connect-your-agent) - [Connect your providers](https://annex.eversonder.com/docs/connect-providers) - [The annex command](https://annex.eversonder.com/docs/cli) - [Templates](https://annex.eversonder.com/docs/templates) - [Annex credit and billing](https://annex.eversonder.com/docs/credit) - [Routing](https://annex.eversonder.com/docs/routing) - [Secrets](https://annex.eversonder.com/docs/secrets) - [Pause and resume](https://annex.eversonder.com/docs/pause-resume) - [Checkpoints and carrying on](https://annex.eversonder.com/docs/checkpoints) - [Fleets: queues and storage](https://annex.eversonder.com/docs/fleets) - [Webhooks](https://annex.eversonder.com/docs/webhooks) - [Your own servers](https://annex.eversonder.com/docs/your-own-servers) - [Logs and limits](https://annex.eversonder.com/docs/logs-and-limits) - [MCP tools](https://annex.eversonder.com/docs/mcp-tools): every tool with its input schema - [OpenAPI spec](https://annex.eversonder.com/v1/openapi.json): the HTTP contract (also as [YAML](https://annex.eversonder.com/v1/openapi.yaml)) ## MCP Streamable HTTP at `https://annex.eversonder.com/mcp`, with the API key as a bearer token. For Claude Code: ``` claude mcp add --transport http annex https://annex.eversonder.com/mcp --header "Authorization: Bearer anx_live_…" ``` - `sandbox_cache` (Cache dependencies): The workspace's dependency cache: a sandbox's dependency folders (node_modules, .venv) kept by lockfile. - `sandbox_checkpoint` (Save and manage checkpoints): Saves a running sandbox's work so it can carry on in another sandbox, on any provider: its files, a recipe for its environment, and a note in the task's journal. - `sandbox_command_output` (Read a command's output): Reads a command's output (stdout and stderr together), up to 16 KB a call, from where the last call left off, with the command's current status and exit_code. - `sandbox_command_stop` (Stop a running command): Stops a command sandbox_run started that is still running, and everything it started, as Ctrl+C would: SIGINT, then SIGTERM 2 s later, then SIGKILL 2 s after that. - `sandbox_create` (Start a sandbox): Starts a new sandbox (a Linux computer) on one of the user's connected provider accounts and waits until it is running. - `sandbox_files` (Work with files): Lists, reads, writes or deletes files in a running sandbox; path is always absolute, such as /home/user/app/main.py. - `sandbox_list` (List sandboxes): Lists the workspace's sandboxes, newest first, 25 to a page; by default only the running ones, which are the ones costing money right now. - `sandbox_pause` (Pause a sandbox): Pauses the SAME sandbox on its original provider account, preserving its files; every sandbox supports this. - `sandbox_resume` (Resume from a checkpoint): Starts a NEW sandbox and restores a stored checkpoint into it, so the task carries on where it stopped. - `sandbox_run` (Run a command): Runs a shell command in a running sandbox and waits up to wait_seconds (30 by default, at most 60) for it to finish. - `sandbox_stop` (Stop a sandbox): Stops a sandbox, which stops billing for it right away. - `sandbox_template` (Save and use templates): A template is what new sandboxes start as: a size, a route and set-up commands (installing what the work needs) that Annex runs in each new sandbox before handing it over, on any provider. - `sandbox_unpause` (Resume the same sandbox): Resumes the SAME sandbox_id and original provider account with its retained files. - `sandbox_update` (Change a sandbox's settings): Changes a running or paused sandbox's safety settings: auto_checkpoint_minutes (0 is off, or 5 to 60), auto_resume (carry on in a new sandbox from the newest checkpoint if its provider ends it), lifetime_minutes (billable minutes; suspended pauses are excluded while frozen and access-hold pauses count, 1 to 10080) and idle_minutes (0 is off, up to 1440). - `task_journal` (Read and write a task's journal): A task's record: 'list' is a page of the workspace's tasks, newest activity first (sandboxes, active ones, providers, cost so far); 'get' returns the task (task_id) with its newest sandboxes and checkpoints, the secret groups its new sandboxes get, and a page of its journal (commands run, notes, checkpoints, resumes), newest first. - `task_kv` (Share small results): A small key-value store shared by every sandbox of one task: results, progress and settings that the task's sandboxes and you read and write. - `task_memory` (Remember and recall): Long-term memory for this workspace's agents, kept in the user's own Supermemory account: 'remember' keeps text (such as a decision or what you learned) and returns its id, 'search' finds the closest memories, each with a score from 0 to 1, and 'forget' deletes one by id in the scope it was kept in, and only one this key remembered itself (another's is not found; only a signed-in person can delete any). - `task_plan` (Plan a batch of jobs): Works out how many sandboxes a batch of jobs needs, on which providers, regions and sizes, how long it will take and what it will cost, from the providers' prices and Annex's measured start-up times; 'plan' only calculates and costs nothing. - `task_queue` (Share work through a queue): A queue of jobs shared by every sandbox of one task, for fanning work out: create sandboxes with the same task (sandbox_create task=…, or task_plan), push one message per job here, and have each sandbox claim jobs, do them, write results with task_kv, and ack. - `task_run` (See and report what each run did): A task's runs: one execution of work, start to end. - `task_run_subscription` (Send run events to your URL): Send a task's run events to a URL of yours as they happen: run.started, run.succeeded, run.failed, run.stuck, run.cancelled, run.delivered. - `task_webhook` (Receive calls from other services): Inbound webhooks for a task: a secret URL (such as for GitHub, Stripe or Slack to call) whose every request reaches the task's sandboxes. - `workspace_info` (Read the workspace): Read-only facts about the workspace, to choose routes, regions and sizes: 'regions' (each region and the connected providers that serve it), 'usage' (sandbox-hours and spend over days 7, 30 or 90), 'connections' (the provider accounts the user connected, with any limits they set; never keys), 'accounts' (per account: how many sandboxes and vCPUs run against its limits, the limits plans use and where they came from, this month's spend as Annex's estimate and as the provider billed it where the user allowed it, and the provider's status; connection_id for one, and for the user's own servers their specs, live readings (metrics: true) and log (logs: true: what the Annex helper there did and saw, and its sandboxes starting, ending and running out of memory)), 'connectors' (every provider Annex can connect, and how), 'secret_groups' (the names of the secret groups this API key may add to sandboxes; never values), 'measurements' (measured start-up times and how often each provider was unavailable, per region and size), 'limits' (concurrent sandboxes for the workspace and this API key, current use and monthly estimated spend, per-sandbox CPU/memory ceilings, operating hours, and the workspace's routing rules: allow or deny lists of regions and providers, each with the owner's note, which every start obeys, Annex credit included; allowed_regions, allowed_providers and denied_providers are what they allow together; only the user changes them, in Settings › Limits and Settings › Rules). ## HTTP API for API keys Base `https://annex.eversonder.com`. These are the routes an API key may call. - `GET /v1/connectors`: Every provider and how to connect it (bounded reference data, not paged); people and API keys - `GET /v1/key`: Which workspace an API key is for - `GET /v1/workspaces/{wid}/accounts`: One page of the workspace's accounts (connections), each with its limits, use, spend, status and opt-ins - `GET /v1/workspaces/{wid}/accounts/{id}`: One account (a connection id, con_…); another workspace's is 404 - `GET /v1/workspaces/{wid}/accounts/{id}/logs`: Your own server's log, newest first (what the Annex helper there did and saw, and its sandboxes' containers starting, ending and running out of memory) - `GET /v1/workspaces/{wid}/accounts/{id}/logs/stream`: Your own server's log as it happens, as Server-Sent Events (live tail) - `GET /v1/workspaces/{wid}/accounts/{id}/metrics`: Your own server's readings over time (CPU, memory, disk, network, sandboxes against its limit) - `GET /v1/workspaces/{wid}/cache`: One page of the workspace's dependency cache, most recently used first - `DELETE /v1/workspaces/{wid}/cache/{key}`: Drop one cache entry now; the next save makes it again - `GET /v1/workspaces/{wid}/cache/jobs/{cid}` - `GET /v1/workspaces/{wid}/cache/jobs/{cid}/events`: A cache job's progress as Server-Sent Events, like a checkpoint's; ends with "done" or "failed" and the CacheJob - `DELETE /v1/workspaces/{wid}/checkpoints/{ckp}`: Delete a stored or failed checkpoint - `GET /v1/workspaces/{wid}/checkpoints/{ckp}/files`: One page of what is in a folder of a stored checkpoint, by name, read from Annex's own copy - `GET /v1/workspaces/{wid}/checkpoints/{ckp}/files/content`: Download one file of a stored checkpoint, as it was saved, read from Annex's own copy - `POST /v1/workspaces/{wid}/checkpoints/{ckp}/resume`: Start a stored checkpoint on a new sandbox, on any provider - `GET /v1/workspaces/{wid}/connections`: One page of the workspace's connected provider accounts, newest first. - `POST /v1/workspaces/{wid}/connections/{id}/check`: Ask the provider whether a connection's key still works - `GET /v1/workspaces/{wid}/credits`: The workspace's Annex credit, for sandboxes on Annex's own provider accounts - `GET /v1/workspaces/{wid}/limits`: The workspace's limits and how near it is to them (members and API keys; a key also gets its own) - `GET /v1/workspaces/{wid}/mcp`: Where an agent connects to Annex's tools over MCP (Streamable HTTP, with an API key as the bearer token) - `GET /v1/workspaces/{wid}/measurements`: Measured start-ups, per provider account, region and size, over the last 7 days - `POST /v1/workspaces/{wid}/memory`: Remember text in the workspace's own Supermemory account (Memory, beta) - `DELETE /v1/workspaces/{wid}/memory/{id}`: Forget a memory, by the id POST …/memory returned, in its scope only - `GET /v1/workspaces/{wid}/memory/search`: The closest memories of one scope, best first - `GET /v1/workspaces/{wid}/memory/settings`: The workspace's memory settings (members and API keys) - `GET /v1/workspaces/{wid}/regions`: Where sandboxes can run, and which of the workspace's providers serve each place (bounded reference data, not paged) - `GET /v1/workspaces/{wid}/resumes/{rsm}` - `GET /v1/workspaces/{wid}/resumes/{rsm}/events`: A resume's progress as Server-Sent Events - `GET /v1/workspaces/{wid}/rules`: One page of the workspace's routing rules, oldest first (members and API keys) - `GET /v1/workspaces/{wid}/sandboxes`: One page of the workspace's sandboxes, newest first - `POST /v1/workspaces/{wid}/sandboxes`: Start a sandbox on the best connected provider for the route - `GET /v1/workspaces/{wid}/sandboxes/{id}`: A running sandbox is read at its provider first when its last read is over 10 s old (2 s at most); when the provider says it ended, Annex reads it again 2 s later before answering, so this can take about 6 s (a little more when it starts carrying the sandbox on). - `PATCH /v1/workspaces/{wid}/sandboxes/{id}`: Change a running or paused sandbox's automatic checkpoints, carrying on if lost, lifetime and idle limit - `POST /v1/workspaces/{wid}/sandboxes/{id}/cache/restore`: Put cached dependency folders back into a running sandbox - `POST /v1/workspaces/{wid}/sandboxes/{id}/cache/save`: Save a running sandbox's dependency folders to the workspace's cache - `GET /v1/workspaces/{wid}/sandboxes/{id}/checkpoints`: One page of the sandbox's checkpoints, newest first - `POST /v1/workspaces/{wid}/sandboxes/{id}/checkpoints`: Checkpoint a running sandbox, so its task can resume on any provider - `GET /v1/workspaces/{wid}/sandboxes/{id}/checkpoints/{ckp}` - `GET /v1/workspaces/{wid}/sandboxes/{id}/checkpoints/{ckp}/events`: A checkpoint's progress as Server-Sent Events - `POST /v1/workspaces/{wid}/sandboxes/{id}/commands`: Run a shell command in a running sandbox - `GET /v1/workspaces/{wid}/sandboxes/{id}/commands/{cid}`: Where a command is now, asked of the provider. - `POST /v1/workspaces/{wid}/sandboxes/{id}/commands/{cid}/cancel`: Stop a running command, as Ctrl+C would - `GET /v1/workspaces/{wid}/sandboxes/{id}/commands/{cid}/output`: One page of a command's output, by cursor - `GET /v1/workspaces/{wid}/sandboxes/{id}/commands/{cid}/stream`: A command's output as Server-Sent Events, live - `DELETE /v1/workspaces/{wid}/sandboxes/{id}/files`: Delete a file or directory (send Content-Type application/json, as for every non-GET request) - `GET /v1/workspaces/{wid}/sandboxes/{id}/files`: One page of what is in a directory of a running sandbox, by name - `GET /v1/workspaces/{wid}/sandboxes/{id}/files/content`: Download a file, as raw bytes (or preview it, scrubbed) - `PUT /v1/workspaces/{wid}/sandboxes/{id}/files/content`: Upload a file, as raw bytes (100 MiB at most), replacing what is there - `POST /v1/workspaces/{wid}/sandboxes/{id}/journal`: Add a note to the journal of the sandbox's task - `GET /v1/workspaces/{wid}/sandboxes/{id}/logs`: A sandbox's log, on any provider (its journal, its commands' output and, on your own server, its container's) - `GET /v1/workspaces/{wid}/sandboxes/{id}/logs/stream`: A sandbox's log as it happens, on any provider, as Server-Sent Events - `GET /v1/workspaces/{wid}/sandboxes/{id}/metrics`: A sandbox's CPU, memory and disk over time, from Annex's own probe and the provider's own numbers - `POST /v1/workspaces/{wid}/sandboxes/{id}/pause`: Pause the same sandbox and preserve its files - `POST /v1/workspaces/{wid}/sandboxes/{id}/resume`: Resume the same sandbox on its original provider account - `POST /v1/workspaces/{wid}/sandboxes/{id}/stop`: A lost sandbox answers 409 sandbox_lost; Annex never stops or deletes one at its provider. - `GET /v1/workspaces/{wid}/sandboxes/{id}/template`: A template drafted from a sandbox - `GET /v1/workspaces/{wid}/sandboxes/{id}/terminal`: A terminal in a running sandbox, over a WebSocket - `GET /v1/workspaces/{wid}/sandboxes/{id}/tunnel`: A TCP connection to a port inside a running sandbox, over a WebSocket - `POST /v1/workspaces/{wid}/sandboxes/route`: A dry run of create: the accounts Annex would try for this body, in order, with price, start-up and why; the ones left out with every check they failed; and the smallest changes that would make more eligible. - `GET /v1/workspaces/{wid}/secrets`: One page of the workspace's secret groups, by name. - `GET /v1/workspaces/{wid}/secrets/{gid}/env`: A group as a .env file, for local development - `GET /v1/workspaces/{wid}/tasks`: The workspace's tasks, the one with the newest activity first, each summed from its sandboxes - `GET /v1/workspaces/{wid}/tasks/{tid}`: A task, with its sandboxes, checkpoints and one page of its journal - `GET /v1/workspaces/{wid}/tasks/{tid}/checkpoints`: One page of a task's checkpoints, from all its sandboxes, newest first - `POST /v1/workspaces/{wid}/tasks/{tid}/heartbeat`: The calling sandbox is alive (task tokens only; an API key gets 403) - `GET /v1/workspaces/{wid}/tasks/{tid}/kv`: One page of the task's keys starting with prefix, in key order, with their values - `DELETE /v1/workspaces/{wid}/tasks/{tid}/kv/{key}` - `GET /v1/workspaces/{wid}/tasks/{tid}/kv/{key}`: One key, with an ETag of its version - `PUT /v1/workspaces/{wid}/tasks/{tid}/kv/{key}`: Write a key; with If-Match, only if it is still at that version - `GET /v1/workspaces/{wid}/tasks/{tid}/plans`: One page of the task's plans, newest first - `POST /v1/workspaces/{wid}/tasks/{tid}/plans`: Plan how many sandboxes a batch of jobs needs, where, and at what cost and time - `GET /v1/workspaces/{wid}/tasks/{tid}/plans/{pid}`: A plan, with its apply progress once applied - `POST /v1/workspaces/{wid}/tasks/{tid}/plans/{pid}/apply`: Start the plan's sandboxes in its task (costs money) - `GET /v1/workspaces/{wid}/tasks/{tid}/plans/{pid}/events`: An applied plan's progress as Server-Sent Events - `GET /v1/workspaces/{wid}/tasks/{tid}/queues`: One page of the task's queues, by name, with their counts - `POST /v1/workspaces/{wid}/tasks/{tid}/queues/{name}/claim`: Claim up to max messages, hidden from other claims for visibility_seconds - `GET /v1/workspaces/{wid}/tasks/{tid}/queues/{name}/dead`: One page of a queue's dead messages, oldest first (the newest 10,000 are kept) - `POST /v1/workspaces/{wid}/tasks/{tid}/queues/{name}/messages`: Push a message onto one of the task's queues - `POST /v1/workspaces/{wid}/tasks/{tid}/queues/{name}/messages/{mid}/ack`: Done with a claimed message; it is gone for good (send Content-Type application/json, no body) - `POST /v1/workspaces/{wid}/tasks/{tid}/queues/{name}/messages/{mid}/release`: Give a claimed message back now, for another claim - `GET /v1/workspaces/{wid}/tasks/{tid}/run-subscriptions`: The URLs the task's run events go to, with each one's last try - `POST /v1/workspaces/{wid}/tasks/{tid}/run-subscriptions`: Send the task's run events to a URL - `DELETE /v1/workspaces/{wid}/tasks/{tid}/run-subscriptions/{sid}`: Stop sending run events to a URL - `GET /v1/workspaces/{wid}/tasks/{tid}/runs`: The task's runs, newest first - `POST /v1/workspaces/{wid}/tasks/{tid}/runs`: Start a run of the agent's own - `GET /v1/workspaces/{wid}/tasks/{tid}/runs/{rid}`: One run with its events and cost - `POST /v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/cancel`: Cancel a run - `POST /v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/events`: Add an event the agent reports to a run - `POST /v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/finish`: End a run as the agent says - `POST /v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/heartbeat`: Say the agent is still working on a run - `POST /v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/replay`: Send a webhook call again as a new run - `PUT /v1/workspaces/{wid}/tasks/{tid}/secret_groups`: Change the secret groups a task's future sandboxes get - `POST /v1/workspaces/{wid}/tasks/{tid}/token/refresh`: Keep the calling sandbox's task token for 24 hours more (task tokens only; an API key gets 403) - `GET /v1/workspaces/{wid}/tasks/{tid}/webhooks`: The task's inbound webhooks, newest first, with how many calls each took - `POST /v1/workspaces/{wid}/tasks/{tid}/webhooks`: Make an inbound webhook for the task - `DELETE /v1/workspaces/{wid}/tasks/{tid}/webhooks/{hid}`: Turn a webhook off; its URL is refused from then on (within a minute on every server) - `GET /v1/workspaces/{wid}/templates`: The workspace's templates, by name - `POST /v1/workspaces/{wid}/templates`: Save a template under its name - `DELETE /v1/workspaces/{wid}/templates/{name}`: Delete a template - `GET /v1/workspaces/{wid}/templates/{name}`: One template - `GET /v1/workspaces/{wid}/usage`: The workspace's usage over the last 7, 30 or 90 UTC days, today included ## Optional - [The full spec](https://annex.eversonder.com/v1/openapi.yaml): also has the routes for signed-in people only (workspaces, members, invites, API keys, connecting providers and other settings), which an API key can't call