Usage Tracking
Usage data is available in two places: the console dashboards (human-friendly) and the Analytics API (programmatic).
Console dashboards
Section titled “Console dashboards”At console.aiand.com, the dashboard shows:
- Current credit balance.
- Spend over the last 24 hours, 7 days, and 30 days.
- Top models by request count and by cost.
- Recent requests with status, latency, and cost.
Analytics API
Section titled “Analytics API”For automated reporting, query the Analytics endpoints:
GET /analytics/metrics— time-series of requests and tokens.GET /analytics/summary— aggregated totals over a range.GET /logs— individual request rows with cursor pagination.
GET /analytics/metrics and GET /analytics/summary accept range=1h|24h|7days|30days|3months. GET /logs accepts range=15m|1h|6h|24h|7days|30days.
From a terminal, aiand usage --range 30days from the ai& CLI shows requests and tokens for the range, compared with the previous one.
GET /analytics/metrics and GET /analytics/summary return requests and tokens for the range. GET /analytics/metrics also returns tokens per second, latency, and time to first token. GET /logs rows include each request’s cost and currency. For the remaining balance, use the Balance API.
Per-request cost
Section titled “Per-request cost”Send X-Aiand-Metrics: true with a request to receive X-Cost and X-Cost-Currency headers carrying the exact cost of that request in your billing currency. Streaming responses emit the same values in the final trailer event. See Response Headers and Streaming Events.