# When is local cheaper than an API?

> It depends almost entirely on how busy you keep the machine. The calculator below finds your break-even with every assumption visible.

Local hardware is cheap per token when it is busy and expensive when it is idle. One person chatting for an hour a day rarely beats an API on cost. A server that runs batched jobs around the clock often does.

Privacy, offline use and control are separate reasons to run locally. This page is only about money.

## Cost per million tokens

APIs charge per million tokens, so convert your hardware to the same unit. Spread the machine's price over its useful life, add power, and divide by the tokens it actually produces.

```text
yearly cost        = (hardware price / years of use) + power per year
tokens per year    = aggregate tok/s × seconds busy per year
cost per M tokens  = yearly cost / (tokens per year / 1,000,000)
```

Every input is something you can measure or look up. The one that swings the answer is seconds busy per year.

| Input | Where to get it |
| --- | --- |
| Hardware price | Your receipt or a quote, including every part |
| Years of use | Two to four is typical before the machine is too slow for new models |
| Power | Watts under load from a plug meter, times hours busy, times your electricity rate. [What does it cost to run?](https://localagi.co/power-and-cost) shows how |
| Aggregate tokens per second | Measured on your model and runtime at your real load, see [How do I benchmark my own setup?](https://localagi.co/benchmarking) |
| Seconds busy | Hours per day the machine is actually generating, times 3,600, times days in use |

Utilization is the share of the year the machine spends generating. A laptop used for chat might sit near 1 percent.

A team server during office hours might reach 20 or 30 percent. A batch job queue can approach 100.

Throughput depends on load too. One user gets single-stream speed. A batched server gets aggregate speed, which can be many times higher, as [What changes when many people use one model?](https://localagi.co/one-user-to-many) explains.

Use the number that matches how you will really run it.

**Rule of thumb.** 
Halve the utilization and you double the cost per token. Idle hours cost the same as busy ones.

## Break-even

Put your numbers in and compare against the API you would otherwise use. Every assumption is shown, so you can change the one you disagree with.

*Interactive calculator: cost per million tokens = (hardware per hour + electricity per hour) ÷ tokens per hour × 1,000,000.*

Compare like with like. An API's flagship model and a local mid-class model are not the same product.

Price the cheapest API model that does your job as well as the local one, not the most expensive one. Then compare.

Output tokens usually cost more than input tokens on an API. If your work is mostly long prompts and short answers, such as document summaries, weight the API side towards its input price. Locally, long prompts cost prefill time instead, which lowers your effective throughput.

The break-even falls into three rough zones.

- Low utilization, a single user: the API is almost always cheaper. Local wins only on privacy or offline use.
- Moderate utilization, a small team in office hours: it depends on the model and the API price. Run the calculator.
- High utilization, batch jobs or a busy team: local hardware often wins, sometimes by a wide margin.

**The catch.** 
The calculator assumes your hardware stays useful for as many years as you enter. New models arrive faster than old machines wear out, and a box bought for one model class can feel slow two years later. Be honest about the years.

## Costs people forget

**Power.** A GPU workstation under load draws hundreds of watts. A server running all day draws it for every hour of the day, and idle power adds up overnight too. Measure it, don't guess.

**Your time.** Setting up, updating and fixing a server takes hours each month. An API takes none. If you count your time at any rate at all, it often outweighs the power bill on a small setup.

**The machine being busy.** A workstation serving a team is not free for anything else. If someone also wants it for training, image work or games, the two jobs slow each other down. Some people buy a second machine for that reason alone.

**Spare capacity.** You size a server for the busiest hour, so it sits partly idle the rest of the day. That headroom costs the same as the capacity you use.

**Resale.** Hardware keeps some value. A machine you sell after two years cost you its price minus what you got back. Subtract that from the hardware price if you plan to sell.

**Try it.** 
Find your real utilization before trusting any break-even. Leave a serving runtime's metrics running for a normal week, then divide generated tokens by your hardware's aggregate throughput to get busy hours.

## Go deeper

### Why batching changes everything

The same machine can produce many times more tokens per hour serving ten people than serving one, because batching reads the weights once for everyone. That multiplier lands straight in the denominator of cost per token. A single-user benchmark makes local look far more expensive than it is for a team.

### API prices fall

API prices per token have dropped steadily as providers ship cheaper models and hardware. Your hardware cost is fixed on the day you buy. A break-even that holds today can move against you within a year, so leave margin.

### Cloud GPUs as the middle option

Renting a GPU by the hour sits between owning and paying per token. You pay for time, not tokens, so utilization matters exactly as it does for owned hardware, without the upfront price. It suits short projects and bursty jobs. [Local or cloud: which should I use?](https://localagi.co/local-vs-cloud) compares all three.

### Electricity rates vary a lot

Electricity costs several times more in some countries than in others. At high utilization, power can become a large share of the yearly cost. Use your own rate from your bill, not an average.
