GET /v1/usage authenticate with a dashboard session
instead, and answer 401 session_required to an API key. A few of them also
accept the token anona login --cli stores; see
which credential each route accepts.
Getting a key
1
Sign up and verify
Create an account at the dashboard and verify your
email. Sign-in is blocked until you do.
2
Create the key
Go to API keys → New key, choose an environment, and give the key a name.
Signing up does not create one for you.
3
Copy it immediately
The full key is shown once. Afterwards only its prefix is visible, in the dashboard
and in the API.
Keys can also be created and revoked programmatically. See
API Keys.
Handling keys safely
Organization and space context
Every request runs in the context of the organization behind the API key, plus thespace_id you supply. The boundary is enforced at the gateway and again at the
database layer, so another organization’s space is not reachable by naming it.
The one way across that boundary is a share: another organization can invite you
to one of its spaces, and from then on it is addressable with your own key like any
other. An API key acts as the member who created it, so it reaches, and lists, the
spaces shared with that person. Removing a member from the organization revokes
the keys they created. A shared space comes back from GET /v1/spaces carrying shared_by (the
owning organization’s name) and qualified_id. When a shared name collides with one
of your own — a space’s id is its name, so both can be default — the bare name is
refused with 409 space_ambiguous and you address it by the qualified
{owner_slug}:{space_name} form instead. See
Space members.
Which credential each route accepts
A token from
anona login --cli is accepted on this fixed set of control-plane
routes, and answers with the same body a dashboard session gets:
Everything else on the control plane, including creating or revoking a key,
changing plan, renaming or deleting an organization and inviting or removing
members (of the organization or of a space), stays dashboard-only. A CLI token’s role and organization are read from
your membership on every request, not from the token, so a removal or a change of
role applies to it within 30 seconds.
X-Anona-Org selects one of your other
organizations, as it does on the data plane.
An API key or a temporary-profile token sent to one of the routes above gets
401 session_required with the message: This needs a dashboard session or
anona login --cli; an API key or temporary profile cannot use it.
Rate limiting
Requests to metered endpoints — the ones that spend credits — are rate-limited per organization according to your plan. Current limits are returned on every response from one of those endpoints:429 with code rate_limited. Retry with exponential
backoff. See Usage for reading your limits directly.
Authentication errors
code, and that is what to branch on — never the generic
unauthorized / forbidden, which no endpoint returns. The
error reference is the canonical list.
Next steps
Memories API
Store and manage memories.
Retrieve API
Query memories semantically.
API Keys
Create and revoke keys over the API.
Errors
The full error code reference.