PLATFORM

Logs & observability

Every billed request lands in the log: model, provider, tokens, cost and links to any generated files. This is the source of truth for what you were charged.

What each request records

The Logs section of the dashboard holds one row per billed request:

  • the timestamp, the surface (chat, image or video) and the model you asked for;
  • the provider that actually served it - which can differ from the expected one when failover kicked in;
  • the key the request was made with, so you can attribute spend per service;
  • tokens (prompt, completion, total) and the settled cost in USD;
  • for images - image_urls, the CDN links, with a download button.
JSON
{
  "object": "usage_event",
  "created_at": "2026-07-09T08:14:02.511Z",
  "surface": "image",
  "model": "nano-banana-pro",
  "provider": "kie",
  "key_id": "0f2c…",
  "prompt_tokens": null,
  "completion_tokens": null,
  "total_tokens": null,
  "cost_usd": 0.032,
  "image_urls": ["https://api.altrouter.ai/media/…"]
}

Reconciling charges

If a charge looks surprising, start here: the sum of cost_usd over a period is exactly what left your balance. The dashboard summary covers 1, 7 and 30 days; paging back takes you further into the past.

i
Billing settles on actuals. An upper-bound estimate is held for the duration of the request, then replaced by the real cost once the model responds - so the log always shows the real price, not the estimate. GET /v1/credits reports the current balance and how much is held.

Observability in the response itself

Every response carries an x-request-id header; the generating endpoints add x-ratelimit-limit and x-ratelimit-remaining, and the body carries a usage block with the tokens and cost - what this request took from the balance, USD. In a stream it arrives as the last chunk before [DONE]; for video, cost appears on the render object at status: completed. That is enough to track spend on your side.

The log over the API

The same log is available with an API key, no dashboard login needed: GET /v1/generation?id=… returns one request’s row by its x-request-id, and GET /v1/usage pages through all of the account’s requests. Fields are in the API reference.

cURL
curl -s -D - https://api.altrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer ar-..." -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.4","messages":[{"role":"user","content":"Hi"}]}'
# x-request-id: req_mupm4nfkhzua0y8j
# ... "usage": { ..., "cost": 0.000036 }

curl "https://api.altrouter.ai/v1/generation?id=req_mupm4nfkhzua0y8j" \
  -H "Authorization: Bearer ar-..."

How long log rows and files live is covered in Data retention.

NextData retention →