Export Usage (CSV)
Aggregated AI Gateway spend as CSV, for showback and chargeback.
group_by is a strict allowlist and a tag key is bound as
a query parameter, so there is no injection surface.
Every row carries unpriced_requests alongside cost_usd, so a pricing gap is
visible in the export rather than hidden inside a total. A model that is not in
the pricebook is recorded with cost_source = 'unpriced' — never booked as free.
=, +, - or @ is prefixed with a single quote, so a model
name or a tag cannot execute as a formula when someone opens the file in a
spreadsheet. If you parse this file, parse it as real CSV — do not split on
commas.read capability on ai_gateway. See the control-plane overview for authentication, the {data, meta} envelope, pagination and error types.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
Grouping dimension: user, team, agent, model, provider, or tag:<key>.
The rollup window. Defaults to 30 days.
7d, 30d, 90d Scope the export to a single agent.
Response format. csv streams a downloadable attachment.
json, csv