Book a free call

How Much Does a Large Language Model Cost?

A large language model costs money in three places: training, hosting and API calls. Each is priced differently, and the cheapest route depends on your volume.

Hertiv engineering teamReviewed by a senior engineer
5 min read
How Much Does a Large Language Model Cost?
On this page

Short answer

A large language model costs money in three places: training it, hosting it, and calling it through an API. Training is a large one-off spend, hosting is a steady monthly cost, and API calls are priced per token, so the cheapest route depends on how much you use it.

What does a large language model cost?

A large language model costs whatever you pay to train it, run it or call it through an API, and those three numbers are very different. Training a frontier model costs millions; calling one through an API can cost a few dollars a month for a small app.

Most teams never train a model from scratch. They either call a hosted model through an API, fine-tune an existing model, or run an open model on their own servers. Each route has a different cost shape, and the right one depends on volume, latency needs and data rules.

The first step is to separate the three cost buckets: training, hosting and API use. Mixing them up is the most common reason cost estimates go wrong, because a cheap API bill can hide an expensive fine-tuning job, and a cheap model can hide an expensive hosting bill.

What does training a large language model cost?

Training a large language model from scratch is the most expensive route, and it is out of reach for most teams. The cost comes from compute, data and people, and compute dominates by a wide margin.

Cost part What it covers How it scales
Compute GPU time for training runs Grows with model size and data
Data Collecting, cleaning and labelling Grows with dataset size
People Engineers and researchers Fixed team, months of work
Evaluation Test sets and safety checks Grows with use cases
Failed runs Crashed or wasted training Unpredictable, often large

Fine-tuning is far cheaper than training from scratch, because it starts from a model that already works and only adjusts it on your data. For most teams, fine-tuning or retrieval over their own documents is the right route, and full training is never needed. How a large language model works explains what training actually changes.

What does it cost to run a model yourself?

Running a model yourself means paying for the servers it runs on, whether you rent GPUs in the cloud or buy hardware. The cost is steady and predictable, but you pay it even when nobody is using the model.

The main cost is GPU time. A large model needs several high-memory GPUs to serve requests quickly, and those GPUs are rented by the hour. Smaller models can run on one GPU or even on a CPU for light use, which is why many teams pick the smallest model that does the job.

Hosting also brings work that an API hides: model updates, scaling, monitoring, logging and keeping the service up. That work costs engineering time, and it is easy to forget when comparing a hosting bill with an API bill. Small language model cost shows how a smaller model changes the maths.

What does it cost to call a model through an API?

Calling a model through an API is priced per token, with separate rates for input tokens and output tokens. Input tokens are what you send; output tokens are what the model writes back, and output is usually priced higher.

The bill depends on three things: how many calls you make, how long the prompts are, and how long the answers are. A short prompt with a short answer is cheap; a long document with a long summary is not. Retrieval helps here: sending only the relevant pages keeps prompts short and the bill low.

API pricing changes often, and vendors list several models at very different rates. Check the vendor's pricing page before you estimate, and re-check it when you pick a model, because the cheapest model that does the job is usually the right one. RAG development cost covers the retrieval side of the bill.

How do you estimate the cost for your own use case?

You estimate the cost for your own use case by measuring a real workload, not by guessing from a price list. A small test with real prompts gives a per-call cost you can multiply out.

  1. Count the calls. How many requests per day, and how does that change at peak times?
  2. Measure token use. Log input and output tokens for a sample of real requests, not just the happy path.
  3. Price the sample. Apply the vendor's current rates to the sample to get a cost per call.
  4. Multiply by volume. Scale the per-call cost to daily and monthly volume, and add a margin for growth.
  5. Compare the routes. Price the same workload as API calls, as a hosted model, and as a smaller model, then pick the cheapest that meets your quality bar.

Keep the measurement running after launch. Prompts drift, usage grows, and a model that was cheap at 100 calls a day can become the biggest line item at 100,000. A monthly cost review catches that early.

Example (hypothetical): a support assistant's monthly bill

Example (hypothetical): a team runs a support assistant that answers 500 tickets a day. Each ticket uses about 1,500 input tokens and 300 output tokens, so the daily use is 750,000 input tokens and 150,000 output tokens.

Over 30 days that is 22,500,000 input tokens and 4,500,000 output tokens. At planning rates of $3 per million input tokens and $15 per million output tokens, the input bill is 22.5 times $3, or $67.50, and the output bill is 4.5 times $15, or $67.50.

The monthly total is $135. If ticket volume doubles, the bill doubles to $270, and if the team shortens prompts by a third, the input bill falls to $45. The arithmetic is simple once you know the per-call token counts, which is why measuring a real workload matters more than reading a price list.

What are the common mistakes?

The most common large language model cost mistakes are guessing instead of measuring, picking the biggest model by default, and forgetting the hidden costs around the model.

  • Guessing the token counts. Estimate from real requests, not from a single example prompt.
  • Picking the biggest model. A smaller model that passes your evaluation is cheaper at every volume.
  • Ignoring output tokens. Long answers cost more than long prompts, because output rates are higher.
  • Forgetting retrieval and tools. Embeddings, search and tool calls add their own cost on top of the model bill.
  • No cost alerts. A usage spike without an alert can turn into a large bill before anyone notices.
  • Comparing the wrong routes. An API bill and a hosting bill cover different work; compare them on the same workload.

If you are planning a model build and want the cost estimated against a real workload, an LLM development engagement can scope the model, the retrieval layer and the hosting route together.

Key takeaways

  • Training is the big one-off cost; hosting is steady; API calls are priced per token
  • Most teams should fine-tune or use retrieval, not train a model from scratch
  • A smaller model that passes your evaluation is cheaper at every volume
  • Output tokens usually cost more than input tokens, so long answers are expensive
  • Measure 100 real requests to get a per-call cost, then multiply by volume

Frequently asked questions

How much does it cost to train a large language model?

Training a frontier model from scratch costs millions in compute alone, plus data and engineering time. That is why almost no product team does it. Fine-tuning an existing model on your data costs far less, and calling a hosted model through an API needs no training at all.

Is it cheaper to use an API or host a model myself?

It depends on volume. At low volume, an API is cheaper because you pay only for what you use. At high, steady volume, hosting can be cheaper, but you also pay for engineering time, monitoring and scaling. Price the same workload both ways before you decide.

What is a token, and why does it matter for cost?

A token is a chunk of text, roughly three quarters of a word in English. API pricing is per token, so longer prompts and longer answers cost more. Measuring input and output tokens for real requests is the only reliable way to estimate a monthly bill.

Does fine-tuning cost a lot?

Fine-tuning costs far less than training from scratch, because it adjusts an existing model on a small dataset. The cost depends on dataset size and training time, and it is usually a one-off spend. After fine-tuning, you still pay the normal cost to run or call the model.

Why is my API bill higher than I expected?

The usual causes are longer prompts than planned, longer answers than planned, or more calls than planned. Retrieval that sends whole documents, verbose answers and retry loops all add tokens. Log token use per request to find which one is growing.

How can I reduce large language model costs?

Use the smallest model that passes your evaluation, shorten prompts with retrieval, cache repeated answers, and set usage alerts. Each of these cuts tokens or calls, which is what the bill is made of. Re-check the vendor pricing page regularly, since rates change.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a model build and want the cost estimated against a real workload?

A senior engineer replies within one business day. Or see our LLM Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call