账户
获取用量摘要
返回指定区间的花费/请求数/token 统计,并依模型、依 API 密钥、依应用程序(app_name)三种维度拆分,外加逐日时间序列。与 /v1/insights 不同,这条没有前三名模型、缓存统计或年度热力图——是较轻量的加总端点,支持自定义日期区间(period=custom)。
GET
/api/v1/usage验证
Authorization必填string · header
在 Authorization 标头以 Bearer token 传入 API 密钥。
查询参数
periodstring
统计区间,默认 month。三种形式:旧制日历词(day/week/month/year)、以现在为终点的滚动窗口(15m…1y)、对齐日历的区间(today…prev_year),或 custom(需搭配 from/to)。无效值返回 400。
dayweekmonthyear15m30m1h3h1d2d1w1mo1ytodayyesterdaythis_weekprev_weekthis_monthprev_monththis_yearprev_yearcustomExample:
"month"fromstring
自定义区间的起点(ISO 8601)。只在 period=custom 时使用。
ISO 8601, required with period=custom
Example:
"2026-07-01T00:00:00.000Z"tostring
自定义区间的终点(ISO 8601)。只在 period=custom 时使用。
ISO 8601, required with period=custom
Example:
"2026-07-27T00:00:00.000Z"响应示例