AI Strategy

The AI cost ledger small teams should build before launch

Token price is only the first line. A useful AI budget also counts context, caching, batch jobs, RAG, vector storage, evals, human review, logs, and the infrastructure around the model.

The easiest AI budget is also the one most likely to be wrong: requests times input tokens times the model price. That misses the real system. A product call may include a long system prompt, retrieved documents, tool schemas, output tokens, retries, safety checks, logs, storage, and sometimes a human who reviews the answer before it reaches a customer.

For a small team, the right artifact is not a spreadsheet full of guesses. It is a cost ledger with named lines, measured from real traces, updated whenever a model, price page, retention term, or workflow changes.

The ledger

Line itemHow to estimate itWhat teams often miss
Online API callsrequests x (input tokens x input rate + output tokens x output rate + reasoning/cache/tool/search/retry costs)Output tokens and reasoning or thinking tokens can dominate chatty workflows.
Contextstatic prompt + conversation + tools + retrieved documentsLarge context is billed even when only a small part is useful.
Cachingcache-write tokens, cache-read tokens, hit rate, TTL, and prompt-prefix stabilityA small change near the top of the prompt can destroy the hit rate.
Batch jobsoffline requests that can wait up to the provider's batch windowBatch is unsuitable when a user is waiting, but strong for evals, enrichment, classification, and embeddings.
RAGembedding/indexing + vector search + retrieved-context tokens + rerank if usedThe model still pays for the text you put back into context.
Vector databasestored vectors, dimensions, query volume, metadata, backups, region, and minimum planSome providers price by dimensions, some by plan minimums, some by hosted file-search calls.
Evaluationtest set size x model candidates x judge model x human labelsEvals are recurring product cost, not a one-time launch chore.
Human reviewreview minutes x loaded hourly cost x escalation rateThe expensive part may be handling uncertain, high-risk, or customer-visible outputs.
Logs and observabilitytoken logs, traces, error events, retention period, query volumeVerbose traces help debugging but can create storage, privacy, and redaction costs.
Infrastructuregateway, queue, workers, database, object storage, secrets, monitoring, and failoverThe model bill may be smaller than the product plumbing around it.

A simple formula

Start with this monthly estimate: online inference + offline batch + embeddings + retrieval/storage + evals + human review + logs/infra + 20% variance buffer. The buffer is not pessimism. It covers retries, prompt changes, traffic spikes, provider routing changes, and newly discovered edge cases.

What changed by July 2026

  • OpenAI, Anthropic, and Gemini all expose batch processing as a formal path for non-urgent work. The discount, expiry window, and eligible endpoints must be checked against the current provider docs before launch.
  • Prompt or context caching is now a budget lever, not an implementation detail. The provider-specific rules matter because cache writes, reads, TTL, and prompt-prefix stability shape the bill.
  • Hosted retrieval tools are lowering setup effort but changing the bill shape. Storage, tool calls, indexing embeddings, and retrieved document tokens may be charged on different lines.
  • Vector storage is no longer one pricing model. Cloudflare Vectorize, Pinecone, and database-backed pgvector designs move cost between provider usage, plan minimums, and operations work.
  • Evaluation tooling moves over time, so the durable asset is the dataset, rubric, and traces, not a specific dashboard.

Route by model capability

WorkloadModel laneCost rule
Routing, tagging, extraction, short classificationLow-cost fast modelKeep prompts short, require structured output, batch when possible.
Customer-facing RAG answerStandard model with citations and retrieval testsSpend on source quality and evals before upgrading the model.
Code review, complex policy analysis, high-value synthesisFrontier reasoning modelUse only when the task value justifies latency, output cost, and review time.
Tool-using agentModel plus product controlsBudget for retries, permissions, audit logs, and human approval on irreversible actions.

RAG costs are not just the vector database

A RAG system starts spending before the first user asks a question: cleaning documents, chunking, embedding, indexing, metadata design, and deletion workflows. At query time, it spends again on embedding or search, vector reads, possible reranking, and the retrieved text sent back to the model. If the answer must cite sources, you also need evals for recall, precision, citation accuracy, and conflict handling.

The cheapest RAG design is often the one that retrieves less but retrieves better. A smaller top-k, cleaner chunking, metadata filters, and a refusal path for missing evidence can reduce both hallucination risk and context cost.

Budget confidence score

ScoreMeaning
0No token logs, no estimate, no owner.
1A spreadsheet based on public prices, but no real traces.
2Real token usage is logged for a small pilot; output tokens and retries are visible.
3Caching, batch, RAG, vector storage, and human review are separate ledger lines.
4The team has task-specific evals, failure categories, and per-workflow unit economics.
5Costs are monitored in production with alerts, margins, provider fallback, and a monthly recheck of dynamic prices and terms.
RecommendDay editorial score. It is a budgeting maturity score, not a model benchmark.

What to do before launch

  1. Capture real traces for at least one representative week or a deliberately varied pilot set.
  2. Separate synchronous user-facing calls from batchable offline work.
  3. Measure cache hit rate instead of assuming a vendor's best-case saving applies.
  4. Put RAG retrieval quality in the same review as model quality.
  5. Write a human-review policy for low-confidence, regulated, or irreversible outputs.
  6. Set spend limits, anomaly alerts, log retention, and deletion workflows before inviting real users.
  7. Keep eval data, prompts, and provider adapters portable so the team can rerun the comparison when prices or terms change.

Sources

  1. OpenAI API PricingModel token pricing, cached input, web search, file search, and tool pricing checked on 2026-07-09.
  2. OpenAI Prompt CachingPrompt caching behavior, minimum token requirements, retention, and usage fields.
  3. OpenAI Batch APIBatch discount, separate limits, supported endpoints, and completion-window behavior.
  4. OpenAI File SearchHosted retrieval usage notes and rate-limit context.
  5. OpenAI data controlsAPI retention, zero data retention eligibility, endpoint storage behavior, and data residency notes.
  6. OpenAI evaluation best practicesTask-specific eval design, human evals, LLM judges, and continuous evaluation.
  7. OpenAI deprecationsPlatform deprecation timeline checked on 2026-07-09.
  8. Anthropic pricingClaude model pricing and long-context pricing notes.
  9. Anthropic prompt cachingCache TTL, read/write multipliers, and cache usage fields.
  10. Anthropic batch processingMessage Batches API discount, limits, retention, and non-ZDR note.
  11. Anthropic API and data retentionZDR scope, model-specific retention requirements, and feature eligibility.
  12. Anthropic evals for agentsAgent evaluation structure and grader framing.
  13. Gemini API pricingGemini paid/free tiers, context caching, batch, grounding, and file-search-related pricing context.
  14. Gemini context cachingImplicit caching, minimum token limits, and cache-hit usage field.
  15. Gemini Batch APIBatch cost reduction, target window, and supported workflow guidance.
  16. Gemini API termsPaid-service data-use terms, grounding retention, and agentic responsibility language.
  17. Gemini File SearchFile Search billing, storage, query-time embedding, and retrieved-token charging notes.
  18. Cloudflare Vectorize pricingVector dimension billing model and examples.
  19. Pinecone pricingManaged vector database plan and minimum-usage pricing context.
  20. AWS CloudWatch pricingLogging, metrics, ingestion, storage, and query pricing examples.
  21. NIST AI RMFRisk management framing for trustworthy AI systems.
  22. OWASP Top 10 for LLM Applications 2025Prompt injection, excessive agency, vector weaknesses, misinformation, and unbounded consumption risks.