> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arouter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 생성 기록 조회

> 완료된 특정 생성의 비용, 토큰 사용량 및 메타데이터를 조회합니다.

ID로 완료된 생성의 상세 메타데이터를 조회합니다. 이 엔드포인트를 사용하여 과거 요청의 비용과 사용량을 확인할 수 있습니다.

## 엔드포인트

```
GET /api/v1/generation
```

## 쿼리 파라미터

| 파라미터 | 타입       | 필수 | 설명                            |
| ---- | -------- | -- | ----------------------------- |
| `id` | `string` | 예  | 채팅 완성 응답의 `id` 필드에서 가져온 생성 ID |

## 요청 예시

```bash theme={null}
curl "https://api.arouter.ai/api/v1/generation?id=gen-1775226820-719aea642d4b4d279c897793" \
  -H "Authorization: Bearer lr_live_xxxx"
```

## 응답 예시

```json theme={null}
{
  "id": "gen-1775226820-719aea642d4b4d279c897793",
  "model": "anthropic/claude-sonnet-4.6",
  "provider": "Google",
  "created_at": "2026-04-03T12:00:00Z",
  "latency_ms": 1240,
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 6,
    "total_tokens": 20,
    "cost": 0.000132,
    "is_byok": false,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "cost_details": {
      "upstream_inference_cost": 0.000132,
      "upstream_inference_prompt_cost": 0.0000420,
      "upstream_inference_completions_cost": 0.000090
    }
  }
}
```

## 응답 필드

| 필드                        | 타입        | 설명               |
| ------------------------- | --------- | ---------------- |
| `id`                      | `string`  | 생성 ID            |
| `model`                   | `string`  | 응답을 생성한 모델       |
| `provider`                | `string`  | 요청을 처리한 프로바이더    |
| `created_at`              | `string`  | ISO 8601 타임스탬프   |
| `latency_ms`              | `integer` | 요청 총 지연 시간 (밀리초) |
| `usage.prompt_tokens`     | `integer` | 입력 토큰 수          |
| `usage.completion_tokens` | `integer` | 출력 토큰 수          |
| `usage.total_tokens`      | `integer` | 총 토큰 수           |
| `usage.cost`              | `number`  | 총 비용 (USD)       |
| `usage.is_byok`           | `boolean` | 사용자 제공 key 사용 여부 |

## 참고 사항

* 생성 메타데이터는 일반적으로 요청 완료 후 몇 초 이내에 사용 가능합니다
* 생성 ID는 모든 채팅 완성 응답의 `id` 필드에서 반환됩니다
* 이력 데이터는 90일 동안 보관됩니다
