HTTP API
Routing and plans
8 routes your API key can call. Each says who may call it; every example assumes KEY is your API key. What only the dashboard does (signing in, making API keys, connecting accounts) isn't listed here: it's in the full OpenAPI spec.
/v1/workspaces/{wid}/sandboxes/routePeople and API keys
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. Starts nothing and calls no provider. Members and API keys. MCP: sandbox_create with dry_run true.
| Parameter | In | Type | About |
|---|---|---|---|
wid | Inpath | Typestring | AboutWorkspace id |
Annex-Use-Credit? | Inheader | Type"credit" | "byok" | "true" | "false" | AboutHow it is paid for, as the body's use_credit: credit, Annex credit only; byok, your own connected accounts only |
Body
routestringLeft out: the workspace's
default_route(422 pointing at Settings when there is none; 422 when the workspace locked its route and this names another). "cheapest", "fastest" (the account and region that start a sandbox quickest, by the start-up times Annex measured on your accounts over 7 days once it saw 10 starts, else those it measured for that provider across Annex, else the provider's own figure; start-ups within 15% of each other count as a tie, which the cheaper one wins; with no region given, the sandbox starts in a region Annex measured quicker, else where the provider chooses. Start-up is measured from Annex's servers in Europe, so a provider far from Europe can look a little slower than it would be near it), or a provider nameregionstringOne of
us-east,us-west,eu-west,eu-central,ap-southeast,ap-northeast,sa-east,us-california,us-chicago,us-dallas,ca-toronto,eu-london,eu-paris,eu-amsterdam,eu-stockholm,eu-helsinki,eu-milan,eu-madrid,me-dubai,af-johannesburg,ap-mumbai,ap-hongkong,ap-seoul,ap-sydney, or auto (Cloudflare's: it places the container itself) (422validation_errorotherwise); left out for anywhere. A region nothing on the route serves is 422no_provider, saying sovcpuintegerVirtual CPUs; 2 if left out
memory_gibintegerMemory in GiB; 4 if left out
recipeRecipeHow to rebuild the environment on resume; checkpoints keep the sandbox's unless given their own
imagestring | nullKept, not yet used: no provider starts from an image through Annex yet
setupstring[]Run in order on resume before the files come back, e.g. "apt-get install -y ffmpeg"
startstring | nullStarted after the files are back and left running, e.g. "npm run dev"
taskstringA task of this workspace to join, so its sandboxes share queues and a key-value store (404 for any other); a new task if left out
spotbooleanAsk for spare capacity the provider may take back at two minutes' notice. Only AWS has it, and falls back to a normal machine when there is none; other providers ignore it. The rate shown is the normal price, an upper bound
secret_groupsstring[]Secret groups (names or ids) whose variables go into the sandbox's environment at start; if two set one name, the later group wins (listed in
secret_overridden). An API key may name only groups it was granted (422 otherwise, the same as an unknown group). Left out when joining a task, the task's groups are used; a new task remembers the groups it started with.auto_checkpoint_minutesAutoCheckpointMinutesSave a checkpoint automatically this many minutes after something changed: 0 is off, else 5 to 60 (1 to 4 are 422). Default 30 for a new task, 0 when joining one. The first comes about 5 minutes after the first change (later when Annex is busy), so a short-lived sandbox has one to carry on from. Each uses some of the sandbox's time and sends only new files out; the newest 3 are kept.
auto_resumeAutoResumeIf its provider ends the sandbox while it is in use, start a new one from its newest checkpoint on another account (the same provider for a named route). Default true for a new task, false when joining one. The new sandbox is billed like any other; running programs and work since the last checkpoint are never recovered.
lifetime_minutesLifetimeMinutesAnnex stops it (an ordinary stop, with a journal line) after this many billable minutes: 1 to 10080 (7 days); 1440 if left out at create. Suspended pauses are excluded; frozen and access-hold pauses count.
idle_minutesIdleMinutesAnnex 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 at create
regionsAllowRegionsOnly these regions (Annex region codes, or areas: us,
americas, eu, europe,apac, me, af, each any region in it, including ones added later), within the workspace'sallowed_regions(422validation_errornaming the workspace's list otherwise). An account serving several is asked for the first listed; an account that says nowhere where it runs is left out. A region given too must be one of them. Left out: whatever the workspace allows. Nothing connected left: 422no_providernaming the lists. A resume left without them keeps the checkpointed sandbox's, and carrying a lost sandbox on keeps its own.providersAllowProvidersOnly these providers (such as selfhost, daytona), within the workspace's
allowed_providers. Left out, whatever the workspace allows.ignoreIgnoreProviders never to use for this one, added to the workspace's
denied_providers(never removed from it). It wins over route, order and providers.orderOrderProviders to try first, in this order; the rest follow as the route ranks them. Left out, the workspace's
default_order. 422 while the workspace's route is locked.fallbacksbooleanfalse: try only the first account that fits, with no failover (the error says the others weren't tried); true or left out: move on when one can't start it. 422 while the workspace's route is locked
annex_accounts"after" | "first" | "only" | "off"after (the default): Annex's own provider accounts, paid from Annex credit, are tried behind the workspace's own accounts; first: before them; only: none of the workspace's own; off: never. Left out: the workspace's choice. A request can't turn them on where the workspace turned them off, or while Annex credit isn't turned on for the workspace (422)
use_creditbooleanHow the sandbox is paid for: true, Annex credit only (Annex's own provider accounts); false, the workspace's own connected accounts only (bring your own keys). Left out: false, so credit is spent only when a start asks for it. Also taken as the Annex-Use-Credit header (credit or byok); the two, or this and a different
annex_accounts, must agree (422). Annex credit is off for every workspace until EVERSONDER turns it on: true is a 422 until thenisolation"container" | "gvisor" | "vm"[]How each sandbox may be walled off from its machine; providers whose isolation Annex doesn't know are left out. Left out for any.
requires"amd64" | "arm64" | "long_lifetime" | "pause_resume"[]What the provider must offer: its processor (amd64, arm64), or
long_lifetime(no cap of its own shorter thanlifetime_minutes).pause_resumeis accepted for compatibility and every provider meets it. A provider Annex has no fact for is left out. Unknown names are 422.
Answer · 200
routeRouteViewrequiredroutestringranked_by"price" | "startup" | "name"not_triedintegerWith fallbacks false: how many more accounts could take it but won't be tried
eligibleobject[]The accounts create would try, in order.
excludedobject[]nearestobject[]Single changes that would make excluded accounts eligible, the ones helping most first.
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/sandboxes/route' \
-H 'Authorization: Bearer anx_live_…' \
-H 'Content-Type: application/json' \
-d '{"route":"…","region":"…"}'/v1/workspaces/{wid}/tasks/{tid}/plansPlan how many sandboxes a batch of jobs needs, where, and at what cost and time
People and API keys
Arithmetic over the workspace's offers (its connected accounts, and the demo providers on a local run that turns them on), no model. Candidates are each offer in each allowed region at this size, ranked by cost per job (price raised for how often the provider was unavailable over 7 days). With a deadline D, sandboxes N = ceil(jobs × minutes ÷ (D − start-up)) × (1 + headroom), raised until whole rounds fit, at most one per job; without one, max_sandboxes or 10. N is filled cheapest first within each account's limit (AWS's vCPU quota, a connection's max_sandboxes, both counting running sandboxes); with spread, at least a quarter go to a second provider. Finish = ceil(jobs ÷ N) × minutes + the slowest start-up; cost = Σ rate × (rounds + start-up). Start-up is the median of Annex's own timings once a provider, region and size has 5 in the last week (startup_basis measured), else the provider's own figure (estimated). A deadline, budget or limit that can't be met still gets the best plan, with infeasible saying why and what would (the shortest deadline the budget covers). The plan is stored as a draft for 24 hours. Planning starts nothing and pushes no jobs. A task token gets 403.
| Parameter | In | Type | About |
|---|---|---|---|
wid | Inpath | Typestring | AboutWorkspace id |
tid | Inpath | Typestring | AboutTask id |
Body
jobsintegerrequiredminutes_per_jobnumbersamplenumber[]Measured job minutes; their median is used
deadline_minutesnumberStart-up included
budget_usd_microsintegervcpuintegerrequiredmemory_gibintegerrequiredregionsstring[]Allowed region codes or areas (as on create; 422
validation_errorfor any other); empty is anyprovidersstring[]Allowed; empty is any connected provider (and the demo providers on a local run that turns them on)
ignorestring[]Providers never used for this plan, added to the workspace's
denied_providersspot"never" | "allowed" | "prefer"AWS spare capacity; priced as a normal machine, an upper bound
max_sandboxesintegerheadroomnumberspreadbooleanAt least a quarter (and one) on a second provider when there is one
queuestringWhere you will push the jobs
Answer · 201
planPlanrequiredidstringtaskstringinputPlanInputGive
minutes_per_jobor sample.allocationsobject[]totalsobjectinfeasibleobject[]queueobjectstatus"draft" | "applied" | "expired"applyPlanApply | nullcreated_atstringexpires_atstring
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans' \
-H 'Authorization: Bearer anx_live_…' \
-H 'Content-Type: application/json' \
-d '{"jobs":1,"vcpu":1,"memory_gib":1}'/v1/workspaces/{wid}/tasks/{tid}/plansOne page of the task's plans, newest first
People and API keys
| Parameter | In | Type | About |
|---|---|---|---|
wid | Inpath | Typestring | AboutWorkspace id |
tid | Inpath | Typestring | AboutTask id |
page? | Inquery | Typeinteger | AboutA missing or invalid page is 1 |
perPage? | Inquery | Typeinteger | AboutHeld between 1 and 100 |
Answer · 200
plansPlan[]requiredidstringtaskstringinputPlanInputGive
minutes_per_jobor sample.allocationsobject[]totalsobjectinfeasibleobject[]queueobjectstatus"draft" | "applied" | "expired"applyPlanApply | nullcreated_atstringexpires_atstring
metaMetarequiredpageintegertotalintegerItems matching, across all pages
pageCountintegerceil(total / perPage)
perPageinteger
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans' \
-H 'Authorization: Bearer anx_live_…'/v1/workspaces/{wid}/tasks/{tid}/plans/{pid}A plan, with its apply progress once applied
People and API keys
| Parameter | In | Type | About |
|---|---|---|---|
wid | Inpath | Typestring | AboutWorkspace id |
tid | Inpath | Typestring | AboutTask id |
pid | Inpath | Typestring | AboutPlan id (pln_…) |
Answer · 200
planPlanrequiredidstringtaskstringinputPlanInputGive
minutes_per_jobor sample.allocationsobject[]totalsobjectinfeasibleobject[]queueobjectstatus"draft" | "applied" | "expired"applyPlanApply | nullcreated_atstringexpires_atstring
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans/pid' \
-H 'Authorization: Bearer anx_live_…'/v1/workspaces/{wid}/tasks/{tid}/plans/{pid}/applyStart the plan's sandboxes in its task (costs money)
People and API keys
Queues a job that creates each allocated sandbox through the ordinary create path (its account first, then failover to the plan's other allowed providers in that region; task env, secrets and the dependency cache all apply), 8 at a time, each with an idempotency key of its own, so a retried job starts nothing twice. A plan is applied once: applying it again, with or without the same Idempotency-Key, returns the same job with 200 and Idempotent-Replayed: true. Partial success is reported: status ready with failures, or failed if none started. Push your jobs to the plan's queue yourself; nothing is pushed for you. 409 for a draft over 24 hours old.
| Parameter | In | Type | About |
|---|---|---|---|
wid | Inpath | Typestring | AboutWorkspace id |
tid | Inpath | Typestring | AboutTask id |
pid | Inpath | Typestring | AboutPlan id (pln_…) |
Idempotency-Key? | Inheader | Typestring | About |
Answer · 200
plan_applyPlanApplyrequiredplanstringtaskstringstatus"queued" | "starting" | "ready" | "failed"ready: some or all started (see failures); failed: none did
wantedintegerstartedintegersandboxesstring[]failuresobject[]finished_atstring | null
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans/pid/apply' \
-H 'Authorization: Bearer anx_live_…'/v1/workspaces/{wid}/tasks/{tid}/plans/{pid}/eventsAn applied plan's progress as Server-Sent Events
People and API keys
"progress" events ({stage, message}: "Started 3 of 22.", failovers), then one "done" or "failed" with the plan_apply. Resume with Last-Event-ID.
| Parameter | In | Type | About |
|---|---|---|---|
wid | Inpath | Typestring | AboutWorkspace id |
tid | Inpath | Typestring | AboutTask id |
pid | Inpath | Typestring | AboutPlan id (pln_…) |
Answer · 200
text/event-stream
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans/pid/events' \
-H 'Authorization: Bearer anx_live_…'/v1/workspaces/{wid}/measurementsMeasured start-ups, per provider account, region and size, over the last 7 days
People and API keys
Every try at starting a sandbox is recorded (kept 30 days). Rates are null with no tries.
| Parameter | In | Type | About |
|---|---|---|---|
wid | Inpath | Typestring | AboutWorkspace id |
page? | Inquery | Typeinteger | AboutA missing or invalid page is 1 |
perPage? | Inquery | Typeinteger | AboutHeld between 1 and 100 |
Answer · 200
metaMetarequiredpageintegertotalintegerItems matching, across all pages
pageCountintegerceil(total / perPage)
perPageinteger
measurementsobject[]requiredproviderstringconnectionstring | nullnull for a demo provider (local only)
regionstringsizestringvCPU x GiB asked for
samplesintegerStarts in the last 7 days
median_startup_msinteger | nullp90_startup_msinteger | nulltries_24hintegerunavailable_rate_24hnumber | nulltries_7dintegerunavailable_rate_7dnumber | null
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/measurements' \
-H 'Authorization: Bearer anx_live_…'/v1/workspaces/{wid}/regionsWhere sandboxes can run, and which of the workspace's providers serve each place (bounded reference data, not paged)
People and API keys
| Parameter | In | Type | About |
|---|---|---|---|
wid | Inpath | Typestring | AboutWorkspace id |
Answer · 200
regionsobject[]requiredcodestringnamestringlatnumberlngnumberprovidersstring[]
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/regions' \
-H 'Authorization: Bearer anx_live_…'