Cost per feature for Claude, OpenAI, Gemini and 20+ providers
See which feature is spending your AI tokens
Provider dashboards show one total. AI Cost Map splits it by feature, with a few lines next to each AI call.
Free up to 50,000 AI calls a month. No card needed.
Set it up with your coding agent
Paste one prompt into Claude Code, Cursor, Codex or any agent in your repository. It installs the SDK, proposes a feature tree for you to approve and labels every AI call.
Or run npx aicostmap init
AI cost by feature · this month
ExampleTotal
$4,812.50
- posts.generate$2,206.3046%
- posts.refine$1,312.4027%
- posts.refine.tone$704.1015%
- users.rate$1,293.8027%
Works with the providers and SDKs you already use
- Anthropic Claude
- OpenAI
- Google Gemini
- xAI Grok
- Mistral
- DeepSeek
- Meta Llama
- Cohere
- Groq
- Together AI
- Fireworks AI
- Perplexity
- OpenRouter
- AWS Bedrock
- Azure OpenAI
- Alibaba Qwen
- Moonshot AI
- Vercel AI SDK
2,205 models from 25 providers have prices, updated daily. See all model prices
The problem
Your AI bill is one number. Your product is many features.
A social product makes separate Claude calls to generate posts, rate users and refine posts. The provider console adds them into one total. It cannot tell you which feature spent the tokens, so you cannot tell which one to fix.
AI Cost Map labels each call with the feature that made it. The dashboard then splits the bill by feature, model and day.
Provider console · usage this month
ExampleTotal spend, all API keys
$4,812.50
- posts.generate?
- posts.refine?
- users.rate?
AI Cost Map · same month
By feature- posts.generate46%
- posts.refine27%
- users.rate27%
How it works
Let the agent do the setup for you
Paste it into your coding agent. Or do the four steps below yourself.
Step 1: Install
Installs the SDK and an Agent Skill for your coding agent.
npx aicostmap initStep 2: Wrap your client
Same client, same types. The SDK reads the usage object of each response.
acm.wrap(new Anthropic())Step 3: Label the feature
Every AI call inside the scope gets the feature label.
acm.scope({ feature: "posts.generate" }, …)Step 4: See cost per feature
The dashboard splits your AI bill by feature, model and day, with prices that update daily.
Feature tree
Every feature has its own cost
Feature labels are dot paths, so they form a tree. You see the cost of a whole area, for example posts, and of each part of it.
Features · this month
Example| Feature | Calls | AI cost | Share | Trend |
|---|---|---|---|---|
| posts | 278,500 | $3,518.70 | 72% | |
| posts.generate | 182,400 | $2,206.30 | 45% | |
| posts.refine | 96,100 | $1,312.40 | 27% | |
| posts.refine.tone | 61,800 | $704.10 | 15% | |
| users.rate | 410,900 | $1,293.80 | 27% | |
| untagged | 3,200 | $41.60 | 0.9% |
Nested features
posts.refine.tone rolls up into posts.refine and posts.
Untagged calls
Calls with no label show as untagged, so you can find them.
Cost per call
Average cost and tokens per call for each feature.
Daily trend
See when a feature started to cost more.
Models and tokens
See which model each feature uses
One feature can call more than one model. See the model mix of each feature, and how much of the cost is input, output and cache.
Model mix per feature · this month
Example- claude-sonnet-5-5
- claude-haiku-5-5
- gpt-6.1-sol
posts.generate · cost by token type
- Input38%
- Output49%
- Cache read9.0%
- Cache write4.0%
Versioned prices
Cost uses the price that was in effect on the day of the call.
Cache and batch
Cache reads, cache writes and batch discounts are in the price.
Long-context tiers
Calls above a tier threshold use the higher rates.
20+ providers
One view for all providers, with the same feature labels.
Budgets and alerts
Know when a feature costs more than you planned
Set a monthly budget for a feature. Get an email or a Slack message when it reaches the thresholds that you choose.
Budget alert · posts.generate
Example$2,206.30 of $2,500.00 this month
88% used- Forecast for the month
- $2,890.00 (over budget)
- Thresholds
- 80% sent · 100% waiting
Budget per feature
A limit for posts.generate, another for users.rate.
Your thresholds
50%, 80%, 100% or 120% of the budget.
Email and Slack
Send the alert to the team that owns the feature.
Privacy
Your prompts never leave your servers
The SDK reads the usage object of the provider response. It sends counts and labels only. The code on the right is the complete payload of one call.
We receive
- Provider and model
- Token counts by type
- Feature and environment
- Your tags (max 10)
- Status and latency
Never sent
- Prompts and system prompts
- Model outputs
- Tool arguments and results
- Files, images, embeddings
- Provider API keys
The server calculates cost from the token counts. The SDK never blocks your AI call and never throws.
{
"id": "0199e3c4-8a1e-7b3d-9c2f-5e6a7b8c9d0e",
"timestamp": "2026-10-14T09:21:07.412Z",
"provider": "anthropic",
"model": "claude-sonnet-5-5",
"apiFormat": "anthropic",
"operation": "chat",
"usage": {
"inputTokens": 1840,
"outputTokens": 412,
"cacheReadTokens": 5210,
"cacheWriteTokens": 0
},
"labels": {
"feature": "posts.generate",
"environment": "production",
"tags": {
"plan": "growth"
}
},
"status": "ok",
"latencyMs": 2310,
"streamed": true
}Setup with your AI agent
Your coding agent adds the labels
Copy one prompt into your coding agent. It runs npx aicostmap init, which installs the SDK and writes an Agent Skill for Claude Code and an AGENTS.md section for Cursor, Codex and other agents. Then the agent does these steps:
- 1Find all AI call sites and client constructors.
- 2Propose a feature tree, for example posts.generate and posts.refine.tone, and ask you to approve it.
- 3Wrap each client where it is constructed.
- 4Add scope() at entry points: route handlers, server actions, queue jobs and cron jobs.
- 5Run npx aicostmap verify until it reports full coverage.
Paste it into your coding agent. It runs every step below.
npx aicostmap verify
# in CI: fail the build on gaps
npx aicostmap verify --cinpx aicostmap verify scans your code for clients with no wrapper and calls with no feature.
Pricing
Pay for AI calls, not seats
Free
$0
50k AI calls / month
Pro
$49per month
1M AI calls / month
Team
$199per month
10M AI calls / month
Questions
What is a feature?
A feature is a label in dot path form, for example posts.generate, users.rate or posts.refine.tone. You add it next to an AI call with scope(). The dashboard builds a tree from the paths, so posts.refine.tone also counts in posts.refine and in posts.
Does AI Cost Map see my prompts or model outputs?
No. The SDK reads the token counts from the provider response and sends counts and labels only: provider, model, token counts, feature, environment and your tags. Prompts and outputs stay on your servers.
How is the cost calculated?
The server multiplies the token counts by the model price that was in effect at the time of the call. Prices are versioned and include cache reads, cache writes, batch discounts and long-context tiers. The SDK never calculates cost.
Which providers are supported?
Every provider with token prices. The SDK has adapters for the OpenAI, Anthropic, Gemini, Bedrock Converse and Cohere API formats, Vercel AI SDK middleware, and a manual track() call. OpenAI-compatible providers such as Groq, DeepSeek, Mistral and Together are detected from the base URL.
Does it slow down my AI calls?
No. The SDK never blocks or throws. It sends events in background batches after the response, with waitUntil on Vercel, and it fails open if the ingest API is not available.
How does setup with an AI agent work?
Run npx aicostmap init. It installs the SDK and writes an Agent Skill for Claude Code and an AGENTS.md section for other agents. The agent finds your AI calls, wraps the clients, adds feature labels, and runs npx aicostmap verify until every call has a feature.
Do I need a credit card for the Free plan?
No. The Free plan needs no card and includes 50,000 AI calls a month. New accounts also get a 14-day Pro trial.
See which feature spends your tokens
Free up to 50,000 AI calls a month. No card needed.