A complete, shareable reference for building, deploying, and operating AI agent systems. Every concept explained, every trade-off quantified, cost calculators included.
Interactive calculators covering every cost layer of an agentic system — LLM tokens, embeddings, vector DB, infra, and retries. Update any price field to keep calculations accurate as models change.
Full-Stack Per-Request Cost Calculator
Every cost layer included: LLM tokens, prompt caching, embedding lookups, vector DB queries, retry overhead, and multi-agent multiplier. Select a model preset or edit prices directly.
Input $/M tokens
Output $/M tokens
Cache input $/M tokens
Embedding $/M tokens
✏️ Edit to use current pricing
🧠 LLM Token Layers
500tokens — static, cacheable
1,500tokens — retrieved chunks
300tokens
500tokens
3LLM calls per agent request
70%of system prompt served from cache
🔍 Retrieval & Embedding Layers
300tokens — query embedding at inference
3× $0.00004 each (e.g. Pinecone)
⚙️ Overhead & Infra Layers
0.2avg extra LLM calls per request
00 = single agent mode
$0.50compute, storage, egress per 1K reqs
Cost Breakdown
LLM token cost / request
all iterations, after caching
-
Embedding cost / request
query embedding at inference
-
Vector DB cost / request
read operations
-
Retry overhead cost
avg extra calls
-
Multi-agent overhead
sub-agent calls
-
Totals
Total cost / request
all layers combined
-
Cost per 1,000 requests
-
Monthly (100K req/day)
-
Infra cost / month
100K req/day × 30 days
-
Cache saves vs no cache
per 1,000 requests
-
LLM % of total cost
-
Monthly Budget Projector
Forecast monthly spend across LLM, embedding, vector DB, and infra — with model mix routing factored in.
1,000users/day
5requests
0.20¢use value from calculator above
20%rest use standard/cheap model
0.03¢embedding + vector DB + infra
$100vector DB base, hosting, logging
Monthly Projections
Daily requests
-
Monthly requests
-
LLM spend (blended routing)
-
Non-LLM spend
embedding + vector DB + infra
-
Fixed infra costs
-
Total monthly spend
-
Cost per user per month
-
LLM as % of total
-
Model Pricing Reference
Defaults used in the calculators above. Prices change frequently — verify at provider before budgeting and update the fields above.
Embedding costs are often overlooked but add up at scale — especially during ingestion. Verify at provider.
Model
$/M tokens
Dimensions
Best for
text-embedding-3-small (OpenAI)
$0.02
1536
General purpose, high volume
text-embedding-3-large (OpenAI)
$0.13
3072
Higher accuracy, production RAG
voyage-3 (Anthropic/Voyage)
$0.18
1024
Best-in-class retrieval quality
voyage-3-lite
$0.02
512
Cost-sensitive, high throughput
Gemini text-embedding-004
$0.00
768
Free tier, Google ecosystem
BGE-M3 (self-hosted)
~$0.00
1024
Zero marginal cost, multilingual
Vector DB Cost Reference
Query and storage costs at scale. The default $0.00004/read in the calculator above is based on Pinecone serverless. Verify at provider.
Provider
Read cost
Storage
Free tier
Notes
Pinecone Serverless
~$0.00004/read
$0.33/GB/mo
2GB
Zero idle cost, scales to zero
Weaviate Cloud
Included
$0.095/GB/mo
14-day trial
Hybrid search built-in
Qdrant Cloud
Included
$0.13/GB/mo
1GB free
Best price/performance
pgvector (self-hosted)
~$0
Server cost only
Unlimited
Best if already on Postgres
Chroma (local)
$0
$0
Unlimited
Dev/prototype only
Top Cost Reduction Strategies
Model routing by complexity
Up to 10x savings
Route simple tasks to cheap fast models. Reserve expensive models for genuine complex reasoning. A routing call costs fractions of a cent and can cut 60–80% of total LLM spend.
1
Classify request complexity at intake using a cheap model
Track per-route quality scores; tune thresholds with eval data
Prompt caching
Up to 90% input savings
Static content (system prompt, tool schemas, reference docs) can be cached. Cached input costs ~90% less than regular input. Critical for agents with long system prompts.
1
Identify static content: system prompt, tools, reference docs
2
Add cache_control: ephemeral to those blocks in API calls
3
Monitor cache_read_input_tokens in API response to verify savings
Batch API for async work
50% cost reduction
Any work that doesn't need real-time response (evals, reports, bulk analysis) can use the Batch API. Most providers offer ~50% discount for async processing.
1
Identify tasks tolerant of up to 24-hour turnaround
2
Submit as JSONL via Batch API, poll for completion
3
Retrieve, validate quality, process downstream
Embedding cost control
90%+ ingestion savings
Embedding costs dominate ingestion pipelines. Use smaller models for bulk ingestion, larger for quality-critical queries. Cache query embeddings for repeated queries.
1
Use a small/cheap model for document ingestion (bulk)
2
Use a higher-quality model for query embeddings at inference
3
Cache query embeddings in Redis with short TTL for popular queries
RAG context compression
40–60% input savings
Retrieved chunks are often the biggest token cost per request. Compress before inserting: extract only the relevant sentences, not the full chunk.
1
After retrieval, run contextual compression: extract relevant sentences only
2
Set a result_budget token limit per chunk in your retrieval system
3
Measure compression ratio vs quality impact on your eval set
Tool result compression
Reduce loop cost 50%+
Tool results grow the context window every iteration — this compounds across all loop calls. Summarize tool outputs before reinserting them into the context.
1
After each tool call, summarize result with a cheap model or regex
2
Insert the summary (not raw output) back into the agent context
3
Track context growth per iteration — alert if >500 tokens/step
Launch Checklists
Use these before shipping any agentic system to production. Click items to mark complete.
Pre-Production Agent Checklist
0 / 12
Context management: Rolling summarization implemented when context exceeds 80% of limit
Iteration budget: Hard max on LLM calls per invocation is set and enforced
Tool error handling: Every tool call has error handling and retry with exponential backoff
Model version pinned: Using exact model string, not a floating alias like "latest"
Golden eval set: At least 50 representative test cases with verified expected outputs
Output validation: Schema validation on all structured outputs with auto-retry on failure
Safety evals: Adversarial test suite passing before every deploy
Observability: Traces, spans, and tool call logs going to an observability platform
A living reference for engineers, architects, and practitioners building production AI agent systems. Use it as a field reference, share it with your team, or walk through the checklists before your next launch.
🗂️
How to use it
Browse all 24 topics from All Topics, or jump to a domain via the top navigation. Click any card to expand the full deep-dive with code patterns. Use the search bar to find topics instantly.
✅
Before you ship
Head to the Checklists tab and work through the pre-production, RAG, and multi-agent checklists. Each item is clickable — track progress before every deploy.
💰
Estimate your costs
The Cost Hub has an interactive per-request cost calculator and monthly budget projector. Adjust sliders to model your usage pattern across five major models.
📊
What to measure
The Metrics tab has every KPI worth tracking — RAG quality, agent performance, and production health — with target values and alert thresholds.
🔗
Share with your team
Share directly on LinkedIn, copy the URL, or post on X. All content is self-contained — no login, no paywall, works on any device.
🔄
Living document
Built and maintained by Vinit Metange. Current version: v2.0 — April 2026. Coverage spans current frontier models from Anthropic, OpenAI, Google, and open-source alternatives. The Cost Hub price fields are editable to stay accurate as models change.