Get a generation
One finished request's record and cost, by its generation ID: the X-Generation-Id an image or audio answer carries, or for any request gen- and the 32 hex digits of its x-request-id, which is request- and the same digits. It reads any finished request of your key's organization. total_cost and usage are what you were charged in US dollars; api_type is completions (Chat Completions, Responses and Messages), embeddings, image, stt or tts. Never cached.
curl https://api.llm.buzz/api/v1/generation \
-H "Authorization: Bearer $LLM_BUZZ_KEY"{
"data": {
"id": "gen-...",
"model": "hexgrad/kokoro-82m",
"api_type": "tts",
"provider_name": "DeepInfra",
"total_cost": 0.00002277,
"is_byok": false,
"upstream_inference_cost": null
}
}{
"error": {
"code": 401,
"message": "A valid gateway Bearer key is required. Send the virtual key as 'Authorization: Bearer <key>'.",
"metadata": {
"error_type": "authentication",
"gateway_code": "invalid_key"
}
}
}Authorization
An inference key, as Authorization: Bearer KEY.
Parameters
idstringqueryrequiredThe generation ID, such as
gen-and 32 hex digits.
Response 200
OpenRouter's GenerationResponse, as {"data": ...}, with model, provider_name, latency and generation_time in milliseconds, and data_region (europe for a provider in the EU, else global).
Errors
400No
id(invalid_parameteronid).401No key, or the key is unknown, expired, revoked or disabled.
404Another organization's ID, a malformed one, or one whose request has not finished.