Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
エンドポイント / Usage
GET/api/usage/requests/{request_id}

リクエスト詳細

課金読み取り専用 API。モデル生成リクエストではありません。 料金とレーン

完了したリクエストの使用量、請求明細、公開タイミングを確認します。

Path parameters

パラメーター説明
request_id
string
required

同じ API Key が発行した request ID。別 key の request details は読めません。

Response fields

パラメーター説明
id
string

requested request ID。

model
string

requested model または route name。

usage.measurement
object
nullable

入力と出力それぞれの根拠です。provider は報告値、local_estimate はローカル推計、unavailable は不明です。過去の記録などでは省略されます。省略を実測値の証拠と解釈しないでください。

usage.dimensions
object[]

normalized dimensions。例:inputoutputcache_readcache_write_5mcache_miss

billing.line_items
object[]

price、quantity、total charge を含む billable usage lines。

routing
object
nullable

公開ステータスとタイミングのみ。内部ルーティング判断やプロバイダーの識別情報は公開しません。

Cache field guidance

OpenAI-compatible responses では cache read が

usage.prompt_tokens_details.cached_tokens または usage.input_tokens_details.cached_tokens に出る場合があります。 billing と reconciliation では、この endpoint がより完全な source です。

See also

CodePOST https://api.lazu.ai
curl https://api.lazu.ai/api/usage/requests/req_lazu_01ABCDEF \
-H "Authorization: Bearer $LAZU_API_KEY"
リクエスト明細

課金リクエストの完了後、ゲートウェイのリクエスト ID で使用量、課金項目、所要時間を確認できます。

実際のリクエスト明細を見る
RESPONSE · 200
{
"object": "usage.request",
"id": "req_lazu_01ABCDEF",
"created_at": 1765980000,
"model": "gpt-4o-mini",
"endpoint": "/v1/chat/completions",
"usage": {
"prompt_tokens": 1200,
"completion_tokens": 300,
"total_tokens": 1500,
"dimensions": [
{ "name": "input", "quantity": 1200, "unit": "token" },
{ "name": "cache_read", "quantity": 300, "unit": "token" },
{ "name": "output", "quantity": 300, "unit": "token" }
]
},
"billing": {
"currency": "USD",
"amount_microusd": 480,
"pricing_version": 3,
"line_items": [
{
"dimension": "input",
"quantity": 1200,
"unit_microusd": 150,
"amount_microusd": 180
}
]
},
"routing": {
"strategy_name": "default",
"requested_model": "gpt-4o-mini",
"resolved_model": "gpt-4o-mini",
"chose_provider": "openai",
"status_code": 200
},
"provider_usage": {
"family": "openai",
"raw_fields": { "prompt_tokens": 1200, "completion_tokens": 300 }
},
"log_id": "log_01ABCDEF"
}
ERROR · 429
{
"error": {
"type": "rate_limit_exceeded",
"message": "Per-key limit reached. Retry after 12s.",
"request_id": "req_01ABCDEF"
}
}

request_id の取得元

X-Lazu-Request-Id、error payload のrequest_id、または gateway response request ID。

Calls api.lazu.ai directly. The key stays in this browser.