开发文档 · 计量与用量
计量与用量
随响应返回的模型 / OCR 计量与用量查询。
随响应返回的计量
每次调用的模型与 OCR 消耗随信封的 metering 字段返回;异步任务在读取结果时返回完整计量。
| 字段 | 类型 | 约束 | 说明 |
|---|---|---|---|
| status必填 | string | 枚举 "pending" / "reported" / "partial" / "unavailable" / "not_applicable" | |
| job_id | string | null | 正则 ^[a-f0-9]{32}$ | |
| metered_request_id | string | null | ||
| document_page_count | integer | null | ≥0 | |
| models必填 | array<object> | ||
| [ ] | object | 不接受额外字段 | |
| provider必填 | string | null | ||
| model_type必填 | string | 枚举 "chat" / "embedding" / "rerank" / "vision" | |
| model_id必填 | string | null | ||
| model_id_source必填 | string | 枚举 "provider" / "configured" / "unavailable" | |
| input_tokens必填 | integer | null | ≥0 | |
| output_tokens必填 | integer | null | ≥0 | |
| call_count必填 | integer | ≥1 | |
| duration_ms必填 | integer | null | ≥0 | |
| usage_status必填 | string | 枚举 "reported" / "partial" / "unavailable" | |
| ocr必填 | array<object> | ||
| [ ] | object | 不接受额外字段 | |
| provider必填 | string | ||
| service必填 | string | ||
| page_count必填 | integer | null | ≥0 | |
| call_count必填 | integer | ≥1 | |
| cache_hit_count必填 | integer | ≥0 | |
| duration_ms必填 | integer | null | ≥0 | |
| usage_status必填 | string | 枚举 "reported" / "partial" / "unavailable" | |
| audio | array<object> | ||
| [ ] | object | 不接受额外字段 | |
| provider必填 | string | ||
| model_id必填 | string | ||
| call_count必填 | integer | ≥1 | |
| unknown_call_count必填 | integer | ≥0 | |
| audio_duration_seconds必填 | integer | null | ≥0 | |
| input_tokens必填 | integer | null | ≥0 | |
| output_tokens必填 | integer | null | ≥0 | |
| usage_status必填 | string | 枚举 "reported" / "partial" / "unavailable" | |
| image_generation | object | 不接受额外字段 | |
| attempt_count必填 | integer | ≥1 | |
| unknown_result_count必填 | integer | ≥0 | |
| image_count必填 | integer | null | ≥0 | |
| usage_status必填 | string | 枚举 "reported" / "partial" / "unavailable" | |
| timing必填 | object | 不接受额外字段 | |
| gateway_ms必填 | integer | null | ≥0 | |
| execution_ms必填 | integer | null | ≥0 | |
| total_ms必填 | integer | null | ≥0 |
用量查询接口
- listUsageRecords — 分页查询当前 API Key 的原子能力计量明细
- summarizeUsage — 按时间或任务汇总当前 API Key 用量
支持按时间段、能力、job_id 或 client_request_id 过滤,用于对账与成本分摊。