AI PM 10X / BUILDING & SHIPPING

AI Cost Management

How to keep the unit economics of an AI feature sane. You pay per token, so cost is something a PM can shape with prompts, caching, and the right model.

Overview

AI cost management is the practice of keeping the per-request cost of an AI feature low enough that it can scale. Every call to a model is billed by the token, separately for what you send and what you get back. A longer prompt, a fatter retrieved context, and a more verbose answer each add to the bill on every single request, so cost grows with usage in a way that a flat SaaS feature never does.

For product managers, this is a lever you can pull without waiting on anyone. Caching repeated context, capping output length, and routing easy requests to a cheaper model often cut spend by half or more with no visible change to the user. The goal is a cost per task low enough, and falling fast enough, that the feature earns its place.

Why It Matters for PMs

Cost scales with length

You pay per input and output token. A longer system prompt, a fatter retrieved context, or a chattier answer all cost more on every single call. Length is the bill.

Unit economics over volume

A growing monthly invoice is fine if cost per request is falling. The number that decides whether a feature can scale is cost per task, measured against the value it creates.

Most spend is avoidable

Caching repeated context, capping output length, and routing easy requests to a cheaper model often cut the bill by half or more without users noticing any drop in quality.

Key Concepts

Three ideas that explain most of the AI bill, and most of what you can do about it

1

Token economics

Foundation · Per token

Models read and write in tokenstokensA token is a chunk of text the model processes, roughly four characters or three-quarters of a word in English. A 500-word answer is around 650 tokens. Providers bill per token, separately for what you send and what you get back.OpenAI on tokens, and you pay for both directions. Output tokens usually cost several times more than input tokensinput tokensThe tokens you send: system prompt, conversation history, retrieved documents, and the user's message. Everything in the context window is billed on every call, so a bloated prompt is a recurring tax.Anthropic on context windows. So a verbose system prompt, a long retrieved context, and a rambling answer are three separate ways the same feature gets expensive.

2

Caching

Reuse · Highest leverage

When the same content is sent on call after call, you should not pay full price for it twice. With prompt cachingprompt cachingThe provider stores the processed form of a repeated prefix (a long system prompt, a document, a few-shot block) and reuses it on later calls. Cached input tokens are billed at a large discount versus uncached ones.Anthropic prompt caching the model reuses a processed prefix at a steep discount. With a semantic cachesemantic cacheA layer that checks whether a new request is close in meaning to one already answered, using embeddings rather than exact text match. If it is similar enough, you return the stored answer and skip the model call entirely.GPTCache (semantic cache) you skip the call altogether when a near-identical question has already been answered.

3

Right-sizing

Match model to task

Not every request needs your most capable model. With model routingmodel routingA rule or classifier that sends each request to the cheapest model that can handle it. Simple classification or formatting goes to a small model, hard reasoning goes to a large one, so you stop paying premium rates for trivial work.Helicone on routing you send easy requests to a small, cheap model and reserve the expensive one for the hard ones. DistillationDistillationTraining a small, cheap model to imitate a large one on a specific task. The student model approaches the teacher's quality on that narrow job at a fraction of the cost per call.OpenAI on distillation goes further, teaching a small model to do one job almost as well as a large one.

Cost levers to know

Hover over any technique for a plain-English explanation and a link to go deeper.

Reduce tokens

Send and generate less

Prompt compressionPrompt compressionTrimming the prompt to the words that carry the instruction. Cutting boilerplate, redundant examples, and filler from a system prompt lowers the input bill on every single call.Hugging Face optimization guideContext pruningContext pruningSending only the retrieved chunks that are actually relevant rather than stuffing the whole knowledge base into the context window. Fewer input tokens, lower cost, and often a better answer.Anthropic on context windowsOutput limitsOutput limitsCapping max tokens and asking for concise answers. Output tokens are the most expensive part of a call, so an instruction to be brief is a direct cost saving.OpenAI guide
Caching

Pay once, reuse often

Prompt cachingPrompt cachingThe provider stores a processed prefix that repeats across calls (a long system prompt or document) and bills it at a fraction of the uncached rate. The biggest easy win when context is stable.Anthropic prompt cachingSemantic cacheSemantic cacheA lookup that returns a stored answer when a new question is close in meaning to one already handled. It removes the model call entirely for repeat or near-duplicate queries.GPTCache
Right-sizing

Match the model to the job

Model routingModel routingA rule or classifier that sends each request to the cheapest capable model. Trivial work goes to a small model, hard reasoning to a large one, so you stop overpaying for easy tasks.Helicone on costCascadesCascadesTry a cheap model first, then escalate to a stronger one only if a confidence check or validation step fails. Most requests resolve cheaply and only the hard tail pays full price.Eugene Yan: LLM patternsDistillationDistillationTraining a small model to imitate a large one on a narrow task. The student approaches teacher quality on that job at a fraction of the per-call cost.OpenAI on distillation
Forecast

Know the bill before it lands

Cost per taskCost per taskThe average dollar cost of one completed user action. It is the number that tells you whether a feature can scale profitably, and it matters more than the total monthly bill.LLM numbers (Anyscale)Unit economicsUnit economicsCost per task set against the revenue or value that task creates. A rising total bill is fine when cost per task falls faster than usage grows.Numbers every dev should knowBatch APIBatch APISubmitting non-urgent requests as a batch for processing within a window (often 24 hours) at roughly half the per-token price. Ideal for back-office jobs that do not need an instant answer.OpenAI Batch API docs

In Practice

Four ways cost management changes how PMs build and ship AI features

1

Decide what is worth optimising now

Inference prices have fallen sharply year on year, so some of your cost problem will solve itself just by waiting for the next model release. The PM job is to separate the spend that hurts the unit economics today from the spend that time will erode anyway. Optimise the first hard, and leave the second alone.

2

Cut the bill before you cut the feature

When an AI feature looks too expensive to scale, the instinct is to gut it. Reach for the cheap levers first. Cache the repeated context, cap the output length, and route the easy requests to a smaller model. These often halve the cost with no visible change to the user, which buys the feature room to prove its value.

3

Track cost per completed task

A finance team watching a rising total bill will ask you to cut usage. That is the wrong frame. Instrument cost per completed task and watch it against the value each task creates. A growing invoice with a falling cost per task is a feature that is scaling well.

4

Pick latency and accuracy with eyes open

Most cost levers trade against something else. A cheaper model can mean lower accuracy, and a batch job means a slower turnaround. Frame each choice as an explicit trade-off for the use case at hand. A nightly report can wait and run on the batch API, while a live chat reply cannot.

Curated Resources

Videos

Key Takeaway

You pay per token, so length is cost and cost is a product decision. Cache what repeats, cap what you generate, and route easy work to a cheaper model, and you can scale an AI feature on its unit economics rather than its invoice.