usage.cost, in US dollars, priced on the rates your organization is billed, so you can attribute spend to a request, a user or a feature the moment the answer arrives, without waiting for the Usage API.
The field follows the usage.cost convention OpenAI-compatible gateways already use, a number in US dollars, so tooling that reads usage.cost reads a Valar response without changes.
Per-request cost reporting is enabled per organization. If your responses do not carry
usage.cost yet, ask [email protected] to turn it on. Nothing else in the response changes.What you get
One field joins the usage block you already receive. The token fields keep each API’s own convention.
The price is computed with the same arithmetic and the same rate card as the spend the Usage API reports: your negotiated rates where you have them, otherwise the published rates, with cache reads, cache writes and the long-context band applied exactly as they are billed. Summing
cost lets you track spend per request; rounding and rate changes can make the total differ from the Usage API.
Where it appears
- Non-streaming responses carry it in
usage. - Streaming responses carry it in the final frame that reports usage:
response.completedon the Responses API, the trailingusagechunk on Chat Completions (sendstream_options.include_usage: true), andmessage_deltaon the Messages API. GET /v1/responses/{id}and idempotent replays carry it too, priced on the response’s own tier, so a Standard or Flex request you poll for later reports its window’s price.
failed or cancelled) is never billed and carries no cost. An incomplete response that hit max_output_tokens is billed and priced like any other. A request served on your own provider key reports cost: 0.
ValarCode
Requests sent with ValarCode credentials (a coding key, or an SSO sign-in) carrycost the same way, whether they come from Claude Code, Cursor, Codex or your own calls to the endpoints above. Two exceptions answer without the field: a request reviewed by an advisor model (such as valar/fusion), and a streamed Chat Completions request that did not ask for usage.
Reading it from an SDK
OpenAI and Anthropic SDKs keep fields they do not model, so the value is reachable without any change to your client:How it relates to your bill
Two things can make a later read differ from the live one: a rate change between the request and aGET of its response (the response is priced at the rate in force when it is read), and rounding, which the Usage API applies in cents and cost in millionths of a dollar. The rates themselves are in GET /v1/models, resolved for your organization.