Analyze call usage¶
Review the current user’s call counts, token usage, and costs, then analyze consumption over time or by model and credential. This task covers call statistics, not account balances or monthly statements.
Prerequisites¶
Prepare a personal access token and determine the time range and calls to analyze. For authentication and query scope, see Usage and monitoring.
Call sequence¶
Query the usage summary to inspect call counts, token usage, costs, and success rate for the selected scope.
To observe changes, query usage trends with the same filters and check the actual time range returned.
To identify sources of consumption, group usage by model or calling credential. Keep filters unchanged when retrieving subsequent pages.
To inspect individual calls, continue to Query and investigate request logs and narrow the list using the same time range and call scope.
API operations¶
Task |
API operation |
When to use it or what to confirm |
|---|---|---|
Inspect overall usage |
Obtain call counts, token usage, costs, and success rate for the selected scope. |
|
Inspect changes over time |
Review hourly or daily call statistics. |
|
Identify consumption sources |
Review statistics grouped by user, model, or calling credential. |
Confirm the result¶
Before comparing summaries, trends, and groups, confirm matching filters and actual time ranges, and retrieve all grouped-result pages. The trend query can shorten the time range; do not compare that shortened result directly with a summary for the original range.
Limitations and notes¶
Queries are limited to calls accessible to the current user. Grouping by user does not expand access.
Trends return only time buckets containing data; empty buckets are not filled automatically.
Grouping by calling credential includes personal access tokens, service account keys, and TaaS local keys. It is not the local key list.