Cost reference
Before optimizing, it helps to understand relative model costs. The figures below are approximate input token prices as of mid-2025. Output tokens are typically 3–4x more expensive.
Routing a classification task from
openai/gpt-4o to openai/gpt-4o-mini is a 33x cost reduction with equivalent accuracy for simple tasks.
Cost optimization workflow
1
Audit your current model usage
Open the Usage dashboard and filter by model to see where your spend is concentrated. Sort by cost descending to find the highest-impact models.Look for requests going to premium models that could be handled by cheaper alternatives — classification, extraction, short summarization, and Q&A over structured data are common candidates.
2
Enable cost-optimized routing for eligible requests
Add the
X-Inferoute-Strategy: cost header to requests where output quality is not critically sensitive. Inferoute will select the cheapest model that can satisfy the request at that moment.python
3
Right-size models by task complexity
Not all tasks need the same model. Segment your request types and assign the cheapest model that meets your quality bar for each.
4
Set usage caps per API key
In the API Keys section of the dashboard, set a monthly spend limit per key. When the cap is reached, the key returns a
429 response instead of continuing to accrue charges.This is useful for:- Per-customer keys in multi-tenant applications (cap individual customer spend)
- Development and staging keys (prevent accidental large runs)
- Feature-specific keys (limit spend on a specific product feature)
5
Monitor and iterate
Return to the Usage dashboard weekly. Filter by:
- Model — confirm that cost-optimized routing is being applied to the right request types
- Provider — check whether any provider is disproportionately expensive
- Time of day — spot unexpected spikes that may indicate runaway processes or prompt injection
Use cost-optimized routing for the request
TheX-Inferoute-Strategy: cost header and the economy alias are the fastest way to reduce spend without changing your prompts or application logic.