Get a grip on runaway AI costs

You are not looking for a dashboard. You are looking for control — over spend you did not forecast, from systems that bill by the token and never sleep.

“I can’t see it.” Spend scatters across teams, projects and SKUs. GPU training bills under Compute Engine. A “Vertex AI” filter misses a third of it.
“I can’t cut it without breaking something.” Everyone says route to a cheaper model. Nobody says which queries, or what it does to your accuracy.
“I can’t predict it — or stop it.” An unguarded agent or a leaked key can spend a quarter’s budget over a weekend. You find out on the invoice.
Request an MCP beta key → Or start free — 84 calculators

How this actually works

Two mirrors and a windshield

Most AI-cost tools stop at the first two. Seeing the crash and understanding the crash are not the same as avoiding it.

Rear view

See it

Where the money goes, which team, which project, which feature — and why.

  • Bill diagnose — paste an export, get the cost mix and the first cuts
  • Ledger attribution by feature, customer, model, provider
  • Unifies spend scattered across cloud SKUs
  • Cost per task, per customer, per successful task
Rear view

Cut it

Tokens → RAG → agent loops. The whole chain, not just the model price.

Windshield

Plan it — and stop it

The part nobody else does. Model the cost before you ship, and cap it in production.

Where it plugs in

Three workflows you already have

The engines are not a destination. They run inside the loops your teams already operate.

A pull request triggers a CI job that calls the AICost cost engines; if the projected cost is over budget the build fails, otherwise it merges and the projection is attributed in the Ledger.
Workflow 1 — the surprise never reaches the invoice, because it never reaches production.
1

Cost gate in CI/CD

Platform + engineering leads

A developer opens a PR that adds an AI feature. Your CI job asks AICost what it will cost at projected volume, and fails the build if it blows the budget. The number lands in the PR, where the decision is still cheap to change.

The second-order win: spend gets attributed by team and repo. You can finally answer “is this team’s AI budget buying us productivity, or just tokens?” without reading anyone’s prompts.

# .github/workflows/ai-cost-gate.yml
- name: AI cost gate
  run: |
    curl -sS -X POST https://mcp.aicost.ai/v1/run \
      -H "Authorization: Bearer ${{ secrets.AICOST_KEY }}" \
      -H "Content-Type: application/json" \
      -d '{"engine_id":"aicost.cost-calculator",
           "context":{"project_id":"checkout","unit_economics":{"tasks_per_month":250000}},
           "inputs":{"requests_per_month":250000,"input_tokens_per_request":1800,
                     "output_tokens_per_request":400}}' \
      | tee cost.json
    # fail the build over budget — exit non-zero
    node ci/assert-under-budget.js cost.json --max-usd 4000
An agent run is bounded by the agentic-envelope engine: max cost, steps, tool calls and retries. Within the envelope it continues; outside it, the run stops and escalates to human review. Cost is reported per successful task.
Workflow 2 — an agent that fails three times and succeeds once costs four runs, not one. Finance needs the four.
2

Bound an agent loop

AI platform + product

Ticket triage, research, code fixes — the loop is think → tool → observe, and it burns roughly 50× the tokens of a chat turn. The envelope gives every run a hard ceiling on cost, steps, tool calls, retries and reasoning budget. Exceed it and the run stops and escalates to a human, which is a fallback, not a bill.

Report cost per successful task, not per run. That single distinction is usually the difference between an agent that looks cheap and one that is.

3

RAG in customer support

Support ops + CX

A support bot over your docs is the most common enterprise RAG workload — and the one where the LLM is rarely the biggest line. Embedding the corpus, re-embedding on every doc change, the vector store, the retrieval calls, the context you stuff into each answer: that is the bill.

Model the whole pipeline with rag-pipeline, embedding-cost, vector-db-cost, chunking-optimizer and data-freshness-cost — then get cost per deflected ticket with support-deflection-roi. That is the number your CX lead actually reports.

Integration

You change one thing: your gateway config

No agents to deploy. No cloud credentials to hand over. No data pipeline. If you already run an LLM gateway, you are most of the way there.

