Usage & Cost (v1)
Read AI Gateway request counts, token counts, and estimated cost, grouped by model, over the public /v1 Management API.
Usage & cost
Returns aggregated AI Gateway usage — request counts, input/output token counts, and estimated USD cost — broken down by provider and model, with tenant-wide totals. See the control-plane overview for authentication and the response envelope — the examples below authenticate with$TOKEN, a short-lived OAuth 2.1 access token minted there.
Get usage
read capability on ai_gateway.
Query parameters
cost_usd is an estimate derived from KnoxCall’s model price table. When unpriced_requests is non-zero, the true cost for those requests is higher than the reported cost_usd.Authorizations
OAuth 2.1 authentication — recommended for new integrations. Access tokens
(kc_ prefix) are minted at the root-host token endpoint
https://api.knoxcall.com/oauth/token and passed as Authorization: Bearer <access_token>.
Public clients must use PKCE with the authorization_code grant; confidential
clients may use client_credentials. The first-party SDKs and the
knoxcall login CLI handle token minting, caching, refresh, and DPoP for you.
Query Parameters
The rollup window. Defaults to 30 days.
7d, 30d, 90d Scope the rollup to a single agent.