Skip to content

AI cost + call-volume dashboard

GET
/admin/ai/usage

Per-provider month-to-date rollup of AI provider calls. Each row reports successful call count, total estimated cost in USD micros (integer math; convert to dollars by dividing by 1_000_000), and a per-status breakdown so the operator can spot providers that are mostly rate-limited or permanently failing.

Requires ai.admin capability.

billing_period
string
/^\d{4}-\d{2}$/

YYYY-MM string for the period to summarise. Defaults to the current UTC month if omitted.

Usage rollup

object
billing_period
required

YYYY-MM the report covers.

string
total_cost_usd_micros
required

Sum across all providers. Divide by 1_000_000 for USD.

integer format: int64
providers
required
Array<object>
object
provider
required
string
call_count
required
integer format: int64
cost_usd_micros
required
integer format: int64
status_counts
required

Per-status row count (success / rate_limited / transient_error / permanent_error / budget_blocked / privacy_blocked) so the operator can spot providers that are mostly failing.

object
key
additional properties
integer format: int64

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Authenticated but missing required capabilities

object
error
required

Human-readable error summary

string
Example
the request could not be completed