"How much will it cost?" is a fair question and a hard one. The honest answer is that there's no single number, because an LLM-powered product isn't one cost — it's several, spread across build and run, and the ones that surprise teams are rarely the ones they budgeted for. The API bill everyone worries about is often the smallest line item. The engineering time everyone underestimates is usually the largest.
Here's a breakdown of where the money actually goes, what drives each piece up or down, and how to think about the total without pretending to know your specific number.
The costs split into two buckets
Before listing line items, separate two things that get lumped together:
- Build cost — the one-time effort to get the feature working: engineering, design, data prep, evaluation setup.
- Run cost — what it costs every month to keep it working: inference, infrastructure, monitoring, and maintenance.
Teams tend to fixate on run cost (the per-call API price) because it's the number providers publish. But for most products, especially early on, build cost dominates. You pay for the pipeline once and the tokens forever, but the pipeline is where the real money and time go before you ever ship.
The API bill: smaller than you fear, but sneaky
Inference — the cost of actually calling the model — is usually metered by tokens, split into input (what you send) and output (what you get back). Output tokens typically cost more than input. That pricing shape has a few practical consequences worth internalizing:
- Long prompts are expensive prompts. Every request pays for its full input. If you stuff a giant system prompt, a dozen few-shot examples, and a big pile of retrieved context into every call, you pay for all of it, every time. Prompt size is a cost lever, not just a quality lever.
- Retrieval controls your input bill. Fetching the right few chunks instead of dumping everything keeps input tokens down. Good retrieval isn't only about accuracy — it directly shrinks the per-call cost.
- Model choice is the biggest dial. The gap between a top-tier model and a smaller, cheaper one can be large, per call. Using the expensive model for everything is the most common way teams overspend. Using a small model for the easy 80% and reserving the big one for the hard 20% is the most common way they claw it back.
- Output length matters. Asking for a terse structured answer costs less than asking for a long essay. If you don't need prose, don't pay for it.
The trap isn't the unit price — it's volume times prompt size. A feature that looks cheap per call gets expensive when it runs on every page load with a bloated context window. The fix is almost always architectural: retrieve less, prompt tighter, route to smaller models, and cache.
Caching: the cheapest cost saving there is
If the same or similar requests recur, you can avoid paying for them twice. Two kinds of caching help:
- Response caching — if you've already answered this exact question, return the stored answer instead of calling the model again.
- Prompt caching — many providers let you cache a stable prefix (like a long system prompt) so repeated calls that share it pay less for the shared part.
Neither is free to implement, and response caching only helps when inputs actually repeat. But for high-volume features with overlapping requests, caching can take a meaningful bite out of the run cost for relatively little engineering. It's usually one of the first optimizations worth reaching for once volume is real.
The build cost nobody quotes: engineering time
This is the line item that dwarfs the others, and it's the one that's hardest to put a number on because it's mostly people's time.
An LLM feature is not "call the API and render the result." A production version needs, at minimum:
- The core integration — prompts, retrieval, the request/response plumbing.
- Input and output handling — validating what users send, parsing what the model returns, handling the cases where it returns something malformed.
- Guardrails — checks for bad inputs, moderation where it matters, and sensible fallbacks for when the model fails or refuses.
- Error and edge-case handling — timeouts, rate limits, retries, degraded modes. Models fail in ways ordinary APIs don't, and the unhappy paths are where most of the real work hides.
The demo that took an afternoon and the production feature that took weeks are the same feature. The difference is entirely in the handling of everything that isn't the happy path. When a build estimate feels too low, this is almost always why: someone priced the demo, not the product.
Data and retrieval infrastructure
If your product answers questions over your own content, you have a data pipeline to build and run. That includes:
- Getting documents ready — cleaning, chunking, and embedding them so they can be retrieved. This is genuine engineering, and messy source data makes it slower.
- Somewhere to store and search vectors — this can be a dedicated vector database or an extension on a database you already run. For many products, adding vector search to your existing Postgres is enough and avoids a whole new system to operate.
- Keeping it fresh — when source content changes, something has to re-process and re-index it. That's an ongoing job, not a one-time load.
The build cost here is the pipeline. The run cost is storage, the embedding calls, and the compute to keep the index current. Neither is huge for a modest corpus, but both grow with the size and churn of your data.
Evaluation: the cost of knowing it works
You cannot tell whether an LLM feature is good by looking at it a few times. Outputs vary, and "seems fine" is not a quality bar you can ship on. So you need an evaluation set — a collection of representative inputs with known-good outputs — that lets you measure quality and catch regressions when you change a prompt or swap a model.
Building that eval set is upfront work, and maintaining it is ongoing work. It's also non-negotiable for anything users depend on. The teams that skip it don't save money; they pay it later in production incidents and in the inability to safely change anything. Treat evaluation as part of the build, not a nice-to-have.
The run costs that keep running
Beyond inference, a live LLM product carries the same operational costs as any other software, plus a few of its own:
- Observability — logging what went in and out, tracking latency and error rates, and being able to trace a bad answer back to its cause. You don't need an enterprise platform to start; you do need enough visibility to debug.
- Monitoring and drift — model providers update their models. Behavior can shift under you. Your eval set is what catches this, but watching for it is an ongoing cost.
- Maintenance — prompts rot, retrieval quality decays as content grows, and provider changes force adjustments. An LLM feature is not "set and forget." Budget for someone to tend it.
Where the money actually concentrates
Put it together and a rough shape emerges for most products:
| Cost area | When it hits | Usually large or small? |
|---|---|---|
| Engineering time to build | Up front | Large |
| Data pipeline and retrieval | Up front + ongoing | Medium |
| Evaluation set | Up front + ongoing | Medium |
| Inference (API calls) | Ongoing | Small to medium |
| Observability and ops | Ongoing | Small to medium |
| Maintenance and drift | Ongoing | Steady, easy to forget |
The pattern that surprises people: the token bill they worried about is often modest, while the engineering time they hand-waved is the main expense. Cost overruns in AI projects usually come from underestimating the build — the handling, the guardrails, the eval — not from the model being pricey.
How to keep the total sane
You control more of this than the pricing page suggests. The highest-leverage moves:
- Start small and measured. Build the smallest version that solves a real problem, put an eval set behind it, and expand from evidence rather than ambition.
- Right-size the model. Don't pay top-tier prices for tasks a smaller model handles. Route by difficulty.
- Keep prompts lean. Retrieve the few things that matter instead of the everything that might. Shorter prompts are cheaper and often better.
- Cache what repeats. Once volume is real, caching is cheap insurance against a growing bill.
- Reuse what you have. Vector search in your existing database, your existing monitoring stack — avoid standing up new systems until you've outgrown the old ones.
The uncomfortable truth is that the biggest cost lever is scope. Most budget blowouts aren't a model that's too expensive; they're a feature that tried to do too much before anyone measured whether the simple version worked. Ship the small thing, measure it, and let real usage — not a slide deck — tell you where to spend next.
Trying to scope an LLM feature and figure out what it'll actually cost to build and run? Get in touch — we help teams design AI systems that fit the budget as well as the job.