---
title: "查询模型调用日志"
method: GET
path: "/v1/admin/monitor/usage-logs"
tags: ["AdminMonitorService"]
---

# 查询模型调用日志

`GET /v1/admin/monitor/usage-logs`

查询模型/API 调用日志。用于“日志管理-调用日志”页面，返回用户、模型、通道、状态、Token、计费和延迟等字段。接口使用游标分页，不返回 total。时间范围默认最近 24 小时，显式范围最多 90 天；requestId 查询也必须受时间范围约束以裁剪月度分区。

## Query parameters

- `requestId` string
- `userId` string
- `modelId` string
- `channelId` string
- `status` 0 | 1 | 2
- `from` string
- `to` string
- `cursor` string
- `size` integer

## Response `200`

模型调用日志列表，包含 items、hasMore 和 nextCursor。

- AdminV1ListUsageLogsReply
  - `hasMore` boolean
  - `items` AdminV1UsageLogEntry[]
    - `apiKeyId` string — api_key_id 令牌（API Key）ID；用于关联令牌名称。
    - `basePriceMicros` string — base_price_micros 结算时从原始有理数 gross 单次 ceil 得到的价目表基础金额（CRD micros）。 缺失表示历史行或无可靠定价事实；客户端必须展示未知，不能从 billed_micros 反推。
    - `billedMicros` string
    - `cachedTokens` string — cached_tokens 缓存命中 token 数；当前写入链路可能恒为 0，前端按 0 隐藏。
    - `channelCostMicros` string — channel_cost_micros 结算时从同一原始 gross 乘钉值成本倍率后单次 ceil 的渠道成本（CRD micros）。 缺失表示无成本倍率快照；不能从 billed_micros 或 base_price_micros 派生。
    - `channelCostRatio` string — channel_cost_ratio 渠道成本倍率钉值（decimal 字符串，如 "0.8500"）；空串=无快照。
    - `channelDiscount` string — Deprecated: use channel_cost_ratio. Historical name retained for old clients.
    - `channelId` string
    - `channelName` string
    - `channelSaleRatio` string — channel_sale_ratio 销售倍率快照（decimal 字符串如 "1.2000"）；空串=无快照。PR2 阶段仅观察值，PR3 起为计费实际用值。
    - `channelSourceCode` string — channel_source_code 命中渠道资源 code 快照；空串=未绑定资源 / 钉值缺失。
    - `clientRequestId` string — 网关层 request id 原文（响应头 X-Request-Id 同值）；与异步任务详情展示的请求 ID 对齐。 空串=历史行或未采集，前端回退展示 request_id。
    - `completionTokens` string
    - `createdAt` string, date-time
    - `currency` string
    - `discountedBilledMicros` string — Deprecated: use channel_cost_micros. When the persisted audit amount is unavailable, this compatibility field falls back to billed_micros and must not be used for audit.
    - `endpoint` string
    - `errorCode` string
    - `firstTokenMs` string — first_token_ms 首字输出耗时（毫秒），来自 usage_logs.first_token_ms；非流式、未采集或历史缺失为 0。
    - `httpStatus` integer
    - `id` string
    - `ip` string
    - `isStream` boolean
    - `latencyMs` string
    - `modelId` string
    - `modelName` string
    - `promptTokens` string
    - `requestId` string
    - `requestType` string — request_type 请求类型/协议（如 openai_chat、anthropic_messages），用于展示输出协议与流式判定无关的请求形态。
    - `success` boolean — success 行级成败结论，与列表 status 筛选同一谓词（WP7 双列回退口径）在服务端计算。 前端徽标请直接用本字段；http_status 在迁移历史行上可能为 0，不可用于本地推断成败。
    - `tokenName` string — token_name 令牌名称，来自 api_keys.name 富化关联。
    - `totalTokens` string
    - `userEmail` string
    - `userId` string
    - `userName` string
    - `vendorId` string
    - `vendorName` string
    - `vendorSlug` string
  - `nextCursor` string
  - `size` integer
  - `total` string — total 为 -1，表示 raw usage 日志列表不执行 COUNT(*)；客户端通过 has_more/next_cursor 翻页，聚合总量由监控看板 rollup 接口提供。

---

[API](https://skmtc.dev/apiqik/apis/apiqik-api.md) · [All operations](https://skmtc.dev/apiqik/apis/apiqik-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/apiqik/apiqik-api/revisions/e06b96127408/schema)
