Reference

MCP tools

Generated from Annex's MCP server. Tools with an action group related operations; the badges list the actions. Connect with these steps.

Start a sandbox

sandbox_create

Starts a new sandbox (a Linux computer) on one of the user's connected provider accounts and waits until it is running. Use it when you need somewhere to run commands or keep files, but first check sandbox_list for a running one you can reuse. It costs the user money from the moment it starts until sandbox_stop, billed by their provider at rate_per_hour_micros (millionths of a US dollar an hour), so pick the smallest size that will do. Route fastest goes by start-up times measured from Annex's servers in Europe, so a provider far from Europe can look a little slower than it would be near it. Pass task to put it in an existing task (to fan work out; see task_queue, and task_plan for how many). Each sandbox gets ANNEX_URL, ANNEX_WORKSPACE_ID, ANNEX_TASK_ID and ANNEX_TASK_TOKEN in its environment: the token reaches only its task's queues, key-value store and memory, and stops working when the sandbox stops. Pass secret_groups (names from workspace_info secret_groups, granted to this API key) to add the user's secrets as environment variables; a sandbox joining a task gets the task's groups. Their values are hidden as ••••NAME in output Annex shows you; never print them on purpose. A new task gets an automatic checkpoint about 5 minutes after the first change, then every 30 minutes while something changes, and if its provider ends it while you're using it, Annex carries on in a new sandbox from the newest checkpoint (auto_checkpoint_minutes and auto_resume change that). Annex stops it a day after it starts (lifetime_minutes, up to 7 days) and after an hour with no command running and no use through Annex (idle_minutes, 0 is off). Starts past the workspace's or this key's limit on sandboxes running at once, its monthly spend limit, its per-sandbox CPU/memory ceilings, or outside its operating hours are refused (workspace_info limits). A sandbox its provider ended shows status lost, with replaced_by naming the new sandbox when Annex carried on; calls on it say which one to use. isolation and requires narrow where it may start (a VM only, an arm64 processor…). With dry_run true it starts nothing and returns route: the accounts it would try in order with price, start-up and why, the ones left out with each check they failed, and the smallest changes that would make more eligible. Returns the sandbox: its id (pass it to the other sandbox_* tools), task, provider, region, size, status and hourly rate.

  • annex_accountsstring

    where Annex's own provider accounts (paid from the workspace's Annex credit, see workspace_info credits) go, finer than use_credit: after the user's own accounts, first, only, or off. Leave both out for the user's own accounts only

  • auto_checkpoint_minutesnull | integer

    Save a checkpoint automatically this many minutes after something changed: 0 is off, 5 to 60. Default 30 for a new task, off when joining one; the first comes about 5 minutes after the first change (later when Annex is busy). Each one uses some of the sandbox's time and sends only new files out; Annex keeps the newest 3.

  • auto_resumenull | boolean

    If the provider ends this sandbox while you're using it, start a new one from its newest checkpoint on another of your accounts (the same provider if you named one). Default on for a new task. The new sandbox is billed like any other. Running programs and work since the last checkpoint can't be recovered.

  • dry_runboolean

    true to start nothing and get back route: the accounts Annex would try 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

  • fallbacksnull | boolean

    false to try only the first account that fits (no failover); true or left out to move on when one can't start it

  • idle_minutesnull | integer

    Annex stops it after this many minutes with no command running and no use through Annex: 0 is off, up to 1440; 60 if left out.

  • ignorenull | array

    providers never to use for this one, added to the workspace's own (denied_providers); it wins over route, order and providers

  • isolationnull | array

    how each sandbox may be walled off from its machine: container (shares the machine's kernel), gvisor (a container behind gVisor's own kernel) or vm (a virtual machine of its own). Providers whose isolation Annex doesn't know are left out. Leave out for any

  • lifetime_minutesnull | integer

    Annex stops it this many minutes after it started: 1 to 10080 (7 days); 1440 (a day) if left out.

  • memory_gibinteger

    memory in GiB, 1 to 256 (4 if left out); the price grows with it

  • ordernull | array

    providers to try first, in this order, such as [selfhost, daytona]; the rest follow as the route ranks them. Leave out for the workspace's default order

  • providersnull | array

    only these providers, such as [selfhost, daytona]. Must be within the workspace's allowed providers. Leave out for whatever the workspace allows

  • regionstring

    where it should run, such as us-east or eu-west, or an area (us, americas, eu, apac, me, af) for any region in it; leave out for anywhere (with fastest, Annex picks a region where it measured quicker starts, else the provider chooses)

  • regionsnull | array

    only these regions or areas, such as [eu-london, eu-west] or [eu]; in this order when the account serves several. Must be within the workspace's allowed regions (workspace_info limits). Leave out for whatever the workspace allows

  • requiresnull | array

    what the provider must offer: amd64 or arm64 (its processor), long_lifetime (no cap of its own shorter than lifetime_minutes). Leave out for nothing

  • routestring

    how to pick the provider: cheapest, fastest (the account and region that start quickest, by the start-up times Annex measured on the user's accounts, else for that provider across Annex, else the provider's own figure; within 15% the cheaper wins; with no region it starts in a region measured quicker, else where the provider chooses), or a connected provider's name such as daytona; selfhost is the workspace's own servers, and at $0 an hour cheapest uses them first. Leave out to use the workspace's default route (workspace_info limits: default_route)

  • secret_groupsnull | array

    names of the user's secret groups to add to its environment, such as [github]; a later group wins a name. Leave out when joining a task: it gets the task's groups

  • spotboolean

    true for spare capacity the provider may take back at short notice (AWS only; it falls back to a normal machine; priced as one here)

  • taskstring

    a task id (tsk_…) of this workspace to join, to split one task's work over many sandboxes; leave out for a new task

  • templatestring

    a template of the workspace to start from, by name (sandbox_template lists them): it fills the size, route and secret groups this call leaves out and runs its set-up commands in the new sandbox. Leave out for the workspace's default template if it has one; none for no template

  • use_creditnull | boolean

    how to pay for it: true for Annex credit only (Annex's own accounts), false or left out for the user's own connected accounts only (their own keys). Annex credit must be turned on for the workspace

  • vcpuinteger

    virtual CPUs, 1 to 64 (2 if left out); the price grows with it

List sandboxes

sandbox_list

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. Use it to find a sandbox to reuse before creating one, and to check nothing is left running when you finish; with sandbox_id it returns that one sandbox with every provider tried to start it, and runaway (out_of_memory, cpu or memory when it has been killing processes for lack of memory or flat out for 15 minutes; Annex never stops it for that), and with metrics: true also its CPU, memory and disk use (measured after each command and every minute for 10 minutes after one) and any processes killed for lack of memory, so you can tell whether it needs a bigger size; with logs: true also its log, any provider, running or ended: what Annex wrote about it (commands started, notes, checkpoints, resumes, and alerts such as lost, stopped, out of memory or idle and lifetime stops), what its newest 5 commands printed (the last 32 KB of each Annex has read; read a whole one with sandbox_command_output), and on the user's own server what its main process printed; filter with source and stream, page for older lines. Set status to paused, pausing, resuming, stopped, lost (ended by its provider; replaced_by names the sandbox that carried its task on) or all to see ended ones too, and page to read further; listing costs nothing. Returns each sandbox's id, provider, region, size asked for (vcpu, memory_gib) and machine (the provider's machine it really runs on, its name, vcpu and memory_gib: a provider with fixed sizes rounds up to its smallest that fits), status, hourly rate and cost so far (in millionths of a US dollar), with paging in meta.

  • logsboolean

    with sandbox_id: also its log, 25 lines a page (page 1 is the newest; page for older): its task journal lines, what its newest 5 commands printed, and on the user's own server what its main process printed

  • metricsboolean

    with sandbox_id: also its CPU, memory and disk measurements, and how many processes ran out of memory

  • pageinteger

    which page of 25, from 1

  • sandbox_idstring

    one sandbox's id, for it alone with every provider tried to start it; leave out to list

  • sincestring

    metrics: from this RFC 3339 time, within the last 7 days; the last hour if left out. logs: from this RFC 3339 time

  • sourcestring

    logs: only journal, command or container lines

  • statusstring

    running (the default), paused, pausing, resuming, stopped, lost (ended by its provider, not by you or Annex) or all

  • streamstring

    logs: only output lines on stdout or stderr

Run a command

sandbox_run

Runs a shell command in a running sandbox and waits up to wait_seconds (30 by default, at most 60) for it to finish. Use it for builds, tests, installs and anything else you would type in a terminal; the sandbox costs the same per hour whether or not commands run. If it finishes in time you get its status (exited, timed_out or failed), exit_code and output (stdout and stderr together); if it is still going, status is running and you read on with sandbox_command_output and its command_id. Output over 16 KB is cut to its last 16 KB with truncated: true (for very long output, the last 16 KB of its first 64 KB); read all of it with sandbox_command_output.

  • commandstringrequired

    a shell command line, such as 'npm test' or 'cd app && make'

  • cwdstring

    absolute directory to run it in; leave out for the home directory

  • sandbox_idstringrequired

    the sandbox's id, from sandbox_create or sandbox_list

  • wait_secondsnull | integer

    how long to wait for it to finish, 0 to 60; 30 if left out

Read a command's output

sandbox_command_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. Use it after sandbox_run for a command that was still running or whose output was truncated: leave out cursor to read from the start, then pass back next_cursor until done is true. Reading costs nothing beyond the sandbox's hourly rate. Returns output, next_cursor and done, with the command's current status and exit_code.

  • command_idstringrequired

    the command_id that sandbox_run returned

  • cursorstring

    next_cursor from the last call; leave out to read from the start

  • sandbox_idstringrequired

    the sandbox's id

Work with files

sandbox_files
listreadwritedelete

Lists, reads, writes or deletes files in a running sandbox; path is always absolute, such as /home/user/app/main.py. action list gives a directory's entries 100 to a page; read gives a UTF-8 text file of up to 256 KB, 32 KB a call from offset (call again from next_offset while truncated is true); write creates or replaces a file with the text in content; delete removes a file, or a whole directory with recursive. Binary files and files over 256 KB can't be read here: the error says how to download them with Annex's HTTP API. File work costs nothing beyond the sandbox's hourly rate.

  • action"list" | "read" | "write" | "delete"required

    list, read, write or delete

  • contentstring

    write: the file's new text

  • offsetinteger

    read: the byte to start at; pass back next_offset

  • pageinteger

    list: which page of 100 entries, from 1

  • pathstringrequired

    absolute path, such as /home/user/app/main.py

  • recursiveboolean

    delete: also delete a directory with things in it

  • sandbox_idstringrequired

    the sandbox's id

Change a sandbox's settings

sandbox_update

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). Use it to turn automatic checkpoints on before long work you can't afford to lose, or off for throwaway work, or to give long work a longer lifetime; leave a setting out to keep it. The change itself is free. Each automatic checkpoint uses some of the sandbox's time (and the user's bill) and sends only new files out; a sandbox Annex starts to carry on is billed like any other. Returns the sandbox with its settings.

  • auto_checkpoint_minutesnull | integer

    Save a checkpoint automatically this many minutes after something changed: 0 is off, 5 to 60. Default 30 for a new task, off when joining one; the first comes about 5 minutes after the first change (later when Annex is busy). Each one uses some of the sandbox's time and sends only new files out; Annex keeps the newest 3.

  • auto_resumenull | boolean

    If the provider ends this sandbox while you're using it, start a new one from its newest checkpoint on another of your accounts (the same provider if you named one). Default on for a new task. The new sandbox is billed like any other. Running programs and work since the last checkpoint can't be recovered.

  • idle_minutesnull | integer

    Annex stops it after this many minutes with no command running and no use through Annex: 0 is off, up to 1440; 60 if left out.

  • lifetime_minutesnull | integer

    Annex stops it this many minutes after it started: 1 to 10080 (7 days); 1440 (a day) if left out.

  • sandbox_idstringrequired

    the running sandbox's id

Pause a sandbox

sandbox_pause

Pauses the SAME sandbox on its original provider account, preserving its files; every sandbox supports this. Close active output streams first. Commands and files are unavailable while paused. pause_mode is suspended when compute and the running slot are released, frozen when a server freezes work but keeps its allocation, or access_hold when the provider has no native suspension and Annex fences access. pause_billing_continues says whether provider cost, Annex lifetime and limits continue. If the response is lost, retry with the same sandbox_id. Never deletes or replaces the sandbox.

  • sandbox_idstringrequired

    the sandbox's id

Resume the same sandbox

sandbox_unpause

Resumes the SAME sandbox_id and original provider account with its retained files. This is different from sandbox_resume, which restores a checkpoint into a NEW sandbox. Repeated calls on a running sandbox do nothing. A natively suspended sandbox checks workspace limits before resuming; an access hold already occupies its slot. There is no failover. A failed native call leaves the lifecycle pending; retry, or use sandbox_pause to keep it paused. Returns the sandbox. Processes and secrets retain their previous values; external connections may need reconnecting.

  • sandbox_idstringrequired

    the sandbox's id

Stop a sandbox

sandbox_stop

Stops a sandbox, which stops billing for it right away. Use it as soon as you are done with a sandbox; a new one starts in seconds if you need a computer again. Everything in it, files and running commands, is gone afterwards, so copy out what you need first. Returns the sandbox with status stopped and its final cost in millionths of a US dollar.

  • sandbox_idstringrequired

    the sandbox's id

Save and manage checkpoints

sandbox_checkpoint
creategetlistdeletefilesread

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. Use create (the default) before stopping a sandbox you will want back, before a long pause, or to move work to a different machine (more CPU, another provider, another region). It saves root (by default /workspace, else the home folder), leaving out folders that can be rebuilt (node_modules, .venv, __pycache__, target and the like; they are listed in the result) and anything in exclude. It copies files one by one, so pause writes while it runs. Running programs, memory and secrets are not saved. After the first checkpoint, only changed pieces of files are sent. Cost: nothing from Annex, but the sandbox keeps billing while it runs (seconds for a small project, minutes for gigabytes), and some providers charge for data leaving them. create waits up to about a minute; get with checkpoint_id keeps waiting. list pages a sandbox's (sandbox_id) or a task's (task_id) checkpoints; delete removes one (checkpoint_id) for good. files lists a folder of a stored checkpoint (path, else its root) 100 to a page, and read gives one of its UTF-8 text files of up to 256 KB, 32 KB a call from offset: both read Annex's own copy, so they work after the sandbox is stopped, start no sandbox and cost nothing. Returns the checkpoint: status (stored or failed), files, bytes_total, bytes_new, excluded, error.

  • action"create" | "get" | "list" | "delete" | "files" | "read"

    create (the default), get, list, delete, files or read

  • checkpoint_idstring

    get, delete, files and read: the checkpoint; also create, to keep waiting for one started earlier (nothing new is started)

  • excludenull | array

    more folder or file names to leave out, such as data or logs/*.log

  • notestring

    where the work stands and what to do next, kept in the task's journal for whoever resumes it

  • offsetinteger

    read: the byte to start at; pass back next_offset

  • pageinteger

    list: which page of 25, from 1; files: which page of 100

  • pathstring

    files: the absolute folder to list (leave out for the checkpoint's root); read: the absolute path of the file

  • recipenull | object

    how to rebuild the environment on resume: setup (shell commands run before the files come back, such as 'apt-get install -y ffmpeg') and start (a command started after, such as 'npm run dev')

  • rootstring

    absolute folder to save; leave out for /workspace, or the home folder if there is no /workspace

  • sandbox_idstring

    create: the sandbox to checkpoint; list: the sandbox whose checkpoints to list

  • task_idstring

    list: the task whose checkpoints to list, instead of sandbox_id

Resume from a checkpoint

sandbox_resume

Starts a NEW sandbox and restores a stored checkpoint into it, so the task carries on where it stopped. Route it like sandbox_create (cheapest, fastest or a provider's name): any connected provider works, whichever made the checkpoint. It runs the recipe's setup commands, copies the files back and checks every byte against the checkpoint, then runs the recipe's start command; the new sandbox joins the same task, and its journal comes back with the result. Cost: the new sandbox bills from the moment it starts until sandbox_stop, like sandbox_create; a failed resume stops it. The old sandbox keeps billing until you stop it. Waits up to about a minute; if it is still going, call again with resume_id to keep waiting. Returns the resume (status ready or failed, and the new sandbox's id) and, once ready, the task's newest journal entries.

  • annex_accountsstring

    where Annex's own provider accounts (paid from the workspace's Annex credit, see workspace_info credits) go, finer than use_credit: after the user's own accounts, first, only, or off. Leave both out for the user's own accounts only

  • checkpoint_idstringrequired

    the stored checkpoint to resume

  • fallbacksnull | boolean

    false to try only the first account that fits (no failover); true or left out to move on when one can't start it

  • ignorenull | array

    providers never to use for this one, added to the workspace's own (denied_providers); it wins over route, order and providers

  • isolationnull | array

    how each sandbox may be walled off from its machine: container (shares the machine's kernel), gvisor (a container behind gVisor's own kernel) or vm (a virtual machine of its own). Providers whose isolation Annex doesn't know are left out. Leave out for any

  • memory_gibinteger

    memory in GiB, 1 to 256; the checkpointed sandbox's if left out

  • ordernull | array

    providers to try first, in this order, such as [selfhost, daytona]; the rest follow as the route ranks them. Leave out for the workspace's default order

  • providersnull | array

    only these providers, such as [selfhost, daytona]. Must be within the workspace's allowed providers. Leave out for whatever the workspace allows

  • regionstring

    where it should run; leave out for anywhere (with fastest, Annex picks a region where it measured quicker starts, else the provider chooses)

  • regionsnull | array

    only these regions or areas, such as [eu-london, eu-west] or [eu]; in this order when the account serves several. Must be within the workspace's allowed regions (workspace_info limits). Leave out for whatever the workspace allows

  • requiresnull | array

    what the provider must offer: amd64 or arm64 (its processor), long_lifetime (no cap of its own shorter than lifetime_minutes). Leave out for nothing

  • resume_idstring

    to keep waiting for a resume started earlier: its id; nothing new is started

  • routestring

    how to pick the new sandbox's provider: cheapest, fastest, or a connected provider's name; any provider works

  • use_creditnull | boolean

    how to pay for it: true for Annex credit only (Annex's own accounts), false or left out for the user's own connected accounts only (their own keys). Annex credit must be turned on for the workspace

  • vcpuinteger

    virtual CPUs, 1 to 64; the checkpointed sandbox's if left out

Cache dependencies

sandbox_cache
saverestoregetlistdelete

The workspace's dependency cache: a sandbox's dependency folders (node_modules, .venv) kept by lockfile. Use save after installing dependencies, and restore in a new sandbox instead of reinstalling: each folder is keyed by its lockfile (package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lockb, uv.lock, poetry.lock, Pipfile.lock, requirements*.txt), path, platform and node or python3 version, so only an exact match is restored. Checkpoints save these folders and resumes restore them on their own; call this for anything else. list pages the cached folders, most recently used first; delete removes one by key. Cost: nothing from Annex; the sandbox keeps billing while a save or restore runs. save and restore wait up to about a minute; get with job_id keeps waiting. Returns the job: cached (save), restored_from_cache and cache_misses (restore).

  • action"save" | "restore" | "get" | "list" | "delete"required

    save, restore, get, list or delete

  • job_idstring

    get: the job save or restore returned, to keep waiting for it

  • keystring

    delete: the entry's key, from list

  • pageinteger

    list: which page of 25, from 1

  • rootstring

    absolute folder to look for lockfiles in (3 levels deep); leave out for /workspace, or the home folder if there is no /workspace

  • sandbox_idstring

    save and restore: the sandbox to save from or restore into

Read and write a task's journal

task_journal
listgetnotesecret_groups

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. note adds a line to the journal from a sandbox of the task (sandbox_id, text): where the work stands and what is next, for whoever picks it up. secret_groups sets the groups (names granted to this API key) the task's future sandboxes get, for a resume or fan-out; running sandboxes keep theirs. Costs nothing.

  • action"list" | "get" | "note" | "secret_groups"required

    list, get, note or secret_groups

  • pageinteger

    list: which page of 25 tasks; get: which page of 20 journal entries; from 1

  • sandbox_idstring

    note: a sandbox of the task; the note goes in its task's journal

  • secret_groupsnull | array

    secret_groups: names of groups granted to this API key, in order (a later group wins a name); empty for none

  • task_idstring

    get and secret_groups: the task (tsk_…), from any of its sandboxes

  • textstring

    note: where the work stands and what is next, 16384 characters at most; never secrets

Share work through a queue

task_queue
pushclaimackreleasedepthlistdead

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. Inside a sandbox, use its own token: curl -X POST -H "Authorization: Bearer $ANNEX_TASK_TOKEN" -H 'Content-Type: application/json' -d '{}' "$ANNEX_URL/v1/workspaces/$ANNEX_WORKSPACE_ID/tasks/$ANNEX_TASK_ID/queues/jobs/claim". A claimed message not acked within visibility_seconds (300 by default) comes back for another claim; after 5 claims it goes to the queue's dead list. Queues are coordination, not storage: they expire 7 days after the task's last write. action: push (body: any JSON), claim (max, visibility_seconds), ack or release (message_id), depth (one queue's waiting, in flight and dead counts), list (every queue with its counts), dead (a page of the queue's dead messages). Costs nothing.

  • action"push" | "claim" | "ack" | "release" | "depth" | "list" | "dead"required

    push, claim, ack, release, depth, list or dead

  • bodyany

    push: the message, any JSON value of 256 KB at most

  • maxinteger

    claim: how many messages at most, 1 to 100; 1 if left out

  • message_idstring

    ack and release: the id claim returned

  • pageinteger

    list and dead: which page of 25, from 1

  • queuestring

    the queue's name, such as jobs: 1 to 64 of a-z, 0-9, _ and -; not for list

  • task_idstringrequired

    the task (tsk_…), from any of its sandboxes

  • visibility_secondsinteger

    claim: how long the messages stay yours before they can be claimed again, 1 to 43200; 300 if left out

Share small results

task_kv
getsetdeletelist

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. Fan-out: you push jobs with task_queue; each sandbox claims one, writes its result here (such as key results/7), and acks; you then list with prefix results/. Every key has a version; set with version is compare-and-set (0 means the key must not exist yet), so two sandboxes never overwrite each other unseen. Values are JSON of 64 KB at most; everything expires 7 days after the task's last write. action: get, set (value, optional version), delete, list (prefix, page of 25). Costs nothing.

  • action"get" | "set" | "delete" | "list"required

    get, set, delete or list

  • keystring

    get, set, delete: 1 to 200 of A-Z, a-z, 0-9 and . _ : / -, such as results/7

  • pageinteger

    list: which page of 25, from 1

  • prefixstring

    list: only keys starting with this

  • task_idstringrequired

    the task (tsk_…), from any of its sandboxes

  • valueany

    set: any JSON value of 64 KB at most

  • versionnull | integer

    set: only if the key is at this version (0: only if it doesn't exist yet); leave out to always write

Remember and recall

task_memory
searchrememberforgetsettings

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). Every memory says who remembered it (by: a person usr_…, an API key key_…, a sandbox sbx_…, or annex for saved journal notes; null for older ones). scope task keeps a memory with one task (task_id) and workspace shares it with every task of the workspace; a resumed checkpoint gets up to 5 back on its own. settings says whether the user has journal notes saved to memory (only they can change it). Annex sends Supermemory only what you remember or search for, so never put secrets or command output in text. It needs Supermemory connected in the Annex dashboard (Connections), else every call says so; Annex charges nothing, and Supermemory may bill the user's own plan.

  • action"search" | "remember" | "forget" | "settings"required

    search, remember, forget or settings

  • idstring

    forget: the memory's id, as remember or search returned it

  • limitinteger

    search: how many, 1 to 25; 10 if left out

  • querystring

    search: what to look for, in plain words, 1000 characters at most

  • scopestring

    task for one task's memories (needs task_id), or workspace for memories every task shares; not for settings

  • tagsnull | array

    remember: up to 10 short labels, such as decision

  • task_idstring

    the task (tsk_…), from any of its sandboxes; needed for scope task

  • textstring

    remember: what to keep, 16 KB at most; never secrets

Plan a batch of jobs

task_plan
plangetlistapply

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. Give jobs, minutes_per_job (or a sample of measured minutes), the size, and any deadline_minutes, budget_usd_micros, regions, providers or max_sandboxes; if a deadline or budget can't be met you still get the best plan, with infeasible saying why and what would work. apply (plan_id) STARTS THE PLAN'S SANDBOXES IN THE TASK, WHICH COSTS THE USER MONEY at est_cost_micros or more until you stop them; confirm the cost with the user first. It is done once per plan and waits up to about a minute; get shows progress. Applying pushes no jobs: push one message per job to the plan's queue with task_queue, and stop each sandbox when its queue runs dry.

  • action"plan" | "get" | "list" | "apply"required

    plan (work one out; costs nothing), get, list or apply (starts the plan's sandboxes, which costs money)

  • budget_usd_microsnull | integer

    spend at most this, in millionths of a US dollar ($2 is 2000000)

  • deadline_minutesnull | number

    finish within this many minutes, start-up included; leave out for no deadline

  • headroomnull | number

    extra sandboxes for slow jobs, as a share: 0.15 (the default) is 15% more

  • ignorenull | array

    providers never to use, added to the workspace's own

  • isolationnull | array

    how each sandbox may be walled off: container, gvisor or vm; leave out for any

  • jobsinteger

    how many jobs, 1 to 1000000

  • max_sandboxesnull | integer

    at most this many sandboxes, 1 to 1000

  • memory_gibinteger

    memory per sandbox in GiB, 1 to 256

  • minutes_per_jobnull | number

    how long one job takes on one sandbox, in minutes; or give sample instead

  • pageinteger

    list: which page of 25, from 1

  • plan_idstring

    get and apply: the plan's id (pln_…)

  • providersnull | array

    providers allowed, such as [aws,daytona], within the workspace's own allowed providers; leave out for whatever the workspace allows

  • queuestring

    the task queue you will push the jobs to; jobs by default

  • regionsnull | array

    regions allowed, such as [eu-west,eu-central], within the workspace's own allowed regions; leave out for whatever the workspace allows

  • requiresnull | array

    what the provider must offer: amd64, arm64, long_lifetime; leave out for nothing

  • samplenull | array

    measured minutes of some jobs; their median is used as minutes_per_job

  • spotstring

    spare capacity a provider may take back (AWS only): never (the default), allowed or prefer

  • spreadnull | boolean

    keep at least a quarter on a second provider when there is one, so one outage doesn't stop the work; true by default

  • task_idstringrequired

    the task (tsk_…) the sandboxes are for, from any of its sandboxes

  • vcpuinteger

    virtual CPUs per sandbox, 1 to 64

Read the workspace

workspace_info
regionsusageconnectionsaccountsconnectorssecret_groupsmeasurementslimitscredits

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). credits (the workspace's Annex credit, in early access and off until EVERSONDER turns it on for the workspace: a sandbox_create with use_credit true runs on Annex's own account at a provider and is paid from it; without use_credit, sandboxes run only on the user's own accounts. balance_micros is what is left, and only the user adds credit, in the dashboard). Costs nothing. Connecting accounts, API keys and secret values are for the user in the Annex dashboard, never for agents.

  • action"regions" | "usage" | "connections" | "accounts" | "connectors" | "secret_groups" | "measurements" | "limits" | "credits"required

    regions, usage, connections, accounts, connectors, secret_groups, measurements, limits or credits

  • connection_idstring

    accounts: one account (con_…) instead of a page

  • daysinteger

    usage: 7, 30 (the default) or 90

  • levelstring

    accounts with logs: info (everything, the default), warning (warnings and errors) or error

  • logsboolean

    accounts, with connection_id: also that server's log, newest first, 25 to a page: what the Annex helper there did and saw, and its sandboxes starting, ending and running out of memory

  • metricsboolean

    accounts, with connection_id: also that server's readings: CPU, memory, disk, network and sandboxes against its limit

  • pageinteger

    connections, accounts, secret_groups and measurements: which page of 25, from 1

  • resolutionstring

    accounts with metrics: raw (the default, about one a minute), 1m, 5m or 1h

  • sandbox_idstring

    accounts with logs: only the lines about this sandbox

  • sincestring

    accounts with metrics or logs: since this RFC 3339 time, within the last 7 days (default: the last hour for metrics, all 7 days for logs)

Stop a running command

sandbox_command_stop

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. Use it for a command that hangs, runs too long or was a mistake, instead of stopping the whole sandbox; the sandbox and its files stay. It costs nothing. A command that has already ended is an error that says so. Returns the command's status and exit_code as it is then: usually exited with 130, 143 or 137 (the signal that ended it).

  • command_idstringrequired

    the command_id that sandbox_run returned

  • sandbox_idstringrequired

    the sandbox's id

Save and use templates

sandbox_template
listgetsavedeletedraft

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. Use save after working out how to set a sandbox up, so the next one starts ready: give name and the fields to keep; saving under a name that exists replaces that template whole. default true makes it the template every sandbox in the workspace starts from unless sandbox_create names another or none. list shows the workspace's templates, get one, delete removes one (sandboxes already started keep what they have). draft with sandbox_id writes a template from a sandbox you have set up: its size, its route and the commands that were run in it, oldest first; prune them to the ones that matter, then save with a name. Templates cost nothing. The set-up commands run in the first sandbox; Annex then saves the files they changed and puts them back in later sandboxes on the same provider and kind of machine instead of running them again (setup.note says when), unless always_run is true. Returns the template, or templates for list.

  • action"list" | "get" | "save" | "delete" | "draft"

    list (the default), get, save, delete or draft

  • always_runboolean

    save: true to run the set-up commands in every sandbox and never reuse their saved result; needed when a command starts a program that must be running

  • defaultboolean

    save: true to make it the template every start in the workspace uses unless it names another

  • descriptionstring

    save: a sentence on what it is for

  • memory_gibinteger

    save: memory in GiB, 1 to 256; leave out to let each start decide

  • namestring

    the template's name: lower-case letters, digits and dashes, such as node-dev; needed for get, save and delete

  • regionstring

    save: a region code such as eu-central; leave out for anywhere

  • routestring

    save: cheapest, fastest or a provider's name; leave out to let each start decide

  • sandbox_idstring

    draft: the sandbox to write a template from

  • secret_groupsnull | array

    save: names of secret groups added to each sandbox's environment

  • setupnull | array

    save: shell commands run in order in a new sandbox, such as ['apt-get update && apt-get install -y ripgrep', 'npm i -g pnpm']; the first that fails stops the rest. At most 30. Annex saves what they changed on disk after the first run and puts it back in later sandboxes instead of running them again (files only: not running programs, not /tmp)

  • vcpuinteger

    save: virtual CPUs, 1 to 64; leave out to let each start decide

See and report what each run did

task_run
listgetstarteventheartbeatfinishcancelreplay

A task's runs: one execution of work, start to end. Annex records each webhook call as a run on its own (received, each attempt, how it ended, the task's journal lines from its sandbox), and the agent may start runs of its own and report on any. status: queued (waiting for a running sandbox or the agent), running, stuck (nothing heard within its timeout, 10 minutes by default; it can still finish), succeeded, failed (the agent said so, or 5 attempts failed), delivered (written into the sandbox with no command: report on it to say what happened), cancelled. may_have_run_twice says an attempt started while an earlier one may still have been working. A call whose run has ended is never handed out again. list (page) newest first; get (run_id) with events and cost_micros (its sandboxes while it ran, shared with anything else there) plus agent_cost_micros (what the agent reported). start (name, timeout_seconds) a run of your own; event (run_id, kind such as step, tool, log or usage, text, cost_micros); heartbeat (run_id, timeout_seconds) keeps it from going stuck, keeps the call's queue claim, and answers cancel: true once cancelled; finish (run_id, status succeeded or failed, result, error, cost_micros); cancel (run_id): a queued call is handed to no one and a running webhook command is stopped; replay (run_id): a webhook call sent again as a new run, within 7 days. Inside a sandbox the webhook's command gets ANNEX_RUN_ID, and the delivered JSON has run. Costs nothing.

  • action"list" | "get" | "start" | "event" | "heartbeat" | "finish" | "cancel" | "replay"required

    list, get, start, event, heartbeat, finish, cancel or replay

  • cost_microsinteger

    event, finish: what it cost you apart from sandboxes (model calls), in micro-dollars

  • errorstring

    finish: why it failed

  • kindstring

    event: step, tool, log, error, usage or your own word (lowercase, 32 characters at most)

  • namestring

    start: what the run is, 60 characters at most

  • pageinteger

    list: the page, from 1; 25 runs a page

  • resultstring

    finish: a short summary of the outcome

  • run_idstring

    every action but list and start: the run (run_…)

  • statusstring

    finish: succeeded or failed

  • task_idstringrequired

    the task (tsk_…), from any of its sandboxes

  • textstring

    event: what happened, 2,000 characters at most (secret values of the sandbox are taken out)

  • timeout_secondsinteger

    start, heartbeat: how long it may go quiet before it is stuck, 30 to 86400 (600 by default)

Send run events to your URL

task_run_subscription
createlistdelete

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. Each is a POST of {id, type, created_at, run} with Annex-Event and Annex-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>" keyed with the secret>; any 2xx counts, else it is tried 3 more times over about 6 minutes. create (url: https, events: all if left out) answers the secret once; list with each one's last try; delete (subscription_id). 5 per task.

  • action"create" | "list" | "delete"required

    create, list or delete

  • eventsnull | array

    create: which of run.started, run.succeeded, run.failed, run.stuck, run.cancelled, run.delivered; all if left out

  • subscription_idstring

    delete: the subscription (rsb_…)

  • task_idstringrequired

    the task (tsk_…), from any of its sandboxes

  • urlstring

    create: an https URL of yours

Receive calls from other services

task_webhook
createlistdelete

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. create (name, deliver, command, queue, wake) answers its url once: keep it, Annex keeps only a hash. deliver sandbox (the default): Annex writes each request into the task's newest running sandbox as JSON at /tmp/annex-inbox/<webhook id>/<message id>.json ({method, query, headers, body or body_base64, from, received_at}) and, with command, runs it there with the file on stdin and ANNEX_WEBHOOK_FILE set (exit 0, or it is tried again, 5 times at most); requests wait on the webhook's own queue (named after it) while no sandbox of the task runs. deliver queue: they only wait on a queue (webhooks, or queue), for the agent to claim with task_queue or its task token. list every webhook of the task with its deliveries; delete (webhook_id) revokes one. A sender's retry with the same delivery id (Idempotency-Key, Webhook-Id, X-GitHub-Delivery) is taken once. Inside a sandbox, its own token makes one: curl -X POST -H "Authorization: Bearer $ANNEX_TASK_TOKEN" -H 'Content-Type: application/json' -d '{"name":"github"}' "$ANNEX_URL/v1/workspaces/$ANNEX_WORKSPACE_ID/tasks/$ANNEX_TASK_ID/webhooks". Costs nothing.

  • action"create" | "list" | "delete"required

    create, list or delete

  • commandstring

    create, deliver sandbox: run in the sandbox for each request, with it on stdin; leave out to only write the file

  • deliverstring

    create: sandbox (the default: Annex writes each request into a running sandbox of the task) or queue (they wait on the queue for the agent to claim)

  • namestring

    create: a name for you, such as github; 60 characters at most

  • queuestring

    create, deliver queue only: the task's queue the requests go on; webhooks if left out (a sandbox webhook has its own)

  • task_idstringrequired

    the task (tsk_…), from any of its sandboxes

  • wakeboolean

    create, deliver sandbox: resume the task's newest paused sandbox when a call finds none running (a call never pauses or stops one)

  • webhook_idstring

    delete: the webhook (whk_…)