—
Top eligible candidates
| Provider | Model | Tier | Eff. input $/M | Eff. output $/M | Monthly |
|---|
Describe your workload. Get the cheapest viable model, the savings breakdown, and the logic behind it.
—
| Provider | Model | Tier | Eff. input $/M | Eff. output $/M | Monthly |
|---|
Model routing is software that automatically sends each request to the cheapest model that can handle it well, instead of paying premium prices for every call. Below: the same workload, routed by each cloud's own native router, against that cloud's frontier model — list price, no other levers.
—
| Tier | Model | Share | $/M in | $/M out | Monthly |
|---|
—
| Tier | Model | Share | $/M in | $/M out | Monthly |
|---|
A gateway is one doorway in front of many models from different vendors. It reads each incoming request, decides on its own how hard the task is — easy, intermediate, or difficult — and sends it to the model you've assigned to that level. You set that menu in the dropdowns below; the gateway does the sorting. It routes to the model you picked for each tier, not automatically to the cheapest one — because only you can judge which inexpensive model is still good enough for your work. The payoff a single cloud can't match: you can put a very cheap model on the easy path and reserve a premium one for the hard path, mixing providers freely.
—
| Tier | Model | Share | $/M in | $/M out | Monthly |
|---|
A specialist recommender is a service that looks at each individual request and predicts which model will answer it best — a learned judgment trained on past results, rather than the gateway's fixed easy / intermediate / difficult rules. It doesn't replace the gateway; it plugs in behind it, making a sharper per-request choice while the gateway still does the actual dispatching. Because it charges a fee for every request it judges, it only earns its keep when those smarter picks save more than the fee costs — and the fair comparison is what the gateway's own free routing would have done, not paying full price for everything. That's the bar shown below.
—
| Layer | Baseline | Routed | Fee | Net $/mo | % off own baseline |
|---|
Self-hosting an open-weight model is not a per-token price — it is fixed GPU capacity. So the real decision is a break-even volume: below it, the API is cheaper; above it, self-hosting wins. This calculator turns the advisor's self-host disclaimer into a real number. All GPU $/hr and throughput figures are illustrative snapshots (2026-06-14) — see hardware-sources.md; validate on your own traffic.
“GPUs needed” is the hinge. It comes from the model’s throughput figure at your utilization ceiling and minimum-replica floor — so both the Rent and Buy columns already reflect your duty cycle. Owning only wins if you keep the GPU busy: idle owned hardware is sunk capital you can’t hand back, so at low utilization renting is usually safer.
Renting vs buying only changes the card payment. You still need someone to drive and maintain the stack — at small scale that engineer costs more than the GPU. So treat this as a cost-structure tool, not a quote — or fold that people-cost in directly with the optional Engineer / ops $/mo input below.
Included: GPU capital amortized over a useful life you choose, electricity × a cooling/overhead factor (PUE), a flat server/colo/ops slice per GPU, and the API’s list price for the same volume. Optionally, an engineer / ops $/mo you enter (off by default) is added to both the Rent and Buy lines to model true TCO.
Excluded: networking, storage, data egress, spot-eviction/restart overhead, and any model-quality difference. Engineers’ time to build and run the stack is excluded by default, but can be added via the optional engineer / ops $/mo input above. At small scale these usually dwarf the rent-vs-buy gap.
Key assumptions: throughput is an illustrative snapshot at a fixed precision, batch size and sequence length; input (“prefill”) tokens are counted at a fraction of an output token; the input:output ratio is held fixed when solving for break-even. Rented neocloud rates sit below hyperscaler list because they are roughly amortized hardware plus a thin margin, with cheaper power, denser packing and more competition — an intuition, not a line in the formula.
hardware-sources.md). Today that’s Mistral Small 4, Phi-4 mini, and Phi-4 — it expands as we source more.
—
This prototype contains three separate engines, each with its own model, inputs, and assumptions. They do not share state — the Cost Advisor’s validated rule tree is never altered by the other two. Pick a methodology below.
The engine walks a deterministic six-rule tree in fixed order. Same inputs always produce the same outputs and the same trace. The philosophy is: cheapest viable, where viability is enforced by tier filters and compliance gates — not by judgment.
If the workload is asynchronous (hours-OK), the Batch API lever activates — applying a 0.5× multiplier to both input and output tokens. Real-time and near-real-time workloads use standard per-token rates.
The quality bar and task type together set a tier band [min, max] for eligible models. Two floors apply — the higher one wins:
| Quality | Min Tier | Max Tier |
|---|---|---|
| Good-enough | 1 | 2 |
| Production | 2 | 3 |
| High | 3 | 4 |
| Frontier | 4 | 4 |
Task floors: classification/extraction = tier 1, chat/summarization/coding = tier 2, reasoning/agent = tier 3. Reasoning and agent tasks get a +1 buffer so the engine considers one tier above the floor.
Sets the cache hit rate for models that support prompt caching:
| Reuse Pattern | Cache Hit Rate | Effect |
|---|---|---|
| One-off | 0% | Caching disabled |
| Repeated prefix | 70% | System prompts, few-shot scaffolding |
| Heavy document reuse | 90% | Same document referenced repeatedly |
Cached input is priced at ~10% of base rate. Formula: eff_input = (1 − hit) × base + hit × cached_rate
Filters the candidate set by data residency or deployment constraint:
If compliance leaves an empty candidate set, the engine returns an error rather than silently relaxing constraints.
Steady-state high-volume workloads (>60% utilization) surface a note recommending provisioned capacity (Microsoft Foundry PTU). Cost is not algorithmically adjusted — PTU sizing is workload-dependent.
For every surviving candidate, compute monthly cost with all levers stacked:
monthly = eff_input × vol_in + eff_output × vol_out × effort_factor
Where effort_factor = 0.65 for models with reasoning effort control (when quality ≠ frontier). This reduces output token consumption by ~35%.
Sort ascending by cost. Index 0 is the winner. The next 5 appear in the alternatives table.
| Lever | When It Fires | Impact |
|---|---|---|
| Batch processing | Async latency + model supports batch | −50% both input & output |
| Prompt caching | Repeated/heavy reuse + model supports cache | Up to −90% on cached input |
| Reasoning effort | Quality ≠ frontier + model has effort param | −35% output tokens |
| Right-sizing | Winner is below frontier tier | Varies (50–95% vs baseline) |
| Self-host accounting | Open-weight model selected | Fixed compute vs per-token |
| Residency premium | US compliance required | +10% on all rates |
The engine accepts 7 dimensions plus monthly volume as inputs, and produces a structured JSON result. All money values are in USD. Token volumes are in millions (MTok).
| Field | Values | Purpose |
|---|---|---|
| task | classification, extraction, chat, summarization, reasoning, coding, agent | Determines minimum model tier |
| latency | realtime, near, async | Enables/disables batch lever |
| reuse | oneoff, repeated, heavy | Sets cache hit rate (0/70/90%) |
| context | small, medium, large | Flags context-size warnings |
| quality | good-enough, production, high, frontier | Sets quality tier floor |
| compliance | none, us, eu, selfhost | Filters providers, applies premiums |
| throughput | low, bursty, steady | Triggers PTU recommendations |
The JSON export includes: recommendation (provider, model, effective rates, monthly cost, why-cheaper), baseline comparison (GPT-5.5 real-time), savings (dollars and percent), levers applied (with kind: savings or note), up to 4 alternatives, and the full decision trace.
GPT-5.5 real-time, no caching, no batching, no effort tuning: baseline = $5.00 × vol_in + $30.00 × vol_out. Chosen as the frontier-tier reference point that teams most commonly default to.
When adding a model: (1) add to the MODELS array in index.html, (2) add pricing to pricing-sources.md with verification date, (3) update test cases if cheapest-path changes.
| Provider | Model | Tier | Input $/M | Output $/M | Cache | Batch | Self-host |
|---|---|---|---|---|---|---|---|
| Mistral | Ministral 3B | T1 | $0.10 | $0.10 | — | ✓ | — |
| Mistral | Mistral Small 4 | T2 | $0.10 | $0.30 | — | ✓ | ✓ |
| Mistral | Large 3 | T3 | $0.50 | $1.50 | — | ✓ | — |
| Mistral | Codestral | T2 | $0.30 | $0.90 | — | ✓ | — |
| OpenAI | GPT-5.4 nano | T1 | $0.20 | $1.25 | ✓ | ✓ | — |
| OpenAI | GPT-5.4 mini | T2 | $0.75 | $4.50 | ✓ | ✓ | — |
| OpenAI | GPT-5.4 | T3 | $2.50 | $15.00 | ✓ | ✓ | — |
| OpenAI | GPT-5.5 | T4 | $5.00 | $30.00 | ✓ | ✓ | — |
| Anthropic | Claude Haiku 4.5 | T1 | $1.00 | $5.00 | ✓ | ✓ | — |
| Anthropic | Claude Sonnet 4.6 | T3 | $3.00 | $15.00 | ✓ | ✓ | — |
| Anthropic | Claude Opus 4.8 | T4 | $5.00 | $25.00 | ✓ | ✓ | — |
| Google Gemini | Gemini 3.5 Flash-Lite | T1 | $0.25 | $1.50 | ✓ | ✓ | — |
| Microsoft Foundry | Foundry GPT-5.4 mini | T2 | $0.75 | $4.50 | ✓ | ✓ | — |
| Microsoft Foundry | Foundry GPT-5.4 | T3 | $2.50 | $15.00 | ✓ | ✓ | — |
| Microsoft Foundry | Phi-4 mini | T1 | $0.075 | $0.30 | — | ✓ | ✓ |
| Microsoft Foundry | Phi-4 | T2 | $0.125 | $0.50 | — | ✓ | ✓ |
The Routing tab answers a different question from the Cost Advisor: not which single model to run, but how much a routing layer cuts the bill when one workload is split across difficulty tiers instead of sent entirely to a frontier model. It reuses the same 16-model catalog read-only and isolates routing — list price only, with no caching, batching, or reasoning-effort levers — so any saving shown is attributable to routing alone, never stacked with other optimizations. Inputs: monthly input/output volume and a difficulty mix (easy / intermediate / difficult, which auto-fills to 100%).
Each hyperscaler’s own managed router, measured against that cloud’s own frontier model:
One configurable gateway that can route each tier to any model in the catalog, across vendors, under four fee models: percentage markup on routed spend, zero-markup BYOK, flat subscription, or self-host. The per-tier model is a user choice — the gateway classifies how hard each request is, but the human sets which model serves each tier; it does not auto-pick the cheapest.
A per-request model picker that sits behind the gateway, modeled as an overlay on the gateway’s already-routed bill (a Not Diamond-style fee: ~$10 / 10,000 recommendations, first 10,000 free). Its break-even is measured against the gateway’s own free routing, never the do-nothing frontier baseline, to avoid double-counting the gateway’s savings.
A closing “one workload, every layer” table compares all of the above on a single workload. Net $/mo is the comparable figure. The percentages are each layer measured against its own baseline and are not comparable across rows — Bedrock’s % is versus the Claude frontier, Foundry’s is versus the GPT frontier, and the specialist’s is versus the gateway.
Self-hosting an open-weight model is not a per-token price — it is fixed GPU capacity. This tab answers: at what monthly volume does running your own GPUs beat paying the API, and is it cheaper to rent or buy those cards? It is a fully independent engine (selfHostCost() for rent, ownedHourly() for buy) — it does not touch the Cost Advisor or its validation set. It scopes 8 open-weight models (the 3 self-hostable advisor models plus 5 community models in a separate SELFHOST_EXTRA list) across 4 GPUs (L4, A10G, A100-80GB, H100-80GB).
| Line | Monthly formula | Behaviour |
|---|---|---|
| API | vol_out × list $/MTok | Linear — grows every time you use it. |
| Rent | gpus_needed × rental $/hr × 730 | Fixed once the GPUs are on — busy or idle. |
| Buy | gpus_needed × owned $/hr × 730 | Fixed; owned $/hr is amortized (below). |
730 = average hours per month. The cheapest of the three is highlighted, with a break-even output volume for each of Rent and Buy versus the API.
“GPUs needed” is the hinge that drives both Rent and Buy. It comes from the model’s throughput at your utilization ceiling and minimum-replica (HA) floor:
replicas = max(min_replicas, ceil(output-equivalent load ÷ per-replica capacity))
gpus_needed = replicas × gpus_per_replica
gpus_per_replica: 2 — a single 80 GB card leaves almost no KV-cache room, so it is provisioned across two cards. Its GPU count and cost double accordingly (shown as a TP×2 badge). Every other model defaults to 1 card/replica, so this changes nothing for them.prefill_factor) and folded into the output-equivalent load.The Buy line swaps the rental rate for an amortized owned rate (ownedHourly()), the sum of three terms:
owned $/hr = purchase ÷ (life_years × 8766) + (TDP ÷ 1000) × $/kWh × PUE + hosting_per_month ÷ 730
Owned cost is fixed regardless of utilization — you pay full amortization whether the card is busy or idle. That is exactly the sunk-capital property that makes ownership unforgiving at low duty cycle.
The core insight: self-host is a step function, the API is linear. So the honest output is a break-even, not a flat rate. Below break-even the API wins (the GPU sits idle); above it self-hosting wins — and owning only beats renting if you keep the GPU busy, since idle owned hardware is sunk capital you can’t hand back. An inline chart plots all three lines with both break-even points.
source tag. The three Phi-4/Mistral anchors are measured (representative of published vLLM throughput); the five community additions are est (illustrative, interpolated from the anchors by parameter count and GPU class). The picker and the Throughput readout show an est. badge so you can tell which is which per-model.hardware-sources.md; re-verify before any external use.selfHostCost() and ownedHourly() are pure and deterministic (same inputs → same output). The tab ships its own invariant harness, tests/selfhost.run.js (50 assertions: rent capacity/break-even, owned amortization, the open-weight catalog, measured/est provenance tags, 70B TP×2 provisioning, and the optional engineer/ops cost), kept fully separate from the advisor’s tests/run.js (11/11), which stays the regression guard.
Prioritized by impact and ease of implementation. Start at the top and work down — the first five actions are detailed in the strategy deep-dives below.
| # | Action | Savings | Effort |
|---|---|---|---|
| 1 | Switch to batch API for non-real-time | 50% | Low |
| 2 | Enable prompt caching (structure prompts correctly) | 75–90% input | Low |
| 3 | Downsize model (test quality with cheaper) | 50–95% | Medium |
| 4 | Use effort=medium instead of high | 30–70% | Low |
| 5 | Set max_tokens appropriately | 10–30% | Low |
| 6 | Use Mistral/Gemini/Phi-4 for simple tasks | 80–95% vs frontier | Low |
| 7 | Implement model cascade (cheap → expensive) | 60–80% | High |
| 8 | PTU/Reserved for steady-state (Microsoft) | 20–40% vs on-demand | Medium |
| 9 | Compaction for long conversations (Claude) | 40–60% | Low |
| 10 | Self-host open-weight models (Llama, Qwen, Mistral, Phi, Gemma) | 50–90% at scale | High |
These techniques apply across all AI providers. Applying them in combination produces compound savings.
Start with the smallest model that meets quality requirements. Most production workloads do not need frontier-tier models. A practical rule: begin with the cheapest model and only move up if evals or user feedback show a quality gap.
Model choice is the most impactful cost lever — it determines your base rate before any other optimization applies. The difference between the cheapest and most expensive model in our catalog is 300× ($0.10/MTok for Ministral 3B vs $30/MTok for GPT-5.5 output). No amount of caching, batching, or token trimming can overcome choosing a model that is 300× more expensive than what you need.
Think of it like this: you need to get across town. You could hire a private helicopter, a luxury sedan, a standard taxi, or take the bus. They all get you there. If you just need to get across town reliably, the taxi works fine — the helicopter is not 100× better for this trip. AI models work the same way: a $30/MTok frontier model answering "Is this email spam?" produces the same yes/no answer as a $0.10/MTok model, but costs 300× more.
Why most teams overspend:
The right-sizing process:
| Step | Action | What You Learn |
|---|---|---|
| 1 | Run your workload on the cheapest eligible model | Baseline cost and quality floor |
| 2 | Spot-check 20–50 outputs for quality | Whether the cheap model is "good enough" |
| 3 | If quality is acceptable — stop here, you are done | Most teams stop at this step |
| 4 | If quality falls short, move up one tier and repeat | The minimum model tier that meets your bar |
Model tiers and when to use them:
| Task Complexity | Recommended Tier | Example Models | Monthly Cost at 100M in / 20M out |
|---|---|---|---|
| Simple (classification, extraction) | Nano / Mini | Ministral 3B, Phi-4 mini, GPT-5.4 nano, Flash-Lite | $12 – $35 |
| Standard (chat, summarization) | Mid-tier | Mistral Small 4, Phi-4, GPT-5.4 mini | $16 – $165 |
| Complex (reasoning, coding) | Standard | GPT-5.4, Claude Sonnet 4.6, Mistral Large 3 | $80 – $550 |
| Frontier (research, deep analysis) | Flagship | GPT-5.5, Claude Opus 4.8 | $1,000 – $1,100 |
Use batch for any non-real-time workload. All 5 providers offer ~50% off for batch. This is the easiest lever with zero quality tradeoff — the only cost is latency (typically 24h turnaround).
Batch processing is the simplest and most risk-free cost lever. The quality of the output is identical — the model processes the same prompt and produces the same answer. The only difference is timing: instead of getting the response in seconds, you get it in hours. In exchange, providers charge you half price.
Think of it like this: shipping a package. You can pay for next-day delivery or standard ground shipping. The package is the same, the destination is the same — you just wait a bit longer. Batch processing is the "ground shipping" of AI: same result, half the cost, but you cannot stand at the counter and watch it happen.
Is your workload batchable?
| Workload Type | Batchable? | Why |
|---|---|---|
| Chatbot responding to live users | No | Users are waiting — they need a response in seconds |
| Nightly document processing | Yes ✅ | Nobody is waiting — results needed by morning, not right now |
| Labeling a backlog of 10,000 records | Yes ✅ | Bulk operation, no real-time requirement |
| Generating weekly reports | Yes ✅ | Scheduled task — hours of delay are fine |
| Content moderation queue | Maybe | Depends on SLA — if 1-hour turnaround is acceptable, batch works |
| Real-time search assistant | No | User expects instant answers |
| Data extraction from uploaded files | Yes ✅ | User uploads a file and checks back later — no need for instant processing |
How easy is it to set up?
| Provider | Setup Difficulty | How It Works | Discount | Turnaround |
|---|---|---|---|---|
| OpenAI | Easy | Upload a JSONL file of requests, submit as a batch. Poll for completion or use a webhook. | 50% off | Up to 24 hours |
| Anthropic (Claude) | Easy | Message Batches API — submit up to 10,000 requests. Results returned in a single response object. | 50% off | Up to 24 hours |
| Google Gemini | Easy | BatchGenerateContent API. Also supports a "Flex" mode with shorter turnaround at similar discounts. | 50% off | Up to 24 hours |
| Mistral | Easy | Batch inference API — upload JSONL, retrieve results when ready. | 50% off | Up to 24 hours |
| Microsoft Foundry | Easy | Global Batch deployment — same OpenAI batch format, processed on Azure infrastructure. | 50% off | Up to 24 hours |
The key insight: most organizations have a mix of real-time and asynchronous workloads, but run everything through the real-time API because it is the path of least resistance. Simply identifying which workloads do not need instant responses and routing them to batch can cut your total bill by 25–40% with no quality impact and minimal engineering effort. If even 50% of your volume is batchable, that is a 25% reduction in your total spend — for what is often a one-day integration.
Cache repeated prefixes — system prompts, policy documents, few-shot examples. Cached tokens are served at ~10% of base rate. Place static content at the beginning of prompts and keep prefixes identical to maximize hit rates.
Of all the cost levers, prompt caching often delivers the largest and most immediate savings — because most AI applications send the same instructions, policies, or reference documents with every request. You are paying full price for the same text over and over again. Caching eliminates that waste.
Think of it like this: every time your app calls the AI, it sends a message. The first part of that message — the rules, context, and background information — is usually identical across hundreds or thousands of requests. Without caching, the provider charges you full price to "read" that same text every single time. With caching, the provider remembers it and charges you a fraction of the cost.
How easy is it to set up?
| Provider | Setup Difficulty | How It Works | Discount |
|---|---|---|---|
| OpenAI | Automatic — zero effort | Any repeated prompt prefix over 1,024 tokens is cached automatically. No code changes needed. | 50% off cached input |
| Google Gemini | Automatic + optional manual | Implicit caching works automatically. Explicit caching (for precise control) takes ~5 lines of code. | 75% off cached input |
| Anthropic (Claude) | Small code change | Add a cache_control marker to tell the API what to remember. Takes 2–3 extra lines per request. Automatic caching also available on newer models. | 90% off cached reads (25% write premium on first call) |
| Mistral | Not available | No caching API. However, base rates are already so low that this gap rarely changes the cost winner. | — |
| Microsoft Foundry | Automatic (OpenAI models) | Same automatic caching as OpenAI for Foundry-hosted GPT models. Cached tokens are FREE on reserved capacity (PTU). | 50% off (pay-per-token) / free (PTU) |
| Microsoft Phi-4 | Not available | Phi-4 mini and Phi-4 do not support prompt caching. Like Mistral, they compete on low base rates instead. Self-hostable (MIT license) — infrastructure cost replaces per-token cost at scale. | — |
The real work is not in the code — it is in prompt design:
For teams with well-structured prompts (separate system prompt + user message), enabling caching is a one-hour change. For applications where instructions and data are mixed together in every message, it requires a prompt restructuring effort — but the savings typically pay for that effort within the first week.
Use the lowest reasoning effort that still solves the task. Models with effort parameters (OpenAI, Anthropic) can dramatically reduce hidden thinking tokens. Medium is often the best default — reserve high for genuinely hard cases.
Some AI models do not just produce an answer — they "think" before responding. This thinking uses tokens you pay for, even though you never see them in the output. A model set to "high" effort might spend 5,000 hidden tokens reasoning through a problem that "medium" effort solves in 500 tokens — with the same final answer. That is a 10× cost difference for identical results.
Think of it like this: asking a consultant to write a one-page summary. You can ask them to spend 30 minutes or 3 hours on it. For a routine summary, both versions look the same — but one costs 6× more. Reasoning effort control lets you tell the AI how hard to think before answering.
How easy is it to set up?
| Provider | Setup Difficulty | How It Works | Savings |
|---|---|---|---|
| OpenAI | One parameter | Add reasoning_effort: "medium" or "low" to your API call. Works on reasoning-capable models (o-series, GPT-5.5). One line of code. | 30–70% on reasoning tokens |
| Anthropic (Claude) | One parameter | Set budget_tokens to cap thinking, or use the effort parameter (low/medium/high). Affects all extended thinking models. One line of code. | 30–70% on thinking tokens |
| Google Gemini | Model-dependent | Gemini 2.5 Flash/Pro support a thinking_budget parameter to cap reasoning tokens. Not available on all models. | Varies by budget cap |
| Mistral | Not available | Mistral models do not expose a reasoning effort parameter. Cost is determined by model choice alone. | — |
| Microsoft Foundry | One parameter (GPT models) | Same reasoning_effort parameter as OpenAI for Foundry-hosted GPT models. | 30–70% on reasoning tokens |
| Microsoft Phi-4 | Not available | Phi-4 models do not support reasoning effort control. They are small language models designed for efficiency by default. | — |
When to use each level:
| Effort Level | Best For | Examples |
|---|---|---|
| Low | Simple, well-defined tasks where the answer is straightforward | Classification, extraction, formatting, simple Q&A |
| Medium ⭐ | Most production workloads — good balance of quality and cost | Summarization, chat, content generation, standard coding |
| High | Genuinely complex problems requiring deep analysis | Multi-step math, legal reasoning, novel algorithm design, research |
The key insight: most teams default to "high" because they assume more thinking equals better answers. In practice, 80% of production workloads perform identically at "medium". The recommendation is simple — start at medium, only move to high if you measure a quality drop on your specific task. This is a one-line code change with no architectural refactoring needed.
Set max_tokens, remove unnecessary boilerplate, prefer structured outputs for machine-consumed responses. Summarize long documents before sending to expensive models.
AI providers charge per token — roughly one token per word. Every unnecessary word in your prompt costs money going in, and every extra word the model generates costs money coming out (output tokens are typically 3–10× more expensive than input). Most applications waste 20–40% of their token budget on content that does not improve the result.
Think of it like this: you are sending a courier to deliver a message. You pay by the word — both for the instructions you write and the response they bring back. If your instructions include three paragraphs of context the courier does not need, and the response is a five-page essay when a three-line answer would do, you are overpaying for the same outcome.
Five practical techniques:
| Technique | Effort | Savings | How It Works |
|---|---|---|---|
Set max_tokens | One parameter | 10–30% | Cap the response length so the model stops when the answer is complete instead of generating filler. If you need a yes/no answer, set max_tokens to 10 — not 4,000. |
| Use structured output | Small code change | 20–50% | When the response is consumed by code (not humans), request JSON or a specific schema. The model produces compact, parseable output instead of verbose prose. OpenAI, Anthropic, and Gemini all support structured output modes. |
| Trim prompt boilerplate | Prompt review | 10–25% | Audit your prompts for repeated preambles, redundant examples, or overly verbose instructions. Teams often copy-paste prompt templates without removing sections that do not apply. Shorter prompts cost less and often produce better results. |
| Pre-summarize long documents | Pipeline change | 40–80% | Instead of sending a 50-page document to an expensive model, first summarize it with a cheap model (Ministral 3B, Phi-4 mini), then send the summary to the expensive model. You pay nano-tier rates for the bulk processing and flagship rates only for the refined analysis. |
| Use retrieval instead of stuffing | Architecture change | 50–90% | Instead of pasting entire databases or document sets into the prompt, use a retrieval system (RAG) to find only the relevant paragraphs. Sending 3 relevant paragraphs instead of 200 pages reduces input costs by 99%. |
Where the money actually goes:
Output tokens are the hidden cost driver. Across all providers in our catalog, output tokens cost 3× to 10× more than input tokens. A model that generates a 2,000-word essay when a 200-word summary would suffice costs 10× more in output alone. This is why max_tokens and structured outputs have such outsized impact — they directly reduce the most expensive part of every API call.
| Provider | Input $/MTok | Output $/MTok | Output Multiplier |
|---|---|---|---|
| Mistral Small 4 | $0.10 | $0.30 | 3× |
| GPT-5.4 mini | $0.75 | $4.50 | 6× |
| Claude Sonnet 4.6 | $3.00 | $15.00 | 5× |
| GPT-5.5 | $5.00 | $30.00 | 6× |
The bottom line: token optimization is the least glamorous lever, but it compounds with everything else. A team that caches prompts, uses batch, sets a medium reasoning effort, and trims 30% of wasted tokens can reduce their total inference bill by 80–95% compared to a naive implementation using the same model.
Key differentiators not covered in the universal strategies above.
Cohere's cost play is architectural — use Embed + Rerank to reduce candidates before sending to expensive generation models (90%+ token reduction). Pending verified 2026 pricing for inclusion.
The AI Inference Cost Optimizer is a research-driven project that analyzes how organizations can reduce AI inference costs across major cloud providers. As AI adoption accelerates, inference spending is becoming one of the largest and fastest-growing line items in technology budgets — yet most teams lack systematic tools to compare options and identify savings.
This decision assistant is the interactive component of that research. It distills findings from 500+ pages of provider documentation into a single, transparent tool that helps engineering and FinOps teams make informed model selection decisions.
Successful AI applications require balancing three competing objectives:
There is no universal formula. The optimal solution depends on the business requirements, workload characteristics, and acceptable tradeoffs. This tool helps you optimize cost without sacrificing enough quality to matter. It is a rule-based router that explains its reasoning — not a calculator, not a benchmark, and not a recommendation engine that guarantees results.
The dashboard evaluates 16 curated models across 5 providers (Mistral, OpenAI, Anthropic, Google Gemini, Microsoft Foundry). Why 16? It is a deliberately manageable set that covers the models most likely to matter for practical cost comparison, while keeping the rule framework transparent and auditable. The selection prioritizes breadth across price tiers (simple → standard → complex → frontier) over exhaustive catalog coverage.
The model catalog includes:
Cohere is excluded from v0.1 pending verified 2026 generation pricing. Cohere is better framed as a retrieval/rerank provider — its cost play is architectural (reduce tokens sent to expensive generation models), not per-token.
The Routing Impact tab models a different question from the Cost Advisor: not which single model to run, but how much a routing layer cuts the bill when a workload is split across difficulty tiers instead of sent entirely to a frontier model. It reuses the same 16-model catalog read-only and isolates routing — list price only, with no caching, batching, or effort levers — so any saving shown is attributable to routing alone, not stacked with other optimizations.
It covers three routing layers, plus a consolidated comparison:
A closing "one workload, every layer" table compares all of the above on a single workload. Net $/mo is the comparable figure; percentages are each layer measured against its own baseline and are not comparable across rows. Two assumptions are surfaced as standing caveats: the difficulty mix applies equal tokens-per-request across tiers (harder tasks usually emit more output, so this likely overstates savings), and each cheap tier is assumed quality-acceptable for its slice — a judgment the user must validate on real traffic.
Google Cloud is deferred from v0.1 pending a verified Gemini Flash/Pro price snapshot. This is a data gap, not a capability gap: Vertex AI Model Optimizer is a managed, Gemini-scoped router (in preview), not a do-it-yourself approach — it is held back only because its tier models are not yet in the verified catalog.
The Self-host Economics tab answers the question the Cost Advisor's self-host filter leaves open: self-hosting an open-weight model is not a per-token price — it is fixed GPU capacity, so at what monthly volume does running your own GPUs beat paying the API, and is it cheaper to rent or buy those cards? It scopes three axes:
SELFHOST_EXTRA list, not the advisor's MODELS catalog — so the Cost Advisor still runs its validated 16-model set unchanged and this tab never alters a routing recommendation.The core insight it makes visible: self-host is a step function, the API is linear — so the honest output is a break-even, not a flat rate. Below break-even the API wins (the GPU sits idle); above it self-hosting wins — and owning only beats renting if you keep the GPU busy, since idle owned hardware is sunk capital. Every throughput figure carries a measured-vs-estimated provenance tag (the three anchor models are representative of published vLLM throughput; the five additions are interpolated, shown with an est. badge), and Llama 3.3 70B is provisioned tensor-parallel across two cards (TP×2) so its economics are not single-card optimistic. GPU $/hr, purchase prices, and tok/s are all illustrative snapshots sourced in hardware-sources.md; networking, storage, and spot-eviction recovery are out of scope, while engineering/ops time is an optional input (off by default). Validate on your own traffic.
This is a high-level comparison tool for directional guidance only. Pricing is a snapshot (verified 2026-05-31) and may change without notice. Quality assessments are based on self-reported tier classifications, not live benchmarks. The tool does not guarantee that the recommended model will meet your specific accuracy, latency, or compliance requirements. Always verify pricing against current provider documentation and run your own evaluations before committing to a production path. No warranty is expressed or implied.