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.

POST/v1/workspaces/{wid}/sandboxes/route

People 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.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
Annex-Use-Credit?InheaderType"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

  • routestring

    Left 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 name

  • regionstring

    One 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) (422 validation_error otherwise); left out for anywhere. A region nothing on the route serves is 422 no_provider, saying so

  • vcpuinteger

    Virtual CPUs; 2 if left out

  • memory_gibinteger

    Memory in GiB; 4 if left out

  • recipeRecipe

    How to rebuild the environment on resume; checkpoints keep the sandbox's unless given their own

    • imagestring | null

      Kept, 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 | null

      Started after the files are back and left running, e.g. "npm run dev"

  • taskstring

    A 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

  • spotboolean

    Ask 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_minutesAutoCheckpointMinutes

    Save 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_resumeAutoResume

    If 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_minutesLifetimeMinutes

    Annex 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_minutesIdleMinutes

    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 at create

  • regionsAllowRegions

    Only 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's allowed_regions (422 validation_error naming 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: 422 no_provider naming the lists. A resume left without them keeps the checkpointed sandbox's, and carrying a lost sandbox on keeps its own.

  • providersAllowProviders

    Only these providers (such as selfhost, daytona), within the workspace's allowed_providers. Left out, whatever the workspace allows.

  • ignoreIgnore

    Providers never to use for this one, added to the workspace's denied_providers (never removed from it). It wins over route, order and providers.

  • orderOrder

    Providers 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.

  • fallbacksboolean

    false: 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_creditboolean

    How 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 then

  • isolation"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 than lifetime_minutes). pause_resume is accepted for compatibility and every provider meets it. A provider Annex has no fact for is left out. Unknown names are 422.

Answer · 200

  • routeRouteViewrequired
    • routestring
    • ranked_by"price" | "startup" | "name"
    • not_triedinteger

      With 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.

Terminal
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":"…"}'
POST/v1/workspaces/{wid}/tasks/{tid}/plans

Plan 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.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Body

  • jobsintegerrequired
  • minutes_per_jobnumber
  • samplenumber[]

    Measured job minutes; their median is used

  • deadline_minutesnumber

    Start-up included

  • budget_usd_microsinteger
  • vcpuintegerrequired
  • memory_gibintegerrequired
  • regionsstring[]

    Allowed region codes or areas (as on create; 422 validation_error for any other); empty is any

  • providersstring[]

    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_providers

  • spot"never" | "allowed" | "prefer"

    AWS spare capacity; priced as a normal machine, an upper bound

  • max_sandboxesinteger
  • headroomnumber
  • spreadboolean

    At least a quarter (and one) on a second provider when there is one

  • queuestring

    Where you will push the jobs

Answer · 201

  • planPlanrequired
    • idstring
    • taskstring
    • inputPlanInput

      Give minutes_per_job or sample.

    • allocationsobject[]
    • totalsobject
    • infeasibleobject[]
    • queueobject
    • status"draft" | "applied" | "expired"
    • applyPlanApply | null
    • created_atstring
    • expires_atstring
Terminal
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}'
GET/v1/workspaces/{wid}/tasks/{tid}/plans

One page of the task's plans, newest first

People and API keys

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • plansPlan[]required
    • idstring
    • taskstring
    • inputPlanInput

      Give minutes_per_job or sample.

    • allocationsobject[]
    • totalsobject
    • infeasibleobject[]
    • queueobject
    • status"draft" | "applied" | "expired"
    • applyPlanApply | null
    • created_atstring
    • expires_atstring
  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/plans/{pid}

A plan, with its apply progress once applied

People and API keys

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
pidInpathTypestringAboutPlan id (pln_…)

Answer · 200

  • planPlanrequired
    • idstring
    • taskstring
    • inputPlanInput

      Give minutes_per_job or sample.

    • allocationsobject[]
    • totalsobject
    • infeasibleobject[]
    • queueobject
    • status"draft" | "applied" | "expired"
    • applyPlanApply | null
    • created_atstring
    • expires_atstring
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans/pid' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/plans/{pid}/apply

Start 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.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
pidInpathTypestringAboutPlan id (pln_…)
Idempotency-Key?InheaderTypestringAbout

Answer · 200

  • plan_applyPlanApplyrequired
    • planstring
    • taskstring
    • status"queued" | "starting" | "ready" | "failed"

      ready: some or all started (see failures); failed: none did

    • wantedinteger
    • startedinteger
    • sandboxesstring[]
    • failuresobject[]
    • finished_atstring | null
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans/pid/apply' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/plans/{pid}/events

An 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.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
pidInpathTypestringAboutPlan id (pln_…)

Answer · 200

text/event-stream

Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/plans/pid/events' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/measurements

Measured 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.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
  • measurementsobject[]required
    • providerstring
    • connectionstring | null

      null for a demo provider (local only)

    • regionstring
    • sizestring

      vCPU x GiB asked for

    • samplesinteger

      Starts in the last 7 days

    • median_startup_msinteger | null
    • p90_startup_msinteger | null
    • tries_24hinteger
    • unavailable_rate_24hnumber | null
    • tries_7dinteger
    • unavailable_rate_7dnumber | null
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/measurements' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/regions

Where sandboxes can run, and which of the workspace's providers serve each place (bounded reference data, not paged)

People and API keys

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id

Answer · 200

  • regionsobject[]required
    • codestring
    • namestring
    • latnumber
    • lngnumber
    • providersstring[]
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/regions' \
  -H 'Authorization: Bearer anx_live_…'