Your apps call your existing LLM gateway, which calls your providers. AICost MCP sits alongside: assistants and CI ask it questions, it emits a policy patch your gateway applies, gateway spend logs flow back into the reconcile Ledger, and the Ledger produces proof for finance.
Your stack does not move. AICost adds a control plane beside it.
  1. Connect the endpoint 5 min Add https://mcp.aicost.ai/mcp as a connector in Claude, ChatGPT, Cursor or Perplexity, with your Bearer key. Ask it a question about your spend. That is the whole install.
  2. Set a firewall budget 15 min Run aicost.cost-firewall on one workload with compile_policy: "litellm". You get back budgets, daily hard caps, RPM/TPM limits, a spike-anomaly rule and a kill switch — already in your gateway’s config format.
  3. Paste it into your gateway 20 min Merge policy_patch.compiled.config into litellm-config.yaml, restart, send a request. Exceed the cap and you get an HTTP 402. That is the runaway, stopped, in your own traffic.
  4. Wire the actuals back 45 min Feed gateway spend logs, a FOCUS export, or AWS CUR / Azure Cost Management / GCP BigQuery into ledger_ingest_actuals. Now ledger_reconcile tells you modeled vs actual and what the savings really were.
  5. Standardise the tags ongoing Send tenant_id, project_id, workload_id on every call. Everything downstream — attribution, reconciliation, the QBR report — depends on this and nothing else does the job retroactively.

What we will not do to save you money

Cheap answers are easy. The reason most cost tooling never leaves the pilot is that engineering does not trust it near production traffic. So the policies are constrained by your rules, not ours:

  • No silent model downgrade. The router takes a quality_floor and a max_latency. A cheaper model that fails the floor is never selected — the saving is simply not claimed.
  • No routing across a compliance boundary. Jurisdiction, data residency and vendor allow-lists are inputs, not afterthoughts. See jurisdiction-risk-scorer.
  • No “trust us” numbers. Every output is dated, sourced and confidence-scored. Inferred values are flagged with an asterisk. Savings percentages state the exact spend they apply to — and we tell you when they cannot be added together.
  • No access to your data. The engines model from facts you supply. No cloud credentials, no API keys, no customer data. Ever.
  • Nothing is auto-applied. AICost emits a policy. A human reviews it and your gateway runs it. We never touch your traffic.

Gateways: LiteLLM (recommended — it natively wraps Bedrock, Azure OpenAI and Vertex), Cloudflare AI Gateway, Portkey, Kong. Both compile from the same decision, so pick per client and the envelope is identical. Policy types your gateway cannot express natively arrive under x_aicost_policy for your app layer, rather than being silently dropped.

For MSPs and consultancies

Sell AI cost control as your product

You already manage your clients’ cloud. AI is the line item now exploding on their bill, and almost nobody in the channel has a tool that prevents the runaway, explains it, or proves the fix. This is that tool — under your brand, with your markup, live in a day.

An MSP org issues per-client keys via the admin API. Each client has its own cloud, gateway and firewall budget, with hard tenant isolation between them, and the MSP sees a portfolio roll-up across all clients.
Different clouds, different gateways, different clients — one control plane. Client A cannot see Client B.
Multi-tenant, walledEvery key is scoped to one tenant. Isolation and branding are enforced per credential, not by convention.
Your brand everywhereProduct name, vendor and support URL flow into every response, page and report. Your client never sees ours.
Your priceSet a markup % per tenant. We bill you at cost; the spread is yours, automatically.
Portfolio roll-upSpend across every client, savings realized per client, who is closest to their cap, this month’s QBR — from one place.
Admin API, not ticketsPOST /admin/orgsPOST /admin/keys → set brand, markup, rate limit. Onboard a client in minutes.
Proof that renewsThe reconcile Ledger quantifies what you actually saved them, monthly. That report is why the contract gets signed again.

The demo that closes: the Cost Firewall. A stolen key that ran $82K in 48 hours would have been blocked at a ~$8/day cap on day one. Every client you have felt that story in their chest — and none of them can currently stop it.

Talk to the partner team →

Not just tokens

Your AI runs on a cloud. That bill is usually bigger.

Most teams look at the model bill. The infrastructure underneath it — GPUs, Kubernetes, vector stores, egress, the observability you turned all the way up — is where the rest of the money is.

AWS Bedrock

  • Model Units: on-demand vs provisioned breakeven
  • Knowledge Bases quietly provision OpenSearch — a 2-OCU floor you never asked for
  • Cross-region inference routing
  • CUR ingest → attribution across scattered SKUs

Azure OpenAI

  • PTUs: billed per hour whether or not you use them
  • Spillover policy — PTU → standard on 429
  • Log Analytics ingest bills as monitoring, not AI
  • Cost Management export → attribution

Google Vertex

  • GSU provisioned throughput and its breakeven
  • Bills per character, not per token — naive comparison misleads
  • An idle L4 endpoint costs the same at zero requests
  • BigQuery billing export — catches GPU under Compute Engine

