From tokens to a request cost
The model provider responds with token consumption for the request, including input tokens consumed and output tokens generated. For streamed responses, this usage information may arrive near the end of the stream. Gateway uses these reported counts to calculate a cost for each request or prompt sent to the provider:- Identify the upstream provider and model used for the request.
- Read the input and output token consumption reported in the response.
- Apply the model’s input and output rates from the pricing catalog available when the request is recorded.
- Store the resulting cost with that request.
From request costs to chart totals
Gateway adds the recorded costs for individual requests to produce the totals in the graph. The selected date range, filters, and grouping determine which requests contribute. Requests are assigned to the UTC calendar day when they started. One message or task in the desktop app can trigger multiple model requests, such as successive tool-use steps or retries. Each request with a known cost contributes separately to the total. Amounts are stored with more precision than the two decimal places shown in the chart. Gateway sums the stored amounts before rounding the displayed total, so adding individually rounded amounts may give a slightly different result. A very small known cost can display as $0.00 after rounding. Stored estimates are not recalculated when model prices in the catalog change. Team grouping follows current team membership, so a person in multiple teams contributes to each team. See Counting usage for grouping and token-counting details.When cost is unavailable
A request may have no cost estimate if the provider does not report the required input and output usage, or if Gateway cannot find usable pricing for the provider and model. Errors, cancellations, interruptions, and rejected requests can also leave usage unavailable. See Uncountable Items for these cases. The cost graph includes known costs only. Missing estimates are excluded rather than treated as free, and a model with no available cost data is not shown in the cost view. A provider-reported cost may still be available even when a token total is missing. If a request fails or is canceled after enough usage has been reported to calculate a cost, that known cost still contributes to the total.Accuracy and limitations
We cannot guarantee the accuracy of cost estimates or the completeness, accuracy, or freshness of the pricing information. Use these figures as indicators only when comparing activity and understanding usage trends.- Public catalog prices may be outdated or may not capture every provider-specific billing rule or additional charge.
- Estimates do not reflect any contract pricing, negotiated discounts, credits, or other billing agreements you may have.
- Missing or incomplete provider usage can leave the graph with only part of the activity that was billed.
- Even a provider-reported cost may differ from the final invoice after billing adjustments.