Skip to navigation

Cost governance and savings

See where spend goes and use routing and compression to cut it

Gateway reports spend from every vendor in one place and offers settings that lower it without application changes. To cap spend, use Budgets; for what you’re billed, see Plans and pricing.

Where spend is reported

Usage & spend in the dashboard totals managed and BYOK spend, tokens, and requests across every vendor.

TabBreaks spend down by
OverviewTotals over time, managed vs BYOK
By sourceModel, provider, or vendor
By attributionProject, policy, customer, or API key. Policies are labeled by their model alias
PerformanceLatency for the same traffic

For a single request, open it in Logs: Estimated cost shows its cost with Merge’s fee underneath, and the summary strip totals both over every request matching your filters. The figures read differently by key type:

KeyEstimated costMerge fee
Merge-managedWhat you’re billed, with your plan rate appliedThe fee’s share of that
Your own (BYOK)What the tokens cost on your vendor account at list priceWhat Merge bills you, the only part on your Merge invoice

In your own tooling, read usage.cost from each response; it’s null, not 0, when the serving route has no price on file. Tools that read it automatically, such as Langfuse, need no setup.

Scope traffic to projects by team, product, or environment so By attribution shows who spent what.

Savings levers

Levers stack: routing picks a cheaper model or vendor, while compression and caching shrink what each request sends.

LeverWhat it doesConfigure it
Intelligent routing on the Cost axisScores each prompt’s complexity and pushes most traffic toward the cheaper models in the policyRouting policies
Priority routingPuts a cheaper model first and falls back to others only on failureRouting policies
Tag-based routingSwitches tagged low-stakes traffic, such as internal tools, to a cheaper strategy within the same policyThe project’s Routing tab
Context compression in Cost optimization modeCompacts JSON and trims long conversations before they reach the modelConfigure → Request settings → Defaults, or per project
Prompt cachingBills a repeated prompt prefix at the vendor’s lower cached rateCache markers or session hints on the request

To measure a lever, compare the affected project or policy on By attribution before and after.

Next steps