Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.axiomancer.io/llms.txt

Use this file to discover all available pages before exploring further.

The admin API is a separate surface from the proxy itself — it lives at https://api.routeshift.io/admin and requires a workspace-scoped admin token, not a virtual key.

Authentication

Authorization: Bearer ROUTESHIFT_ADMIN_TOKEN
Mint admin tokens at Settings → API tokens. They are workspace-scoped and never expire automatically; rotate on your own schedule.
ROUTESHIFT_ADMIN_TOKEN does not fall back to a virtual sk-proxy-… key. Calling an admin endpoint with a virtual key returns 401 Unauthorized — virtual keys must never carry workspace-admin scope.

Keys

Mint a virtual key

POST /admin/keys
Content-Type: application/json
{
  "alias": "prod-agent",
  "allowed_models": ["gpt-4o", "gpt-4o-mini"],
  "expires_at": "2026-12-31T00:00:00Z",
  "rpm": 60,
  "tpm": 200000,
  "monthly_budget_usd": 100,
  "metadata": { "env": "prod", "owner": "agent-team" }
}
Response includes the one-time sk-proxy-… token. RouteShift stores only its hash; the plaintext is unrecoverable after this response.

List keys

GET /admin/keys
Returns the metadata for every key in the workspace (without the secret).

Revoke a key

DELETE /admin/keys/{key_id}
Revocation is immediate. In-flight requests finish; new requests return 401.

Usage

Window query

GET /admin/sessions/window?from=2026-04-01T00:00:00Z&to=2026-04-30T23:59:59Z&limit=500&cursor=…
Paginated read of session_metrics for a time window. Each row contains session ID, virtual key ID, model, request count, total tokens, total cost, one-shot flag, and retry count. This endpoint exists primarily to feed the Layer-side yield correlation worker — see Axiom Layer’s AI usage tracking.

One-shot rate

GET /api/usage/one-shot?model=gpt-4o&from=…&to=…
Returns { sessions, one_shot, retry_rate } for the matching slice. Drives the analytics page in the dashboard.

Routing

Invalidate alias cache

POST /admin/model-aliases/invalidate
Tells the proxy fleet to drop its in-memory model-alias cache. Issued automatically when you save an alias from the dashboard, but exposed here for tooling that edits aliases out-of-band.

Response shape

All admin endpoints return JSON with this envelope:
{
  "data": {  },
  "request_id": "req_…"
}
On error:
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "req_…"
  }
}
request_id is logged on the proxy side, so support can trace any failed call.