Get Generation
Fetch generation metadata by request ID.
GET/v1/generation
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Required | Request ID from a prior completion. |
Request Example
bash
curl "https://api.therouter.ai/v1/generation?id=req_abc123"
-H "Authorization: Bearer $THEROUTER_API_KEY"Response
json
{
"data": {
"id": "req_abc123",
"model": "openai/gpt-4o-mini",
"provider_name": "openai-api",
"created_at": "2026-02-26T09:10:00.000Z",
"tokens_prompt": 11,
"tokens_completion": 67,
"latency": 482,
"finish_reason": "stop",
"total_cost": 0,
"streamed": null,
"cancelled": null,
"generation_time": 482,
"usage": 0,
"native_tokens_prompt": null,
"native_tokens_completion": null
}
}