Skip to main content
Fetch usage/cost stats for a completed request by its id (the id returned in a chat completion). Useful for auditing or fetching cost asynchronously. Free. Mirrors OpenRouter’s generation endpoint.
string
required
The generation id from a prior chat completion response.
Cost: Free.
Stats are populated by OpenRouter after a generation finishes accounting, so a lookup immediately after a completion may briefly return provider_error (404) until the record is available. For real-time cost you don’t need this endpoint — every chat completion already returns usage.cost (and Naive credits_used) inline.