FinOps · AI v0.1 · prototype

AI Inference Cost Optimizer

Describe your workload. Get the cheapest viable model, the savings breakdown, and the logic behind it.

pricing · 2026-05-31
providers · 5
models · 16
rules engine ready
Recommended path

Frontier baselineWhat it would cost using the most expensive frontier model (GPT-5.5) at list price, with no optimizations applied. This is your worst-case reference point.
GPT-5.5 real-time, no opt
Monthly savingsThe difference between the frontier baseline and the recommended path. This is how much you save per month by following the engine's recommendation.
vs frontier
$0 recommended baseline

Top eligible candidates

Provider Model Tier Eff. input $/M Eff. output $/M Monthly

Cost levers applied

Decision trace

Routing Impact — native hyperscaler routing

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.

Shared workload · drives both cards
01Monthly volume — input & output
Million tokens
Million tokens
02Difficulty mix — pick easy & intermediate; difficult auto-fills
= 100%
03Request size
drives AWS & recommender fees

Native — in-cloud routingEach cloud's own router, in its own billing boundary, against its own frontier model. The same workload priced by each cloud's native router — figures are specific to each cloud and are not comparable across clouds.

AWS Bedrock · Intelligent Prompt Routing · in-family (Claude)

Frontier baseline

Per-tier breakdown

TierModelShare$/M in$/M outMonthly
Azure AI Foundry · Model Router · cross-family (within Azure)

Frontier baseline

Per-tier breakdown

TierModelShare$/M in$/M outMonthly
Google deferred. Vertex AI Model Optimizer (preview) is a managed, Gemini-scoped router — not DIY — but is deferred here pending a verified Gemini Flash/Pro price snapshot.

Cross-provider gateway — route across vendorsOne configurable gateway across vendors.

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.

Gateway configuration · route each tier to any provider's model
% of routed spend
Cross-provider gateway · route across vendors

Frontier baseline

Per-tier breakdown

TierModelShare$/M in$/M outMonthly

Specialist recommender — sits behind the gatewayA learned, per-request model picker that plugs in behind the gateway.

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.

Specialist recommender · break-even vs the gateway's free routing

One workload, every layerNet $/mo is comparable across rows — same workload. Percentages are each layer against its own baseline and are not comparable to each other.

