Skip to main content
AI Economics

LLM Integration Cost: API, Fine-Tuning and Self-Hosting Compared (2026)

Short answer: a single well-scoped LLM feature costs $8,000 to $25,000 to build properly, a production feature with evaluation, guardrails and cost controls runs $25,000 to $60,000, and a multi-feature LLM platform starts around $60,000. That is only half the budget — the other half is the run cost, and it depends entirely on which of three routes you take: hosted API, fine-tuned hosted model, or self-hosted open weights. The arithmetic for each is below.

By Raman Makkar, CEO & Founder··13 min read

LLM integration cost is two numbers, not one

Every LLM integration has a build cost — the engineering to make a feature reliable — and a run cost, the inference bill that arrives every month forever after. Quotes that blend the two into one number hide the one that recurs.

The build cost tiers below assume the work is done properly: prompt and context engineering, structured outputs, error and fallback paths, an evaluation set, and cost ceilings enforced server-side. Calling the API is the trivial part; everything around it is the engagement.

See our LLM integration services

ScopeBuild costTimelineWhat is included
Single well-scoped feature$8,000 – $25,0003–6 weeksOne workflow (drafting, extraction, classification), eval set, basic cost controls
Production feature$25,000 – $60,0006–10 weeksGuardrails, fallback models, caching, tracing, per-user spend ceilings, scored evaluation
Multi-feature LLM platform$60,000 – $150,000+3–6 monthsShared model layer, routing between models, org-wide observability, fine-tuning pipeline
Run costRoute-dependent — see belowOngoingAPI tokens, or fine-tuned inference premium, or GPU infrastructure

🔀The three routes: API, fine-tuning, self-hosting

The run-cost decision is really three different products. A hosted API rents capability per token with zero operations. A fine-tuned hosted model trains a provider's model on your examples and charges a premium on inference. Self-hosting runs open-weight models on GPUs you rent or own, converting a per-token variable cost into a mostly fixed infrastructure cost.

DimensionHosted APIFine-tuned hosted modelSelf-hosted open weights
Upfront engineeringLowestDataset curation is the real costHighest — serving, scaling, monitoring
Cost structurePer token, pure variablePer token with a premium on inferenceMostly fixed GPU cost + ops time
Data privacyEnterprise terms: no training, defined retentionSame, plus your data shapes the weightsData never leaves your infrastructure
Quality ceilingFrontier models available on day oneBest for format, tone and narrow tasksStrong open models, behind the frontier on the hardest tasks
Ops burdenNoneLowReal — budget 0.25 to 1 platform-engineer FTE
Best forMost teams, most of the timeHigh-volume narrow tasks with stable formatData-residency requirements or sustained high volume

💵Route 1: hosted API economics

Published list pricing for the Claude family, per million tokens, as of July 2026 — the family we deploy most; the arithmetic is identical against any provider's rate card, and you should check the current pricing page before budgeting because these rates move.

The full cost-per-task model with retry and caching arithmetic

Worked example — classification

Two hundred million input tokens a month through the small model is roughly $200 of input plus output at five times that rate. Classification workloads are cheap enough that engineering time dwarfs the invoice.

Worked example — generation

A drafting feature producing 30 million output tokens a month on the mid-tier model costs about $450 of output plus its input. Output tokens are the expensive direction — features that write long text cost roughly 5× what features that only read cost.

The multiplier nobody budgets

Retry loops. A feature that succeeds first-try 70% of the time does not cost 1.43× the happy path — failures happen late, after most of the tokens are spent. Model cost per successful outcome, not per call.

ModelInput / 1M tokensOutput / 1M tokensRole in a typical integration
Claude Haiku 4.5$1.00$5.00Classification, routing, extraction
Claude Sonnet 5$3.00$15.00The workhorse — most production turns
Claude Opus 5$5.00$25.00Hard reasoning, drafting, review

🎛️Route 2: fine-tuning economics

Fine-tuning changes how a model behaves, not what it knows. If your problem is missing information, that is a retrieval problem and fine-tuning will not fix it. If your problem is shape — the model has the knowledge but produces the wrong format, tone or structure on a narrow, repeated task — fine-tuning is often the cheapest permanent fix.

Published fine-tuning rates for mainstream hosted models run from a few dollars to around $25 per million training tokens depending on the model, plus a per-token premium on inference for the tuned model — check the provider's current page, as these change. The number that actually dominates, though, is dataset curation: several hundred to a few thousand high-quality input-output examples, each reviewed by someone who knows what correct looks like. That review time routinely costs more than the training run itself.

