Get generation metadata
/v1/generationGet request, provider, usage, timing, token, and cost metadata for a generation. This endpoint works across recorded model requests, including text, vision, image, video, audio, and other generation types when metadata is available.
Use X-Trace-ID from the original model response headers as the generation lookup ID. If X-Trace-ID and X-Request-ID differ, this endpoint uses X-Trace-ID. Do not use the response body id such as chatcmpl_....
Authentication
Authorization Bearer
API key as bearer token in Authorization header.
Query Parameters
idstringrequiredX-Trace-ID from the original model response. If X-Trace-ID and X-Request-ID differ, use X-Trace-ID, not the response body id.
Response
dataobjectGeneration metadata.
data.idstringGeneration or request ID.
data.request_idstring | nullRequest correlation ID when available.
data.api_typestring | nullAPI family used by the generation, such as completions, image, video, tts, or stt.
data.modelstring | nullModel used for the generation.
data.model_typestring | nullInternal model category, such as llm, image, video, or audio.
data.statusstring | nullRecorded generation status, such as completed, failed, cancelled, or processing.
data.created_atstring | nullISO 8601 creation timestamp.
data.updated_atstring | nullISO 8601 update timestamp.
data.generation_timenumber | nullGeneration time in milliseconds when known.
data.latencynumber | nullEnd-to-end request latency in milliseconds when known.
data.provider_idstring | number | nullRoute ID used for the request.
data.provider_request_idstring | nullUpstream request or response identifier.
data.tokens_promptinteger | nullPrompt token count when available.
data.tokens_completioninteger | nullCompletion token count when available.
data.total_costnumber | nullTotal recorded generation cost in USD.
data.usagenumber | nullUsage amount in USD.
data.streamedboolean | nullWhether the original response was streamed.
data.cancelledboolean | nullWhether the generation was cancelled.
data.finish_reasonstring | nullReason the generation finished when reported.
Errors
- 400: Missing required
idquery parameter. - 401: Missing or invalid
Authorization. - 404: Generation not found, or it is not accessible with the authenticated API key.