Net $/mo is the honest cross-layer number. The % column is each layer measured against its own baseline (each native vs its own frontier; the gateway vs your difficult-tier pick; the recommender vs the gateway's free routing) and is not comparable across rows.
LayerBaselineRoutedFeeNet $/mo% off own baseline
Always: list price only · cost structure, not quality (a misroute means rework — validate on real traffic) · per-cloud baseline, figures not comparable across clouds · AWS in-family ceiling · AWS routing-request count is derived from input volume at ~1,000 input tokens/request · all vendor figures vendor-stated, verified on primary pages on the build date · Azure $0.14 is tracker-derived · assumes equal tokens-per-request across tiers; harder tasks usually emit more output/reasoning tokens that load the expensive tier, so this likely overstates savings.

Self-host Economics — the GPU break-even

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.

How this is calculated
API monthly = your token volume × the API’s list $/MTok. Grows every time you use it.
Rent monthly = GPUs needed × rental $/hr × 730 hr. A fixed bill once the GPUs are on — busy or idle.
Buy monthly = GPUs needed × (amortized purchase + power×PUE + hosting) × 730 hr. The card’s price spread over the useful life you set, plus power and a slot to run it in.

“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.

What’s included, what’s excluded & the key assumptions

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.

Self-host configuration · run an open-weight model on rented or owned GPUs
Million tokens / mo
Million tokens / mo
sustained batch efficiency
GPUs always on
USD / mo · people cost (rent & buy)
Buy / owned-GPU assumptions — drive the “Buy” column · illustrative defaults, edit freely · price & TDP auto-fill from the GPU above
USD per card
years to amortize the card
watts, before PUE
USD / kWh
× power for cooling/loss
USD / GPU / month
“Why aren’t GPT / Claude / Gemini here?” Because you can’t self-host a model whose weights the vendor never releases — those are API-only. This tab lists open-weight models with a throughput figure behind the math — measured where we have it, otherwise a clearly-labeled illustrative estimate (interpolated by model size; see hardware-sources.md). Today that’s Mistral Small 4, Phi-4 mini, and Phi-4 — it expands as we source more.
Headline

API · pay-per-tokenlowest
Rent GPUs · monthlylowest
Buy GPUs · amortized/molowest
Rent break-even vs API
Buy break-even vs API
GPUs needed
Utilization
Throughput
Rent (fixed GPU step) Buy · owned (amortized) API (scales with use) Break-even vs API
Always: GPU $/hr and tok/s are illustrative snapshots (cited in hardware-sources.md), not quotes · spot = preemptible (eviction/restart overhead not modeled) · throughput varies with precision / batch / sequence length — validate on your own traffic · break-even holds the input:output ratio fixed · this models a cost structure, not a guarantee, and ignores networking/storage; engineering/ops time is an optional input (off by default).

Methodology — three independent calculators

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.

How the Decision Engine Works

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.

Rule 1 — Async or Real-time?

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.

Rule 2 — Simple or Complex?

The quality bar and task type together set a tier band [min, max] for eligible models. Two floors apply — the higher one wins:

QualityMin TierMax Tier
Good-enough12
Production23
High34
Frontier44

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.

Rule 3 — Repeated Context or One-off?

Sets the cache hit rate for models that support prompt caching:

Reuse PatternCache Hit RateEffect
One-off0%Caching disabled
Repeated prefix70%System prompts, few-shot scaffolding
Heavy document reuse90%Same document referenced repeatedly

Cached input is priced at ~10% of base rate. Formula: eff_input = (1 − hit) × base + hit × cached_rate

Rule 4 — Compliance or Residency Need?

Filters the candidate set by data residency or deployment constraint:

  • None — all providers eligible, no premium
  • US residency — filter to US/global providers, +10% premium
  • EU residency — filter to EU-eligible providers only
  • Self-host — filter the advisor's routing candidates to open-weight models only (Mistral Small 4, Phi-4 mini, Phi-4). The separate Self-host Economics tab models a broader what-if catalog — Llama, Qwen and Gemma too — that is not part of advisor routing.

If compliance leaves an empty candidate set, the engine returns an error rather than silently relaxing constraints.

Rule 5 — Bursty or Steady-state?

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.

Rule 6 — Lowest-cost Eligible Model

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.

Cost Levers

LeverWhen It FiresImpact
Batch processingAsync latency + model supports batch−50% both input & output
Prompt cachingRepeated/heavy reuse + model supports cacheUp to −90% on cached input
Reasoning effortQuality ≠ frontier + model has effort param−35% output tokens
Right-sizingWinner is below frontier tierVaries (50–95% vs baseline)
Self-host accountingOpen-weight model selectedFixed compute vs per-token
Residency premiumUS compliance required+10% on all rates

Data Schema

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).

Input Dimensions

FieldValuesPurpose
taskclassification, extraction, chat, summarization, reasoning, coding, agentDetermines minimum model tier
latencyrealtime, near, asyncEnables/disables batch lever
reuseoneoff, repeated, heavySets cache hit rate (0/70/90%)
contextsmall, medium, largeFlags context-size warnings
qualitygood-enough, production, high, frontierSets quality tier floor
compliancenone, us, eu, selfhostFilters providers, applies premiums
throughputlow, bursty, steadyTriggers PTU recommendations

Output Structure

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.

Baseline Definition

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.

