- Pricing — each model gets a public or private price.
- Attribution — every request is tied to a user, team, virtual account, model, and any metadata you attach.
- Reporting — costs are broken down in Metrics and can be exported.
Set model pricing
Pricing is set per model, in the model’s configuration under its provider account.
Cost options in the model configuration
- Public cost
- Private cost

Public cost
How cost is calculated
Where public pricing comes from
Where public pricing comes from
- Region-wise pricing: If a model has different rates by deployment region, the matching regional rate is used. For example, AWS Bedrock’s Nova Lite uses different input/output costs per token in
us-west-2,us-west-1,eu-central-1, andeu-west-1. - Tiered pricing: If a provider defines usage tiers (e.g. different rates at different volume thresholds), the applicable tier is selected. For example, Gemini 2.5 Pro has base rates and higher rates from 200K tokens; Gemini 1.5 Flash has tiers starting at 128K tokens.
Pricing units: tokens, characters, and audio seconds
Pricing units: tokens, characters, and audio seconds
0.0001 in the catalog appears as $100 per 1M characters in the cost UI.Where the billed quantity comes from differs between the two audio directions, and it matters:- Text-to-speech counts the characters in your request text, as Unicode code points, before the request is sent upstream.
- Speech-to-text takes the audio duration from the provider’s response. If a provider does not report a duration, no billable seconds are recorded and the request is costed at zero.
Cached tokens and image models
Cached tokens and image models
$1.25 per 1M for cached text input but $2.00 per 1M for cached image input on gpt-image-1.5 and gpt-image-2-family models (gpt-image-1 is $2.50 per 1M). The catalog models this with two fields:cache_read_input_image_token_cost, cached image tokens are billed at cache_read_input_token_cost, so models without a separate image cache rate are priced exactly as before.Formula (chat and image endpoints, per request):- Every input token is billed exactly once.
input_tokensalready includes cached and image tokens, so the formula splits it into non-overlapping buckets: text, uncached image, cached text, cached image, and cache writes. A cached image token sits in both the cached and image counts, so it is removed fromuncached_imageand billed only at the cached image rate. - Cached image tokens are capped at the cache-read total.
min(...)stops a malformed usage report from billing more cached tokens than the provider says were read from cache. - The fallback keeps existing prices stable. Models without the new field keep their current cost.
cached_tokens_details.image_tokens in the usage object. OpenAI’s Images API reports an aggregate cached_tokens at most, and its documentation says cached image pricing for GPT Image 2 and 2.5 applies only to the image generation tool in the Responses API, not to /v1/images/edits. When no image breakdown is reported, the gateway leaves the cached count unused and bills those tokens at the regular input rates. An explicit 0 is treated as a reported breakdown. The cached text tokens are then billed at the cache-read rate.View costs
Every request is costed as it passes through the gateway, and the results appear in Metrics alongside usage.
Metrics page overview
Cost by user

Cost by model

Cost by team

- By user — who is driving spend.
- By model — which models cost the most.
- By team — spend per department or project, for chargeback.
Attribute costs with metadata
Beyond the built-in user, model, and team breakdowns, you can use custom metadata to build fine-grained cost attribution tailored to your organization’s structure — by application, environment, customer, cost center, or any other dimension.Attach metadata automatically
TrueFoundry can automatically inject metadata into requests, enabling cost attribution without any client-side changes:Tag virtual accounts
application, environment, cost_center). These tags are automatically injected as metadata on every request made with that account’s token, giving you per-application and per-environment cost breakdowns without modifying any code.Associate PATs with teams
Enforce metadata with validation
cost_center or project_id key — requests missing required metadata are rejected before reaching the model, ensuring complete cost attribution across your organization.Group costs by metadata
Once metadata is attached to requests (either manually or via automatic injection), you can filter and group cost data by any metadata key in the Metrics dashboard. For example:- Group by
applicationto see cost per service - Group by
environmentto compare staging vs. production spend - Group by
customer_idto track per-customer costs for chargeback
groupBy fields to get detailed breakdowns in your exported reports.
Export cost data

Downloading cost data
username, model_name, teams, or any metadata key.

Custom grouping options
Cancelled and disconnected streams
When a client cancels a streaming request mid-flight — a user closes the tab, an agent stops generation, a pod is evicted — the provider has usually already generated, and charged for, some tokens. Dropping the request at that point would hide that spend from dashboards and budgets. Instead, the gateway costs interrupted streams using a policy that matches how each provider bills a cancelled request:How tokens are estimated
How tokens are estimated
Identifying disconnected requests
Identifying disconnected requests
client-disconnected in request logs and model metrics. There is no separate “partial” flag. Cost is present on the estimate and do-not-cancel paths, and zero on do-not-bill.tfy.model.tokens_estimated to separate measured spend from estimated spend. See TrueFoundry span attributes and filter client-disconnected spans.A client that hangs up just after a stream completes is not a disconnect: the stream is marked complete as soon as the terminal event is written, so it is recorded as an ordinary successful request.Effect on budgets, rate limits, and caching
Effect on budgets, rate limits, and caching
- Budgets — cost from a disconnected stream counts against budget limits exactly like a completed request. Do-not-bill requests carry zero cost and consume no budget.
- Rate limits — a cancelled request consumes a request-quota slot under all three policies. Rate limits count errors as well as successes, so repeatedly starting and aborting requests cannot bypass a requests-per-minute limit.
- Caching — a truncated stream is never written to the response cache, even though it is billed, so a cut-off answer is never replayed as a whole one. On the do-not-cancel path the stream is read to completion and cached normally.
Non-streaming requests
Non-streaming requests
COMPLETE_NON_STREAMING_ON_CLIENT_CANCEL to false to abort the upstream call instead. It defaults to true. With it disabled, a cancelled non-streaming request attributes no cost, at the risk of under-reporting spend the provider still charges for.Current limitations
Current limitations
- Native Responses API streams are not estimated. A cancelled
/v1/responsesstream that never received its terminal usage event is recorded with zero tokens and cost. OpenAI (do-not-cancel) and Azure OpenAI / Azure AI Foundry (do-not-bill) are unaffected; Microsoft Foundry uses the estimate policy on chat completions, but a cancelled native Responses stream still records zero until that gap is closed. - Gemini and Bedrock passthrough endpoints read provider usage only. Requests on those native passthrough routes attribute no cost if cancelled before the provider reports usage.
- Proxy and text-to-speech passthrough requests are never billed on cancel.
- A network failure is not a client disconnect. If the provider connection dies mid-stream, the request is recorded as an error, not as billable truncation. When a provider reports an in-band failure while the client disconnects, the provider error takes precedence in the trace.
