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

엔드포인트

GET /api/v1/generation

쿼리 파라미터

파라미터타입필수설명
idstring채팅 완성 응답의 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
    }
  }
}

응답 필드

필드타입설명
idstring생성 ID
modelstring응답을 생성한 모델
providerstring요청을 처리한 프로바이더
created_atstringISO 8601 타임스탬프
latency_msinteger요청 총 지연 시간 (밀리초)
usage.prompt_tokensinteger입력 토큰 수
usage.completion_tokensinteger출력 토큰 수
usage.total_tokensinteger총 토큰 수
usage.costnumber총 비용 (USD)
usage.is_byokboolean사용자 제공 key 사용 여부

참고 사항

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