Invariants

  • Empty candidate set → error (never silently relaxes constraints)
  • Lower tier wins at equal effective rates (monotonicity)
  • Batch reduces both input and output equally
  • Caching applies only to input tokens — output is never cached
  • Effort reduces output volume, not output rate
  • Residency premium multiplies both input and output rates
  • Trace order always matches rule order
  • Savings is always baseline − recommended (never negative-as-positive)

Model Catalog (16 Models)

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.

ProviderModelTierInput $/MOutput $/MCacheBatchSelf-host
MistralMinistral 3BT1$0.10$0.10
MistralMistral Small 4T2$0.10$0.30
MistralLarge 3T3$0.50$1.50
MistralCodestralT2$0.30$0.90
OpenAIGPT-5.4 nanoT1$0.20$1.25
OpenAIGPT-5.4 miniT2$0.75$4.50
OpenAIGPT-5.4T3$2.50$15.00
OpenAIGPT-5.5T4$5.00$30.00
AnthropicClaude Haiku 4.5T1$1.00$5.00
AnthropicClaude Sonnet 4.6T3$3.00$15.00
AnthropicClaude Opus 4.8T4$5.00$25.00
Google GeminiGemini 3.5 Flash-LiteT1$0.25$1.50
Microsoft FoundryFoundry GPT-5.4 miniT2$0.75$4.50
Microsoft FoundryFoundry GPT-5.4T3$2.50$15.00
Microsoft FoundryPhi-4 miniT1$0.075$0.30
Microsoft FoundryPhi-4T2$0.125$0.50

What the Routing Impact tab models

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%).

The three routing layers

1 — Native (in-cloud) routing

Each hyperscaler’s own managed router, measured against that cloud’s own frontier model:

  • AWS Bedrock — Intelligent Prompt Routing, in-family only, $1.00 / 1,000 requests, vendor claim “up to 30%”. Uses the Claude ladder Haiku 4.5 → Sonnet 4.6 → Opus 4.8.
  • Azure AI Foundry — Model Router, cross-family within Azure, ~$0.14 / 1M input tokens, no headline savings figure. Uses GPT-5.4 nano → GPT-5.4 → GPT-5.5.

2 — Cross-provider gateway

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.

3 — Specialist recommender

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.

The comparison & its baselines

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.

Key assumptions & caveats

  • Equal tokens-per-request across tiers. Harder tasks usually emit more output, so a flat token count per tier likely overstates routing savings.
  • Each cheap tier is assumed quality-acceptable for its slice of traffic — a judgment you must validate on real traffic.
  • List price only. No caching, batch, or effort levers — those belong to the Cost Advisor and would stack on top of routing.
  • 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, held back only because its tier models aren’t yet in the verified catalog.

What the Self-host Economics tab models

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).

The three cost lines

LineMonthly formulaBehaviour
APIvol_out × list $/MTokLinear — grows every time you use it.
Rentgpus_needed × rental $/hr × 730Fixed once the GPUs are on — busy or idle.
Buygpus_needed × owned $/hr × 730Fixed; 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.

Capacity — how “GPUs needed” is derived

“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

  • VRAM feasibility. A model only appears on a GPU it actually fits; oversized pairs (e.g. a 32B or 70B on a 24 GB L4) are reported infeasible rather than silently mispriced.
  • Tensor parallelism (TP×2). Llama 3.3 70B carries 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. Input (“prefill”) tokens are counted at a fraction of an output token (prefill_factor) and folded into the output-equivalent load.

Buy — owned $/hr amortization

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

  • Card — purchase price spread over a useful life you set (8766 = hours/year).
  • Power — board TDP × electricity price × a cooling/overhead factor (PUE).
  • Hosting — a flat server/colo/ops slice per GPU.

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.

Break-even — step function vs linear

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.