And the infrastructure itself — commitments, Spot, Kubernetes right-sizing, storage tiering, egress paths — lives on our sister site. CostOptimization.ai is a vendor-neutral knowledge base of 37 cloud cost categories, each with a modeled savings range, the specific spend it applies to, the provider action, and the reason you cannot simply add them together.

You get two AI bills. The model bill, and the cloud bill underneath it. Most teams only look at the first one.

Access

Getting a key

MCP access is in beta and keys are issued by hand. That is deliberate — we would rather talk to the first hundred teams than watch a signup form.

  1. RequestTell us your gateway, your rough monthly AI spend, and the one cost question that is bothering you most. Request form or [email protected].
  2. We issueYou get an aicost_sk_… Bearer key scoped to your org. MSPs get an admin key and can then issue their own client keys via POST /admin/keys without asking us.
  3. You connectPaste the key into your MCP client, or use it against POST /v1/run from CI. OAuth via auth.aicost.ai is in progress for ChatGPT and Perplexity.

Keys are per-org and revocable. Rate limits are per-IP and per-tenant. Rotate any time — ask, and the old key dies immediately.

Start where it hurts

If you do not know where your AI spend goes, start with visibility. If you know and cannot stop it, start with the firewall. If you have not shipped yet, start with the windshield — it is the cheapest moment you will ever have.

Request an MCP beta key → Get the $39 Blueprint

99 decision engines · 84 free calculators · no signup for the calculators · [email protected]

📖 Data sources & methodology 158 text models · 9 embeddings · 37 vision · 55 audio · 8 vector DBs across 10 vendor pages · last verified 2026-07-21

Methodology

  • All prices are USD per 1 million tokens, current as of 2026-07-21.
  • Vendor-published values have no mark. Inferred/extrapolated values are marked with * and listed below.
  • Batch API discounts are 50% off standard rates across providers that offer Batch mode.
  • Prompt caching discounts vary by provider (typically 80-90% off cached input tokens).
  • Regional data-residency surcharges (Anthropic 1.1x, OpenAI 1.1x, Google regional tiers) are NOT included in base rates.
  • Long-context pricing tiers apply when input exceeds model threshold.
  • Embedding prices are input-only (no output tokens generated).

Primary sources

Last-verified date is the most recent successful daily snapshot (aicost_pricing_snapshots) or, when no snapshot exists yet, the latest successful crawler run (aicost_crawler_runs). 10 of 10 vendors are currently verified. Aggregator services (TokenCost, AI Pricing Guru, etc.) are not listed.

Anthropic
2026-07-21
https://www.anthropic.com/pricing
Daily snapshot since Sep 2023 · 624 days captured
Anthropic Docs
2026-07-21
https://platform.claude.com/docs/en/about-claude/pricing
Daily snapshot since Sep 2023 · 624 days captured
OpenAI
2026-07-21
https://openai.com/api/pricing/
Daily snapshot since Sep 2023 · 625 days captured
Google AI
2026-07-21
https://ai.google.dev/gemini-api/docs/pricing
Daily snapshot since Dec 2023 · 600 days captured
Google Vertex
2026-07-21
https://cloud.google.com/vertex-ai/generative-ai/pricing
Daily snapshot since Dec 2023 · 600 days captured
DeepSeek
2026-07-21
https://api-docs.deepseek.com/quick_start/pricing
Daily snapshot since May 2024 · 539 days captured
xAI
2026-07-21
https://x.ai/api
Daily snapshot since Nov 2024 · 457 days captured
Mistral
2026-07-21
https://mistral.ai/pricing
Daily snapshot since Dec 2023 · 598 days captured
Cohere
2026-07-21
https://cohere.com/pricing
Daily snapshot since Sep 2023 · 624 days captured

Inferred values (marked with * in calculator tables)

Derived from industry conventions, not directly published by the vendor. Typical conventions: cached input = 10% of base (90% off), Batch API = 50% of base (50% off).

