---
title: "使用日志"
method: GET
path: "/v1/console/usage/logs"
tags: ["UsageService"]
---

# 使用日志

`GET /v1/console/usage/logs`

查询当前用户的 API 调用日志。默认最近 24 小时，显式时间范围最多 90 天；使用 createdAt/id 不透明游标分页，raw 日志不执行 COUNT(*)，响应 total 固定为 -1。

## Query parameters

- `limit` integer
- `cursor` string
- `search` string
- `status` 'all' | 'success' | 'error'
- `modelId` string, int64
- `channelId` string, int64
- `startTime` string, date-time
- `endTime` string, date-time
- `apiKeyId` string, int64
- `modelName` string
- `apiKeyName` string

## Response `200`

游标分页结果；通过 hasMore/nextCursor 翻页，total 固定为 -1。

- UsageV1ListLogsReply
  - `hasMore` boolean
  - `items` UsageV1UsageLogEntry[]
    - `apiKeyId` string
    - `billedMicros` string
    - `cachedTokens` string
    - `channelId` string
    - `clientRequestId` string — 网关层 request id 原文（响应头 X-Request-Id 同值）；与异步任务详情展示的请求 ID 对齐。 空串=历史行或未采集，前端回退展示 request_id。
    - `completionTokens` string
    - `createdAt` string, date-time
    - `currency` string
    - `endpoint` string
    - `errorCode` string
    - `firstTokenMs` string — 首 token 延迟（毫秒），来自 usage_logs.first_token_ms；非流式、未采集或历史缺失为 0。
    - `httpStatus` integer
    - `id` string
    - `ip` string — 请求元信息
    - `isStream` boolean
    - `latencyMs` string — 性能指标
    - `meta` string — Deprecated: 用户端列表和详情均不再返回内部 meta 及请求/响应正文。
    - `modelId` string
    - `modelName` string
    - `promptTokens` string — Token 使用情况
    - `requestId` string
    - `requestType` string
    - `subscriptionPreId` string
    - `success` boolean — success 行级成败结论，与列表 status 筛选同一谓词（WP7 双列回退口径）在服务端计算。 前端徽标请直接用本字段；http_status 在迁移历史行上可能为 0，不可用于本地推断成败。
    - `teamId` string
    - `totalTokens` string
    - `unitsConsumed` string — 计费信息
    - `userId` string
    - `walletHoldId` string — 关联记录
    - `walletLedgerId` string
  - `limit` integer
  - `nextCursor` string
  - `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)