Provenance & honesty

  • Measured vs estimated. Every throughput row carries a 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.
  • Included: GPU capital amortized over its life, electricity × PUE, a flat hosting slice per GPU, the API’s list price for the same volume, and an optional engineer / ops $/mo (off by default) added to both self-host lines.
  • Excluded: networking, storage, data egress, spot-eviction/restart overhead, and any model-quality difference. Engineers’ time is excluded by default, but can be added via the optional engineer / ops $/mo input. At small scale these usually dwarf the rent-vs-buy gap.
  • Snapshots, not a feed. Every GPU $/hr, purchase price, and tok/s is an illustrative snapshot sourced in hardware-sources.md; re-verify before any external use.

Validation

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.

Quick-Start Action List

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.

#ActionSavingsEffort
1Switch to batch API for non-real-time50%Low
2Enable prompt caching (structure prompts correctly)75–90% inputLow
3Downsize model (test quality with cheaper)50–95%Medium
4Use effort=medium instead of high30–70%Low
5Set max_tokens appropriately10–30%Low
6Use Mistral/Gemini/Phi-4 for simple tasks80–95% vs frontierLow
7Implement model cascade (cheap → expensive)60–80%High
8PTU/Reserved for steady-state (Microsoft)20–40% vs on-demandMedium
9Compaction for long conversations (Claude)40–60%Low
10Self-host open-weight models (Llama, Qwen, Mistral, Phi, Gemma)50–90% at scaleHigh

Cost Optimization Strategies

These techniques apply across all AI providers. Applying them in combination produces compound savings.

1. Model Right-Sizing (50–95% 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.

📌 The Single Biggest Cost Decision You Will Make

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:

  • Starting at the top — teams prototype with the most powerful model (GPT-5.5, Claude Opus) and never test whether a cheaper model works just as well
  • Assuming bigger is always better — for structured tasks like classification, extraction, and formatting, smaller models often perform identically to flagship models
  • Fear of quality loss — in practice, most teams that test cheaper models find the quality difference is undetectable for 70–80% of their workloads
  • No evaluation process — without measuring quality (even informally), there is no evidence that the expensive model is actually better for your specific use case

The right-sizing process:

StepActionWhat You Learn
1Run your workload on the cheapest eligible modelBaseline cost and quality floor
2Spot-check 20–50 outputs for qualityWhether the cheap model is "good enough"
3If quality is acceptable — stop here, you are doneMost teams stop at this step
4If quality falls short, move up one tier and repeatThe minimum model tier that meets your bar

Model tiers and when to use them:

Task ComplexityRecommended TierExample ModelsMonthly Cost at 100M in / 20M out
Simple (classification, extraction)Nano / MiniMinistral 3B, Phi-4 mini, GPT-5.4 nano, Flash-Lite$12 – $35
Standard (chat, summarization)Mid-tierMistral Small 4, Phi-4, GPT-5.4 mini$16 – $165
Complex (reasoning, coding)StandardGPT-5.4, Claude Sonnet 4.6, Mistral Large 3$80 – $550
Frontier (research, deep analysis)FlagshipGPT-5.5, Claude Opus 4.8$1,000 – $1,100

2. Batch Processing (50% savings)

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).

📌 The Easiest 50% You Will Ever Save

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 TypeBatchable?Why
Chatbot responding to live usersNoUsers are waiting — they need a response in seconds
Nightly document processingYes ✅Nobody is waiting — results needed by morning, not right now
Labeling a backlog of 10,000 recordsYes ✅Bulk operation, no real-time requirement
Generating weekly reportsYes ✅Scheduled task — hours of delay are fine
Content moderation queueMaybeDepends on SLA — if 1-hour turnaround is acceptable, batch works
Real-time search assistantNoUser expects instant answers
Data extraction from uploaded filesYes ✅User uploads a file and checks back later — no need for instant processing

How easy is it to set up?

