Skip to main content
Some model calls never go through the proxy: a batch job on a different network, a vendor product that bills you for AI you cannot intercept, or a team that has not migrated yet. Report them here and they appear alongside everything else. POST /usage
This endpoint records usage; it does not decide anything. The call has already happened, so the kill switch, budgets and policies do not run on this path.

Request

Send costUsd, or at least one of inputTokens and outputTokens. A report with none of them is refused with a 400. A field sent as null is treated as not sent. Every spend figure in the console includes these reports, so a report that would corrupt them is refused with a 400 and not stored:
  • a negative, non-numeric or impossibly large costUsd;
  • token counts that are negative, fractional, or too large to store;
  • an occurredAt that is not ISO 8601, is not a real date or time (30 February, 24:30), is before 2000, or is in the future (a few minutes of clock difference is allowed);
  • a model that is not text of at most 200 characters, or a provider that is not text of at most 100.
A report more than 35 days old is recorded and marked, and the response carries a warning: the report may fall in a month, budget or bill that is already closed, and will not change it.

Response

A stored report answers 201:
costSource says where the cost came from:
  • reported: you sent costUsd and we used it.
  • computed: we priced your token counts at that model’s rate, using your organisation’s declared price where you set one (the same price your proxied calls use) and otherwise the catalogue’s.
  • unknown: we have no price for that model and did not invent one. The event is recorded with a null cost, which the console shows as unpriced, with a note that real spend is higher, never as $0.00.
If you are seeing unknown for a model you care about, tell us the id and we will add the price.

Token semantics

Providers do not agree on what input tokens means. Anthropic’s input_tokens excludes cached tokens; OpenAI’s and Gemini’s include them. If you are computing inputTokens yourself from a provider’s response, check which convention you are reading before you send it, or the same traffic will price differently depending on where it came from.