# Get a generation

`GET https://api.llm.buzz/api/v1/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.

Authentication: an inference key, as `Authorization: Bearer KEY`.

## Parameters

- `id` (query string, required): The generation ID, such as `gen-` and 32 hex digits.

## Responses

- 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`).
- 400: No `id` (`invalid_parameter` on `id`).
- 401: No key, or the key is unknown, expired, revoked or disabled.
- 404: Another organization's ID, a malformed one, or one whose request has not finished.

## Example (curl)

```bash
curl https://api.llm.buzz/api/v1/generation \
  -H "Authorization: Bearer $LLM_BUZZ_KEY"
```

## Example response

```json
{
  "data": {
    "id": "gen-...",
    "model": "hexgrad/kokoro-82m",
    "api_type": "tts",
    "provider_name": "DeepInfra",
    "total_cost": 0.00002277,
    "is_byok": false,
    "upstream_inference_cost": null
  }
}
```
