Retrieve detailed metadata for a completed generation by its ID. Use this endpoint to check cost and usage for any past request.Documentation Index
Fetch the complete documentation index at: https://docs.arouter.ai/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Generation ID from the id field of a chat completion response |
Example Request
Example Response
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Generation ID |
model | string | Model that generated the response |
provider | string | Provider that served the request |
created_at | string | ISO 8601 timestamp |
latency_ms | integer | Total request latency in milliseconds |
usage.prompt_tokens | integer | Input tokens |
usage.completion_tokens | integer | Output tokens |
usage.total_tokens | integer | Total tokens |
usage.cost | number | Total cost in USD |
usage.is_byok | boolean | Whether a user-provided key was used |
Notes
- Generation metadata is typically available within a few seconds of the request completing
- Generation IDs are returned in the
idfield of every chat completion response - Historical data is retained for 90 days