엔드포인트
쿼리 파라미터
요청 예시
응답 예시
응답 필드
참고 사항
- 생성 메타데이터는 일반적으로 요청 완료 후 몇 초 이내에 사용 가능합니다
- 생성 ID는 모든 채팅 완성 응답의
id필드에서 반환됩니다 - 이력 데이터는 90일 동안 보관됩니다
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
완료된 특정 생성의 비용, 토큰 사용량 및 메타데이터를 조회합니다.
GET /api/v1/generation
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
id | string | 예 | 채팅 완성 응답의 id 필드에서 가져온 생성 ID |
curl "https://api.arouter.ai/api/v1/generation?id=gen-1775226820-719aea642d4b4d279c897793" \
-H "Authorization: Bearer lr_live_xxxx"
{
"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 필드에서 반환됩니다