ProviderSetup DifficultyHow It WorksDiscountTurnaround
OpenAIEasyUpload a JSONL file of requests, submit as a batch. Poll for completion or use a webhook.50% offUp to 24 hours
Anthropic (Claude)EasyMessage Batches API — submit up to 10,000 requests. Results returned in a single response object.50% offUp to 24 hours
Google GeminiEasyBatchGenerateContent API. Also supports a "Flex" mode with shorter turnaround at similar discounts.50% offUp to 24 hours
MistralEasyBatch inference API — upload JSONL, retrieve results when ready.50% offUp to 24 hours
Microsoft FoundryEasyGlobal Batch deployment — same OpenAI batch format, processed on Azure infrastructure.50% offUp 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.

3. Prompt Caching (75–90% input savings)

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.

📌 Why Prompt Caching Matters Most

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?

ProviderSetup DifficultyHow It WorksDiscount
OpenAIAutomatic — zero effortAny repeated prompt prefix over 1,024 tokens is cached automatically. No code changes needed.50% off cached input
Google GeminiAutomatic + optional manualImplicit caching works automatically. Explicit caching (for precise control) takes ~5 lines of code.75% off cached input
Anthropic (Claude)Small code changeAdd 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)
MistralNot availableNo caching API. However, base rates are already so low that this gap rarely changes the cost winner.
Microsoft FoundryAutomatic (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-4Not availablePhi-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:

  • Put static content first — system instructions, policies, reference documents, and few-shot examples should always appear at the beginning of the prompt
  • Put dynamic content last — the user's specific question or input should come at the end
  • Keep prefixes identical — even small differences (extra spaces, reworded instructions) break the cache and you pay full price again
  • Reuse large documents — if you send the same 50-page policy document with every question, caching turns a $500/month cost into $50/month

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.

4. Reasoning Effort Control (30–70% savings)

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.

📌 Understanding Reasoning Effort

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?

ProviderSetup DifficultyHow It WorksSavings
OpenAIOne parameterAdd 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 parameterSet 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 GeminiModel-dependentGemini 2.5 Flash/Pro support a thinking_budget parameter to cap reasoning tokens. Not available on all models.Varies by budget cap
MistralNot availableMistral models do not expose a reasoning effort parameter. Cost is determined by model choice alone.
Microsoft FoundryOne parameter (GPT models)Same reasoning_effort parameter as OpenAI for Foundry-hosted GPT models.30–70% on reasoning tokens
Microsoft Phi-4Not availablePhi-4 models do not support reasoning effort control. They are small language models designed for efficiency by default.

When to use each level:

Effort LevelBest ForExamples
LowSimple, well-defined tasks where the answer is straightforwardClassification, extraction, formatting, simple Q&A
MediumMost production workloads — good balance of quality and costSummarization, chat, content generation, standard coding
HighGenuinely complex problems requiring deep analysisMulti-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.

5. Token Optimization (10–30% savings)

Set max_tokens, remove unnecessary boilerplate, prefer structured outputs for machine-consumed responses. Summarize long documents before sending to expensive models.

📌 Why Every Token Counts

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:

TechniqueEffortSavingsHow It Works
Set max_tokensOne parameter10–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 outputSmall code change20–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 boilerplatePrompt review10–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 documentsPipeline change40–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 stuffingArchitecture change50–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.

ProviderInput $/MTokOutput $/MTokOutput Multiplier
Mistral Small 4$0.10$0.30
GPT-5.4 mini$0.75$4.50
Claude Sonnet 4.6$3.00$15.00
GPT-5.5$5.00$30.00

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.

Provider Quick Reference

Key differentiators not covered in the universal strategies above.

Mistral

  • Lowest per-token rates in the catalog — dominant cost leader at tiers 1–3
  • Small 4 is open-weight (Apache 2.0) — self-hostable for fixed-cost deployment at scale
  • Codestral: purpose-built for code generation at 3× cheaper output than GPT-5.4 mini

OpenAI

  • Widest model range (nano → flagship) — easiest provider to right-size within one ecosystem
  • Regional residency adds ~10% premium for models released March 2026+
  • Strongest structured output support — best for machine-consumed JSON responses

Anthropic (Claude)

  • Best effort control granularity (low → max) — affects tool calls and thinking, not just output
  • Especially attractive for agentic workflows with heavy prompt reuse (caching + effort compound well)
  • Opus 4.7+ uses a new tokenizer: up to 35% more tokens for equivalent text — factor into migration estimates

Google Gemini

  • Flash-Lite 3.5 is a strong low-cost option for high-volume simple tasks
  • Four pricing tiers (Standard, Batch, Flex, Priority) — most flexible billing model
  • Flash and Pro models omitted from v0.1 pending verified pricing

Microsoft Foundry

  • OpenAI models with EU residency — not available on direct OpenAI
  • Provisioned Throughput (PTU): fixed hourly capacity, cheaper above ~60–70% utilization; cached tokens are FREE on PTU
  • Phi-4 models: Microsoft-native SLMs, open-weight (MIT), self-hostable — Phi-4 mini has the cheapest input rate in the catalog ($0.075/MTok)

Cohere (Excluded from v0.1)

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.

About This Project

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.

What This Tool Does

Successful AI applications require balancing three competing objectives:

Accuracy
Model quality & output correctness
Latency
Response time & user experience
$
Cost
Per-token spend & infrastructure

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.

Scope & Model Selection — Cost Advisor

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:

  • Mistral — 4 models: Ministral 3B, Small 4, Large 3, Codestral
  • OpenAI — 4 models: GPT-5.4 nano, GPT-5.4 mini, GPT-5.4, GPT-5.5
  • Anthropic — 3 models: Claude Haiku 4.5, Claude Sonnet 4.6, Claude Opus 4.8
  • Google Gemini — 1 model: Gemini 3.5 Flash-Lite (only model with verified pricing)
  • Microsoft Foundry — 4 models: Foundry GPT-5.4 mini, Foundry GPT-5.4, Phi-4 mini, Phi-4

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.

Scope, Model & Provider Selection — Model Routing

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:

  • Native (in-cloud) routing — each hyperscaler's own managed router, measured against that cloud's own frontier model. AWS Bedrock (Intelligent Prompt Routing: in-family only, $1.00 / 1,000 requests, vendor claim "up to 30%") uses the Claude ladder Haiku 4.5 → Sonnet 4.6 → Opus 4.8; Azure AI Foundry (Model Router: cross-family within Azure, ~$0.14 / 1M input tokens, no headline savings figure) uses GPT-5.4 nano → GPT-5.4 → GPT-5.5.
  • Cross-provider gateway — one configurable gateway that can route each tier to any model in the catalog, across vendors, under four fee models (percentage markup, zero-markup BYOK, flat subscription, or self-host). The per-tier model is a user choice because the cost/quality tradeoff is the user's to make: the gateway classifies how hard each request is, but the human sets which model serves each tier — it does not auto-pick the cheapest.
  • Specialist recommender — 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; 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.

Scope, Model & GPU Selection — Self-host Economics

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:

  • Models — 8 open-weight: the three self-hostable advisor models (Phi-4 mini, Phi-4, Mistral Small 4) plus five popular community additions (Llama 3.1 8B, Qwen2.5 7B, Gemma 2 9B, Qwen2.5 32B, Llama 3.3 70B). The five live in a separate 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.
  • GPUs — 4 cards: NVIDIA L4, A10G, A100-80GB, H100-80GB. A model only appears on a GPU it actually fits in VRAM; oversized pairs (e.g. a 32B or 70B on a 24 GB L4) are reported infeasible rather than silently mispriced.
  • Rent vs Buy: Rent uses on-demand / spot / neocloud $/hr; Buy amortizes a card's purchase price over a useful life and adds power (TDP × $/kWh × PUE) and flat hosting. The tab shows API, Rent, and Buy side by side, with a break-even output volume for each versus the API.

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.

Disclaimer

⚠ Important

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.

JSON result