Observability
The one id you need: x-airouter-request-id
Every response carries it. Log it. When something is off:
- Open Requests in the dashboard.
- Paste the id into the filter.
- The row shows request body, response body (if raw capture is on), vendor, model, tokens, cost, latency, fallback, cache state, and error code.
What to log per call
| Field | Where |
|---|---|
request_id | x-airouter-request-id |
vendor, model | x-airouter-vendor, x-airouter-model |
cost_usd | x-airouter-cost-usd |
latency_ms | x-airouter-latency-ms |
cache | x-airouter-cache |
fallback | x-airouter-fallback === '1' |
end_user | the value you sent |
A one-line structured log with these fields covers 90% of debugging.
Overview dashboard
Workspace → Overview shows:
- Total cost, requests, tokens — current window.
- Cost trend over time (sparkline + day bars).
- P50 / P95 latency.
- Top models by spend.
- Top end users by spend (only populated if you set
x-airouter-end-user). - Cache hit rate.
Request Inspector (super-admin)
For deep dives — the super-admin Requests panel adds raw payload inspection (when raw capture is on), full header dump, and per-request cost breakdown.
Latency
x-airouter-latency-msis end-to-end at the gateway (includes upstream vendor time).- For pure vendor latency, subtract ~10–30ms of gateway overhead.
- Use P95 on Overview to monitor — averages hide tail latency.
Error rate
Configure an error_rate alert (Workspace → Alerts). Fires when the rolling error rate over 5 minutes crosses your threshold.