跳到导航

Getusagetimeseries

以 Markdown 格式查看

Time series for one metric; buckets are days or hours.

Required: metric. Optional: granularity (day default, or hour), plus date window (see query params).

Constraint: granularity=hour does not support success_rate or latency → HTTP 400 / 40010.

Success data: { "granularity", "metric", "window", "points": [{ "bucket", "value" }] }

身份验证

AuthorizationBearer
Bearer credential containing a JWT, Virtual Key, or PAT.

请求头

X-Workspace-Idstring可选格式: "uuid"

Required for a normal JWT, Virtual Key, or PAT. A JWT may instead send X-Openmodel-User-Id. Not used by the public health endpoint.

X-Openmodel-User-Idstring可选格式: "uuid"

JWT-only alternative to X-Workspace-Id. Must be a UUID equal to the JWT subject; the server uses it as the workspace id. Not valid as the sole workspace header for Virtual Key or PAT authentication.

查询参数

metricenum必需

One of cost, requests, tokens, avg_cost_per_req, success_rate, latency.

granularitystring可选默认为 day

hour selects hourly buckets; omitted or any other value selects day.

presetenum可选默认为 30d

Same allowed values as usage summary; default 30d when no explicit start and end.

startstring可选

YYYY-MM-DD, paired with end.

endstring可选

YYYY-MM-DD, paired with start.

响应

codeinteger
messagestring
dataany