cURL
Query dimensions
dimension supports only lowercase workspace and agent; session is not supported. For workspace, do not pass agent filter parameters; passing them returns HTTP 400 / invalid_parameter. For agent, agent_id must be a non-empty single value. For time formats, granularity selection, and range alignment rules, see Query usage summary.
Pagination
Pass the next_page_token returned by the previous page unchanged as page_token. Keep the same Alibaba Cloud account, workspace, dimension, agent, version, original start and end times, actual granularity, and page_size. Start and end times are compared as the same absolute instant, so equivalent time zone notations can be interchanged; even if the aligned query_range is the same, the original time boundaries cannot be changed.
- Each token is valid for 15 minutes from creation and can be retried within that period; retrying the same token does not extend its validity. An expired token returns HTTP 410 /
page_token_expired; removepage_tokenand query the first page again. - Pagination is by complete period, and
page_sizelimits only the number of periods. Model and tool details within a period are returned together; the combined model and tool detail items across all periods on the page are limited to 100,000, and the summarytotaldoes not count toward this limit. - Only periods with summary records are returned; missing periods are not filled automatically. A period is still returned when its recorded metrics are
0ornull. - If the first query has no records,
points=[],has_more=false, andnext_page_token=nullare returned, while the actualquery_rangeandgranularityare still included. - Statistics may continue to update during pagination, and a token does not lock a data snapshot. The next page starts after the last period of the previous page; data added later to periods that have already been paged through is not returned again on subsequent pages. To refresh, query from the first page again; results may still be briefly cached.
data.query_range is the actual aligned range for the entire query and is the same on every page; it is not the start and end of the current page. data_updated_at is the latest known update time among the usage records returned on the current page and may differ between pages. For the usage object structure and empty result rules, see Query usage summary; for error codes, see Query Usage Summary.Authorizations
string
header
required
DashScope API Key
Body
application/jsonenum<string>
required
取值仅为小写 workspace、agent,区分大小写。不支持 session
workspace,agent
object
required
查询时间范围。时间范围按 UTC+8 对齐
string
dimension=agent 时必填,指定一个 Agent;workspace 维度不传。必须为非空单值
string | null
仅 dimension=agent 可用。不传或为 null 时合并全部版本;不能是空字符串或纯空白,按原始字符串精确匹配,不自动去除首尾空格
enum<string>
hour、day 或 month;不传时自动选择,不接受显式 null
hour,day,month
integer
default100
每页最多返回的时间段数量,取值 1~100,默认 100;不接受显式 null
1 <= x <= 100
string
首次查询不传。续页原样传入上一页的 next_page_token,不解析或自行拼接;不接受显式 null、空字符串、纯空白或无效游标。游标自生成起有效期为 15 分钟,失效后返回 HTTP 410 / page_token_expired