Analyze rated usage and costs

Query rated usage records and summaries, analyze costs over time and by business dimension, and inspect AI service usage. This task concerns billing results, not individual model request logs.

Prerequisites

Prepare a valid personal access token for the user who owns the billing account. Follow Query accounts and billing settings to obtain the target account ID. For service URLs and authentication, see Service URLs and authentication.

Call sequence

  1. Choose the time range and filters, then get a rated usage summary to inspect usage and charges.

  2. To investigate cost changes, get cost trends using the required time granularity and grouping dimension.

  3. To inspect individual records, list rated usage records with the relevant filters. Retain the posting period from an existing record for later bill line-item queries.

  4. To inspect AI service consumption by service slot or billing scenario, query AI service usage separately.

API operations

Task

API operation

When to use or what to verify

Summarize usage and charges

Get rated usage summary

Inspect results aggregated by time granularity.

Analyze cost changes

Get cost trends

Compare costs over time and by the selected dimension.

Inspect rated records

List rated usage records

Inspect record status, charges, and posting periods.

Inspect AI service consumption

List AI service usage

Filter by service slot, billing scenario, and other conditions.

Confirm the result

Before comparing results, check that the account, time range, status filters, and grouping criteria match. To inspect individual charges, list rated usage records and follow that action’s pagination indicator for additional records.

Limitations and notes

Rated usage summaries and cost trends are not restricted to charged records unless a status filter is supplied. Credit charges and payment-currency amounts use different units; preserve decimal precision. AI service usage and ordinary rated records return different pagination indicators; follow each action’s rules.

Next steps

Last updated on