Generations
Retrieves detailed usage and performance metrics for a past generation request. Returns cost breakdown, model/provider info, token counts, latency, throughput, and BYOK status.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
The generation ID returned in the API response. Can be chat_id, request_id, or similar ID field from any FastRouter API endpoint response.
transaction_idGeneration details retrieved successfully
Generation ID (same as requested)
transaction_idModel used for this generation in provider/model format
openai/gpt-3.5-turboProvider that processed the request
openaiHashed API key used for the request (for auditing)
API-KEY-HASHTotal credits consumed by this request
0.000609ISO 8601 timestamp of when the request was made
2025-05-06T13:51:02.889ZAverage response time in minutes per transaction
0.03524546428333333Average tokens processed per nanosecond (throughput metric)
1.5866666666666667Number of tokens in the input/prompt
14Number of tokens in the generated output/completion
105Whether this request used Bring Your Own Key (BYOK). True if customer's own API key was used.
falseAPI endpoint used for the request
/v1/chat/completionsUnix timestamp of request creation
Full request body that was sent (if available)
Full response body that was returned (if available)
Additional metadata about the request
Bad Request - Invalid generation ID format
Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.
Note: the 401 error body uses code, message, param, and type (there is no status field), and type is invalid_request_error.
Not Found - Generation ID not found or expired
Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.
Internal Server Error
POST /api/v1/generation HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 34
{
"generation_id": "transaction_id"
}{
"id": "transaction_id",
"model": "openai/gpt-3.5-turbo",
"provider_name": "openai",
"api_key": "API-KEY-HASH",
"credits_used": 0.000609,
"query_time": "2025-05-06T13:51:02.889Z",
"avg_response_time_minutes_per_transaction": 0.03524546428333333,
"avg_tokens_per_nano": 1.5866666666666667,
"input_token_size": 14,
"output_token_size": 105,
"is_byok": false
}Last updated
