帳戶
取得用量摘要
回傳指定區間的花費/請求數/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"回應範例