// api reference

API Reference

All routes are under https://api.aetherin.app/v1. Operator routes use a session cookie; client routes use Authorization: Bearer sk-aetherin-….

Health

MethodPathDescription
GET/healthzLiveness probe
GET/readyzReadiness probe (db, redis, providers)
GET/versionBuild info

Auth

MethodPathDescription
POST/auth/registerCreate an account
POST/auth/activateActivate an invited account
POST/auth/activate/{token}Activate an invited account (token in path)
POST/auth/loginOperator login (sets session cookie)
POST/auth/logoutLogout (clears session cookie)
GET/auth/meCurrent user + orgs
POST/auth/refreshRefresh session

Orgs & Workspaces

MethodPathDescription
GET/orgsList organizations
POST/orgsCreate organization
GET/orgs/{id}Get organization
PATCH/orgs/{id}Update organization
DELETE/orgs/{id}Delete organization
GET/orgs/{id}/workspacesList workspaces in org
POST/orgs/{id}/workspacesCreate workspace
GET/orgs/{id}/workspaces/{workspaceId}Get workspace
PATCH/orgs/{id}/workspaces/{workspaceId}Update workspace
DELETE/orgs/{id}/workspaces/{workspaceId}Delete workspace
GET/orgs/{id}/invitesList invitations for an org
POST/orgs/{id}/invitesInvite an email address to an org
DELETE/orgs/{id}/invites/{inviteId}Revoke a pending invitation
POST/invites/{token}/acceptAccept an invitation
GET/orgs/{id}/membersList members of an org
PATCH/orgs/{id}/members/{memberId}Change a member's role
DELETE/orgs/{id}/members/{memberId}Remove a member from an org

Keys

MethodPathDescription
GET/keysList API keys (scoped to workspace)
POST/keysCreate API key (key shown once)
GET/keys/{id}Get API key
PATCH/keys/{id}Update API key
DELETE/keys/{id}Revoke/delete API key
POST/keys/{id}/rotateRotate API key (new key shown once)

Models & Providers

MethodPathDescription
GET/modelsList models (OpenAI-compatible)
POST/modelsRegister a model for a provider
GET/models/{id}Get model
GET/models/{id}/routesList fallback routes for a model
POST/models/{id}/routesAdd or update a fallback route for a model
DELETE/models/{id}/routes/{routeID}Delete a fallback route
GET/providersList providers (catalog + status)
POST/providersConfigure upstream provider credentials
GET/providers/{id}/healthProvider health check
PATCH/providers/{id}Update a provider (enable/disable, base URL, rotate key)
DELETE/providers/{id}Disable a provider (soft delete)

Chat & Embeddings

MethodPathDescription
POST/chat/completionsChat completions (streaming + non-streaming)
POST/embeddingsCreate embeddings

Usage & Budgets

MethodPathDescription
GET/usageUsage summary (by key/model/day)
GET/usage/export.csvExport usage events as CSV
GET/usage/eventsPaginated raw usage events
GET/budgetsList budgets
POST/budgetsCreate budget
PATCH/budgets/{id}Update budget

Plugins

MethodPathDescription
GET/pluginsList plugins
POST/plugins/installInstall plugin
GET/plugins/{id}/configGet plugin config
PATCH/plugins/{id}/configUpdate plugin config
DELETE/plugins/{id}Uninstall plugin

Billing

MethodPathDescription
GET/billing/plansList the plan catalog
GET/billing/subscriptionGet the current subscription
POST/billing/checkout-sessionStart a subscription checkout
POST/billing/portal-sessionOpen the customer billing portal
GET/billing/invoicesList invoices
POST/webhooks/stripeStripe webhook receiver

Admin

MethodPathDescription
GET/admin/usersList all users
POST/admin/usersCreate a user
PATCH/admin/users/{id}Update a user
DELETE/admin/users/{id}Soft-delete a user
GET/admin/audit-logAudit log
GET/admin/systemSystem info
GET/admin/models/pricingList models with governance prices (default, recommended, effective)
PATCH/admin/models/{id}/pricingSet a model's catalogue price and provenance
GET/admin/price-policiesList margin policies
POST/admin/price-policiesSet the margin for a scope (upsert)
DELETE/admin/price-policies/{id}Delete a margin policy
GET/admin/notificationsList the operator's discovery notifications
PATCH/admin/notifications/{id}Resolve a notification (applied or dismissed)
GET/admin/feedsList provider catalogue feeds
POST/admin/feedsRegister a feed (upsert by adapter + label)
GET/admin/feeds/{id}Read a feed
POST/admin/feeds/{id}/runRun a feed now

Error codes

Every error uses the same envelope — branch on error.code, never on message.

{
  "error": {
    "code": "invalid_request",
    "message": "model is required",
    "type": "invalid_request_error",
    "param": "model",
    "request_id": "req_01HXYZ"
  }
}
CodeHTTPMeaning
invalid_request400The request is malformed or missing required data.
validation_error400The request failed schema/semantic validation.
unauthorized401Authentication is missing or invalid.
forbidden403Authenticated but not allowed to perform the action.
not_found404The referenced resource does not exist.
conflict409The request conflicts with current state.
budget_exceeded402The key or workspace budget is exhausted.
rate_limit_exceeded429Per-key request/token rate limit hit.
provider_error502The upstream provider failed or is unreachable.
secrets_unavailable503A required dependency is not available to serve the request.
csrf_invalid403The CSRF proof was missing or did not match the session.
internal_error500Unexpected server-side failure.

Error codes are stable: existing codes are never renamed or repurposed, and new codes may be added in a minor release. Consumers must tolerate unknown codes.