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
GEThttps://api.lazu.ai/api/usage/requests/{request_id}

請求詳情

查詢已完成請求的客戶憑據,包含標準化用量維度、計費明細和公開耗時。

計費唯讀查詢介面,不是模型生成請求。 價格與線路 ↗

路徑參數

request_idstringrequired

同一把 API Key 發起的請求 ID。Lazu 不允許讀取其它 key 的請求詳情。

響應欄位

idstring

請求 ID。

modelstring

使用者請求的模型或 route 名稱。

usage.measurementobjectnullable

分別表示輸入和輸出用量來源:provider(上游回報)、local_estimate(本地估算)、unavailable(無法確定)。歷史或未分類記錄可能沒有此欄位,缺省不能視為上游實測。

usage.dimensionsobject[]

標準化 usage 維度,例如 input、output、 cache_read、cache_write_5m、 cache_write_1h、cache_miss。

billing.line_itemsobject[]

計費明細。

routingobjectnullable

僅返回公開狀態和耗時,不暴露內部路由決策及供應商身分。

Cache 欄位

OpenAI-compatible 響應裡,cache read 可能出現在

usage.prompt_tokens_details.cached_tokens 或 usage.input_tokens_details.cached_tokens。cache write 只有在上游返回時才會出現。

如果要對帳或排查費用,以請求詳情 API 為準。

相關頁面

RequestGET /api/usage/requests/{request_id}
curl https://api.lazu.ai/api/usage/requests/req_lazu_01ABCDEF \
  -H "Authorization: Bearer $LAZU_API_KEY"
ResponseExample
{
  "object": "usage.request",
  "id": "req_lazu_01ABCDEF",
  "created_at": 1765980000,
  "model": "gpt-6-luna",
  "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": {
    "status_code": 200,
    "total_duration_ms": 1840,
    "ttft_ms": 420,
    "was_streaming": true
  },
  "provider_usage": {
    "family": "openai",
    "raw_fields": { "prompt_tokens": 1200, "completion_tokens": 300 }
  },
  "log_id": "log_01ABCDEF"
}
請求回執

計費請求完成後,使用網關請求 ID 查詢用量維度、計費明細與耗時。

查看真實請求回執 →

request_id 來源

使用響應標頭 X-Lazu-Request-Id、錯誤響應裡的request_id,或 gateway response request ID。