HTTP API

Accounts, logs and readings

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

GET/v1/workspaces/{wid}/usage

The workspace's usage over the last 7, 30 or 90 UTC days, today included

People and API keys

Hours and spend count only time inside the window, at each sandbox's fixed rate. Spend is rounded to the micro-dollar once per sandbox per day, and every total is the sum of those, so the figures add up. started and failovers count sandboxes created inside the window; running is right now. failovers is how many times a provider was unavailable and Annex moved on. daily has every day, oldest first.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
days?InqueryType7 | 30 | 90About

Answer · 200

  • usageUsagerequired
    • daysinteger
    • currency"USD"

      Of every spend_micros in this report

    • totalsobject
    • dailyobject[]
    • providersobject[]
    • regionsobject[]
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/usage' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/accounts

One page of the workspace's accounts (connections), each with its limits, use, spend, status and opt-ins

People and API keys

Accounts metrics (CLAUDE.md). Per connection: what Annex runs on it now; its limits, as the provider reports them where the person opted in (source provider) or Annex's own count against the planner's limit (source estimate); the person's own limits, what was detected, and what plans use (manual always wins); this calendar month's spend as Annex's estimate and, where the person opted in, as the provider billed it; the provider's public status; and which optional permissions the account granted. Provider answers are cached to each provider's cadence (AWS Cost Explorer once a day), so reading this often costs nothing more. API keys may read it.

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

Answer · 200

  • accountsAccount[]required
    • idstring

      The connection (con_…)

    • providerstring
    • kind"sandbox" | "memory"
    • labelstring
    • statusobject

      The provider's public status page, read every 5 minutes for every workspace

    • runningobject

      What Annex itself runs on the account now

    • limitsobject
    • spendobject
    • opt_insobject[]
    • notesstring[]

      What the person can do to see more

    • hostobject | null

      Your own server only (null elsewhere): how it is doing, from Annex's latest reading, with no call to it

    • updated_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_…/accounts' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/accounts/{id}

One account (a connection id, con_…); another workspace's is 404

People and API keys

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
idInpathTypestringAbout

Answer · 200

  • accountAccountrequired
    • idstring

      The connection (con_…)

    • providerstring
    • kind"sandbox" | "memory"
    • labelstring
    • statusobject

      The provider's public status page, read every 5 minutes for every workspace

    • runningobject

      What Annex itself runs on the account now

    • limitsobject
    • spendobject
    • opt_insobject[]
    • notesstring[]

      What the person can do to see more

    • hostobject | null

      Your own server only (null elsewhere): how it is doing, from Annex's latest reading, with no call to it

    • updated_atstring
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/accounts/id' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/accounts/{id}/metrics

Your own server's readings over time (CPU, memory, disk, network, sandboxes against its limit)

People and API keys

Annex reads a server about once a minute while it is connected (one Annex reaches over SSH only while sandboxes run on it) and keeps the readings 7 days. Any account that isn't your own server answers no points. API keys may read it.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
idInpathTypestringAbout
since?InqueryTypestringAboutRFC 3339, within the last 7 days (422 otherwise); the last hour if left out
resolution?InqueryType"raw" | "1m" | "5m" | "1h"Aboutraw, or the last point in each step (422 otherwise)

Answer · 200

  • metricsHostMetricsrequired
    • connectionstring
    • sincestring
    • resolution"raw" | "1m" | "5m" | "1h"
    • latestHostPoint | null
    • pointsHostPoint[]

      Oldest first

    • samplingstring

      When Annex reads the server

Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/accounts/id/metrics' \
  -H 'Authorization: Bearer anx_live_…'
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)

People and API keys

Annex reads the helper's own events about once a minute while the server is connected (one Annex reaches over SSH only while sandboxes run on it) and keeps them 7 days, at most 5,000 lines a server a day (a line says how many more were dropped). Never the server's other logs. A line about a sandbox has its secret values hidden. Any account that isn't your own server answers no lines. API keys may read it.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
idInpathTypestringAbout
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100
since?InqueryTypestringAboutRFC 3339, within the last 7 days (422 otherwise); all 7 days if left out
level?InqueryType"info" | "warning" | "error"Aboutinfo: every line; warning: warnings and errors; error: errors only (422 otherwise)
sandbox?InqueryTypestringAboutOnly the lines about this sandbox

Answer · 200

  • logsHostLog[]required
    • atstring
    • level"info" | "warning" | "error"
    • idstring

      The line's id from the server, stable, so a line seen live and the same line kept merge into one

    • source"helper" | "sandbox" | "container"

      helper: the Annex helper about itself; sandbox: the helper about one sandbox; container: Docker about a sandbox's container

    • sandboxstring

      The sandbox the line is about; left out for the server itself

    • textstring

      Plain words, at most 4 KiB

  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/accounts/id/logs' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/accounts/{id}/logs/stream

Your own server's log as it happens, as Server-Sent Events (live tail)

People and API keys

One "log" event per line (data is a HostLog; its id resumes), as the Annex helper on the server notes it, filtered like …/logs. First come the lines Annex hasn't stored yet (it stores them about once a minute), so merge them with …/logs by the line's id. Reconnect with Last-Event-ID to get the stored lines after the last one you saw (up to 500), then the live ones again. Display only: what is kept is …/logs. A comment every 15 s keeps the stream open; a stream with no line for 30 minutes ends (reconnect to keep following). If the server is removed, one "gone" event says so and the stream closes. A server offline only pauses it. At most 10 live logs at once per workspace and 4 per person or API key (429). Errors before it opens are ordinary JSON. API keys may follow it; MCP has no stream (workspace_info accounts with logs reads the same by page).

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
idInpathTypestringAbout
level?InqueryType"info" | "warning" | "error"AboutAs …/logs (422 otherwise)
sandbox?InqueryTypestringAboutOnly the lines about this sandbox
Last-Event-ID?InheaderTypestringAbout

Answer · 200

id: …, event: log, data: {HostLog} … or event: gone, data: {message, code}

Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/accounts/id/logs/stream' \
  -H 'Authorization: Bearer anx_live_…'