Vendor / Model Field Why it’s inferred
Anthropic — Claude Sonnet 4.6 cachedInput Derived at 10% of input rate — Anthropic publishes 90% cache-hit discount on this tier.
Anthropic — Claude Sonnet 4.5 cachedInput Derived at 10% of input rate; same 90% cache-hit convention as Sonnet 4.6.
Anthropic — Claude Sonnet 4.5 batchInput Derived at 50% of standard input — Anthropic documents uniform 50% Batch discount.
Anthropic — Claude Sonnet 4.5 batchOutput Derived at 50% of standard output — Anthropic documents uniform 50% Batch discount.
Anthropic — Claude Haiku 4.5 cachedInput Derived at 10% of input rate — Anthropic 90% cache-hit discount convention.
OpenAI — GPT-5.4 Mini cachedInput Derived at 10% of input — OpenAI documents automatic 90% discount on cache hits across GPT-5.x tier.
OpenAI — GPT-5.4 Nano cachedInput Derived at 10% of input — OpenAI 90% cache-hit convention.
OpenAI — GPT-5.4 Nano batchInput Derived at 50% of input — OpenAI Batch API uniform 50% discount.
OpenAI — GPT-5.4 Nano batchOutput Derived at 50% of output — OpenAI Batch API uniform 50% discount.
OpenAI — GPT-5.4 Pro cachedInput Derived at 10% of input — OpenAI 90% cache-hit convention.
OpenAI — GPT-5.4 Pro batchInput Derived at 50% of input — OpenAI Batch API uniform 50% discount.
OpenAI — GPT-5.4 Pro batchOutput Derived at 50% of output — OpenAI Batch API uniform 50% discount.
OpenAI — GPT-5.2 cachedInput Derived at 10% of input; no residency uplift.
OpenAI — GPT-5.2 batchInput Derived at 50% of input.
OpenAI — GPT-5.2 batchOutput Derived at 50% of output.
OpenAI — GPT-5 cachedInput Derived at 10% of input.
OpenAI — GPT-5 batchInput Derived at 50% of input.
OpenAI — GPT-5 batchOutput Derived at 50% of output.
OpenAI — GPT-5.5 Pro cachedInput Derived at 10% of input — OpenAI does not publish a cached rate for *-pro models; using the family convention.
OpenAI — GPT-5.5 Pro batchInput Derived at 50% of input.
OpenAI — GPT-5.5 Pro batchOutput Derived at 50% of output.
OpenAI — GPT-5.2 Pro cachedInput Derived at 10% of input — pro-tier convention.
OpenAI — GPT-5.2 Pro batchInput Derived at 50% of input.
OpenAI — GPT-5.2 Pro batchOutput Derived at 50% of output.
OpenAI — GPT-5.1 batchInput Derived at 50% of input.
OpenAI — GPT-5.1 batchOutput Derived at 50% of output.
OpenAI — GPT-5 Pro batchInput Derived at 50% of input.
OpenAI — GPT-5 Pro batchOutput Derived at 50% of output.
OpenAI — GPT-5 Nano cachedInput Derived at 10% of input.
OpenAI — GPT-5 Nano batchInput Derived at 50% of input.
OpenAI — GPT-5 Nano batchOutput Derived at 50% of output.
Google — Gemini 3 Flash cachedInput Derived at 10% of input — Google caching discount convention ~90%.
Google — Gemini 3.1 Flash-Lite cachedInput Derived at 10% of input — Google caching convention.
Google — Gemini 3.1 Flash-Lite batchInput Derived at 50% of input — Google Batch API uniform 50% discount.
Google — Gemini 3.1 Flash-Lite batchOutput Derived at 50% of output — Google Batch API uniform 50% discount.
Google — Gemini 2.5 Pro cachedInput Derived at 10% of input.
Google — Gemini 2.5 Flash cachedInput Derived at 10% of input.
Google — Gemini 2.5 Flash-Lite cachedInput Derived at 10% of input — Google caching convention.
Google — Gemini 2.5 Flash-Lite batchInput Derived at 50% of input — Google Batch API uniform 50% discount.
Google — Gemini 2.5 Flash-Lite batchOutput Derived at 50% of output — Google Batch API uniform 50% discount.
Google — Gemini 2.0 Flash cachedInput Derived at 25% of input per Google 2.0 family caching rates.
Google — Gemini 2.0 Flash batchInput Derived at 50% of input — Google Batch API uniform 50% discount.
Google — Gemini 2.0 Flash batchOutput Derived at 50% of output — Google Batch API uniform 50% discount.
Google — Gemini 2.0 Flash-Lite cachedInput Derived at 10% of input — Google caching convention.
Google — Gemini 2.0 Flash-Lite batchInput Derived at 50% of input — Google Batch API uniform 50% discount.
Google — Gemini 2.0 Flash-Lite batchOutput Derived at 50% of output — Google Batch API uniform 50% discount.
xAI — Grok 4 (legacy) cachedInput Extrapolated at 25% of base.

Pricing is cross-verified against the LiteLLM community registry when available. Daily snapshots are kept in aicost_pricing_snapshots; every change is logged to aicost_price_changelog with old & new values for full audit trail. Read the full methodology →