The break-even case: if a base model needs a 2,000-token system prompt with few-shot examples to hit your format bar, and a fine-tuned small model hits it with a 100-token prompt, the fine-tuned model wins on every call. At millions of calls a month, the training cost pays back quickly. At a few thousand calls, prompt engineering is cheaper and more flexible.

RAG vs fine-tuning: which problem do you actually have?

🖥️Route 3: self-hosting economics

Self-hosting converts a per-token invoice into GPU infrastructure. On-demand H100-class GPUs run roughly $2 to $8 per GPU-hour depending on provider and commitment level; a quantised 7–8B open model serves comfortably from a single mid-range card, while a 70B-class model at full precision needs roughly two H100s. Serving stacks like vLLM handle continuous batching, which is what makes the economics work at all.

The break-even question is utilisation. A GPU serving tokens around the clock at high occupancy frequently undercuts API pricing on the same workload. The same GPU idling between bursts costs more than the API would have — you pay for the hour, not the token. Self-hosting wins on sustained, predictable volume and on hard data-residency requirements; it loses on bursty traffic and small workloads, and it always carries an operations cost in platform-engineering time for scaling, monitoring and model upgrades.

The pattern we recommend: start on a hosted API behind an abstraction layer, measure your real token shape for a quarter, then self-host only the workload slices where the utilisation math clearly wins — if any do.

🕳️The costs that do not show up in the first quote

RAG development services

Evaluation sets and their maintenance

A scored set of real inputs and expected outputs is the only way to know a change helped. It needs updating as the product and its data evolve — an ongoing cost, not a launch task.

Model upgrade regression testing

Providers ship new model versions and deprecate old ones. Each upgrade can shift behaviour on your prompts, so every migration costs a re-run of the eval set and often prompt rework.

Tracing and monitoring

Per-request traces of prompts, tool calls, tokens and cost. Without them a cost spike or quality regression is a mystery instead of a query.

Retry and loop runaways

An integration without server-side spend ceilings will eventually find the edge case that loops — and the invoice arrives before the alert does. Caps are cheap; their absence is not.

The last 10 percent of quality

Getting a demo to 90 percent is fast. The work from 90 to production-grade — edge cases, refusal behaviour, fallback paths — is typically half the build budget, and it is the half prototypes skip.

FAQ

Frequently Asked
Questions.

Common questions on ai economics, answered by the Codazz engineering team.

Ask Us Anything

Plan $25,000 to $60,000 for a production-grade single feature, including evaluation, guardrails and cost controls. Smaller budgets buy prototypes, which are useful for internal validation but should not be confused with something you would put in front of customers.

Only under specific conditions: sustained high utilisation, or data-residency requirements that rule out hosted providers. GPUs are billed per hour whether or not they are serving tokens, so bursty workloads usually cost more self-hosted than on API. Measure your real token shape for a quarter before committing.

The training run itself is often the small number — published rates run from a few dollars to around $25 per million training tokens depending on model. Dataset curation is the real cost: hundreds to thousands of reviewed examples. Fine-tuning pays back at high volume on narrow, format-sensitive tasks where it replaces a long few-shot prompt on every call.

Compute it from three numbers: requests per month, tokens per request split into input and output, and the per-model rates. Classification workloads on small models are typically hundreds of dollars a month; generation-heavy features on frontier models can be thousands. Then apply the retry multiplier — real workloads spend meaningfully more than the happy-path estimate.

Four to eight weeks for a focused production feature. The critical path is rarely the code — it is access to the systems and data the feature depends on, and agreeing what a correct output looks like so it can be evaluated.

Whichever fits the task today, behind an abstraction layer that makes swapping a config change rather than a rewrite. Model leaderboards shift every few months; the architecture decision that matters is portability, not the logo on the model.

Yes, and it is the path we recommend most often. Start hosted to learn your real token shape and quality bar, then self-host specific workload slices where the utilisation math or data-residency requirements justify it. Designing for portability from day one makes that migration a routing change instead of a rebuild.

Build in-house if you have engineers with production LLM experience and can absorb the learning curve. Hire if the first project must work to unlock further budget or you need it this quarter. A hybrid where the vendor builds alongside your team and hands over prompts, evals and tooling is often the best structure — you end up owning the capability rather than renting it.

Want the run-cost modelled before you commit?

Send us the feature you are scoping and your expected volume. We will price the build, model the run cost across API, fine-tuning and self-hosting, and tell you which route actually fits — at a fixed price.

Get a Free Quote

Tell us about your project

Or talk to an engineer