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、audio/image 维度等。

billing.line_itemsobject[]

计费明细。

routingobjectnullable

仅返回公开状态和耗时,不暴露内部路由决策及供应商身份。

Cache 字段

OpenAI-compatible 响应里,cache read 可能出现在

usage.prompt_tokens_details.cached_tokens 或 usage.input_tokens_details.cached_tokens。

cache write 只有在上游返回时才会出现,字段可能是

cache_write_tokens、cache_write_5m_tokens 或 cache_write_1h_tokens。

如果要对账或排查费用,以请求详情 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。