分页查询当前 API Key 的原子能力计量明细
GET/open/v1/usage/recordsscope: viewUsage
只返回当前 API Key 自身的脱敏用量;可按时间、能力、Job 或 client_request_id 过滤。
请求
参数
| 名称 | 位置 | 类型 | 约束 | 说明 |
|---|---|---|---|---|
| from | 查询串 | string(date-time) | 起始时间(包含)。 | |
| to | 查询串 | string(date-time) | 结束时间(不包含)。 | |
| capability | 查询串 | string | 长度≤128 | |
| job_id | 查询串 | string | 正则 ^[a-f0-9]{32}$ | |
| client_request_id | 查询串 | string | 长度≥1;长度≤128;正则 ^[A-Za-z0-9._:-]+$ | 调用方生成的幂等请求标识;相同调用方重试时保持不变。 |
| page | 查询串 | integer | 默认 1;≥1;≤1000000 | |
| size | 查询串 | integer | 默认 20;≥1;≤100 |
响应
200请求已成功处理
展开 data 结构(57 个字段)
| 字段 | 类型 | 约束 | 说明 |
|---|---|---|---|
| data | object | 不接受额外字段 | |
| items必填 | array<object> | ||
| [ ] | object | 不接受额外字段 | |
| capability必填 | string | ||
| request_id必填 | string | ||
| job_id必填 | string | null | 正则 ^[a-f0-9]{32}$ | |
| client_request_id必填 | string | null | 正则 ^[A-Za-z0-9._:-]{1,128}$ | |
| result_status必填 | string | ||
| created_at必填 | string(date-time) | ||
| updated_at必填 | string(date-time) | ||
| metering必填 | object | 不接受额外字段 | |
| 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 | |
| total必填 | integer | ≥0 | |
| page必填 | integer | ≥1 | |
| size必填 | integer | ≥1;≤100 |
错误状态
| HTTP | 含义 |
|---|---|
| 400 | 请求参数无效 |
| 401 | API Key 无效 |
| 403 | API Key 无权限 |
| 500 | 服务内部异常 |
| 502 | 上游服务异常 |
| 503 | 能力暂不可用 |
| 504 | 上游服务超时 |