A8gent

Calculator

Buying an AI Server vs Paying for OpenAI API Tokens

Work out whether buying or renting a GPU beats paying per token. Real 2026 model prices, real GPU rental rates, real electricity cost, and the token volume where the lines actually cross.

Contents
  1. Fast answer
  2. Quick facts
  3. What this covers
  4. Why it matters
  5. Where to go next
  6. Outcomes
  7. Step by step
  8. The methodology: exactly what this calculator computes
  9. How to read the verdict, and the three numbers that move it most
  10. A worked example: the support agent that did not need a GPU
  11. The limits: what this calculator does not and cannot know
  12. When to self-host anyway, and where to go next
  13. At a glance
  14. Mistakes to avoid
  15. FAQ
TL;DRAnswer-first

Fast answer

For almost everyone asking, paying for API tokens is cheaper than buying an AI server, and the calculator on this page exists to show you the exact volume at which that stops being true. The arithmetic is not complicated. The API side is your monthly token count multiplied by a published per-million-token price. The self-hosted side is fixed: a card, the rest of the build, depreciation over the months you expect to keep it, electricity at your local rate, and the hours you personally will spend keeping the serving stack alive. Because the self-hosted side does not move with volume, there is a single crossover point, and the calculator solves for it directly by scaling your own input-to-output token mix until the API bill reaches the self-hosted bill. Most readers who run it discover the crossover sits at ten to a hundred times their current volume, which is the honest answer nobody publishes. Rented GPUs sit between the two and are usually the right first experiment.

Facts last verified 2026-08

Quick facts

What decides it
Sustained utilisation, not peak capability
Self-hosted cost shape
Fixed per month, independent of volume
API cost shape
Linear in tokens, zero when idle
Electricity default
13.54 cents/kWh, US commercial average, EIA May 2026
Cheapest reversible test
Rent the same GPU by the hour first
Prices checked
2026-08-20, from vendor pricing pages

On this page

What this page covers

A tool visitor should leave with a decision, not just a number: build now, prepare first, choose another workflow, or follow a course path.

  1. 01Token volume
  2. 02Hardware
  3. 03Electricity and depreciation
  4. 04Break-even
  5. 05Capacity
  6. 06Sources

Why does this matter now?

The decision to buy hardware is close to irreversible and gets made on vibes more often than on numbers. A card is a capital purchase with a resale market you cannot predict, and the moment you own it you also own driver updates, thermal problems, a serving stack that changes monthly, and a machine that depreciates whether or not anybody sends it a request. The API charges nothing when nobody calls it. That asymmetry is the entire argument, and it only reverses at sustained high utilisation. Getting this wrong in the expensive direction costs thousands of dollars and a recurring maintenance obligation; getting it wrong in the cheap direction costs a rounding error on an invoice. The volumes involved are large enough, and the prices move often enough, that this is a calculation to run rather than a question to have an opinion about.

Internal path

Where to go next from this page

These links are part of the A8gent learning and conversion path. Use them to move from concept, to diagnosis, to workflow build, to course.

Start with readiness

What you should be able to do after this

  • Monthly API bill at your token volume
  • Rent and buy costs side by side
  • The break-even token volume
  • A capacity check before you buy

How do you do it, step by step?

1. Measure your real token volume, in and out separately

Pull last month's usage from your provider dashboard rather than estimating. Input and output prices differ by a factor of four to eight on most models, so a single combined token number will mislead you badly. If you are pre-launch, model it: requests per month multiplied by prompt tokens gives input, multiplied by average completion length gives output. Roughly 750 words per 1,000 tokens is the working conversion.

2. Price the API side at list, then subtract what you can actually save

The calculator uses published standard-tier prices with no discounts applied, which makes the API side pessimistic on purpose. Before you conclude self-hosting wins, check what prompt caching and batch processing would do to the same workload. Caching a stable system prompt across a high-repetition workload can move the input line substantially, and it is a configuration change rather than a hardware purchase.

3. Cost the hardware honestly, including the parts that are not the card

A GPU is not a server. Budget the CPU, board, memory, storage, a power supply sized for the card, and a case or chassis. NVIDIA specifies a 1,000W system supply for a single RTX 5090. Then pick a depreciation window you actually believe: three years is common, but a card bought at a supply-constrained price may not hold value that long, and the calculator lets you shorten the window to test that.

4. Add electricity at your rate, not a national average

The calculator defaults to the US commercial average from the EIA Electric Power Monthly, but your rate is on your bill and it is the one that matters. Board power is also not wall power, so the whole-system draw factor converts one to the other for CPU, drives, fans and supply losses. If you have a plug meter, measure it under load and replace the assumption.

5. Price your own hours, because this is usually the deciding line

Driver updates, model swaps, restarts after an out-of-memory error, keeping vLLM or your serving stack patched, and the afternoon lost to a kernel that no longer matches the driver. Multiply an honest monthly hour count by your real rate. Teams that set this to zero are the teams that later describe self-hosting as a mistake, and the number they omitted is exactly this one.

6. Run the capacity check before you celebrate the cost verdict

Cheaper per month means nothing if the box cannot produce the tokens. Benchmark your own model, at your own quantisation, with your own prompt lengths and concurrency, and put the aggregate output tokens per second into the calculator. If the resulting duty cycle is under twenty percent you are buying a machine to watch it idle, which is the single most common way this decision goes wrong.

The methodology: exactly what this calculator computes

Three cost lines, computed live, from your own inputs. The API line is your monthly input tokens multiplied by the model's published input price plus your monthly output tokens multiplied by its published output price. That is the whole formula. No discounts are applied, which makes the API column deliberately pessimistic, because prompt caching and batch processing both reduce it and neither is available to the self-hosted column in the same form.

The rent line is the published on-demand hourly rate for the card you selected, multiplied by the number of cards and by the hours you say the machine will actually run, plus your own ops hours at your own rate. RunPod publishes two rates per card, a community one and a secure one, so the calculator shows the pair rather than picking a favourite. Lambda's single-GPU H100 rate is shown alongside for the same card so you can see how far apart two published prices for identical silicon can sit.

The buy line is the part everyone shortcuts and it has four components. Capital cost is your card price multiplied by the card count plus whatever you put in for the rest of the build, divided by the depreciation window you chose. Electricity is board power multiplied by card count, multiplied by a whole-system draw factor, multiplied by hours, divided by 1,000 to get kilowatt hours, multiplied by your rate. Ops is your hours at your rate again. There is no fourth hidden term; what you see summed in the line-by-line table is the entire model.

The break-even is solved directly rather than searched. Because the self-hosted lines do not move with volume and the API line is strictly proportional to it, the ratio of the two is the factor by which your token volume would have to change for them to meet. The calculator scales your own input-to-output mix by that factor and reports the resulting total, which is why the answer comes back in your token proportions rather than in some generic blended figure.

How to read the verdict, and the three numbers that move it most

Read the break-even multiple before the monthly totals. If the calculator says you would need thirty times your current volume before self-hosting catches up, no amount of hardware shopping changes the conclusion, and the sensible next move is to reduce your token spend rather than to buy a machine. If it says one and a half times, you are genuinely in the interesting region and every other input deserves a second pass.

The first number that moves the verdict is which model you are replacing. The spread between the cheapest and most expensive model in the selector is two orders of magnitude on output tokens. A workload that would be extravagant on a frontier model and is a rounding error on a small one will produce completely different break-even points, and the honest question is usually whether the small model is good enough rather than whether the hardware is cheap enough. Testing a smaller model is free; buying a card is not.

The second is your ops hours. At a professional rate, a handful of hours a month is comparable to an entire small-GPU rental. This is not a rhetorical point: set the field to zero and then to six, and watch the verdict move.

The third is hours run per month. A machine at 730 hours is always-on and a machine at 100 hours is a workstation you switch on for batch jobs. Rental cost scales with that number and depreciation does not, which is precisely why renting wins for bursty workloads and buying wins for saturated ones. If your workload is bursty, the buy column is quietly charging you for 630 hours of nothing.

A worked example: the support agent that did not need a GPU

Take a support team routing 10,000 tickets a month through a model, with a 2,000-token prompt and a 300-token reply. That is 20M input tokens and 3M output tokens. On GPT-5 mini at $0.25 and $2.00 per million, the arithmetic is 20 times 0.25 plus 3 times 2.00, which is five dollars plus six dollars: eleven dollars a month. Eleven dollars. There is no hardware configuration on earth that competes with eleven dollars, and the calculator will tell you so in a sentence.

Now move the same workload to a frontier model at $5.00 and $25.00 per million. Twenty times five plus three times twenty-five is one hundred plus seventy-five, or $175 a month. Still nowhere near a bought machine, but now within sight of a rented RTX 4090 at $0.34 an hour, which is about $248 a month if you leave it running the whole month, before your own hours. Turn the rented card off for two-thirds of the month and it is $83, which changes the picture entirely and is exactly the kind of asymmetry the hours input exists to expose.

The volume that actually justifies hardware is a different shape of business. Take a document processing pipeline at 2,000M input and 400M output tokens a month on a small model at $0.25 and $2.00: that is 500 plus 800, or $1,300 a month, and a single rented A100 at $1.19 an hour comes to $869 always-on. Now the comparison is live, and the deciding questions become throughput and ops hours rather than price per token.

The pattern across all three cases is the same. The API wins at ordinary volumes by margins so large that precision does not matter, and the crossover arrives only when a workload is both large and saturated. Anybody who tells you the crossover is near without asking your token volume and your duty cycle is selling something, and the reason this page is a calculator is that those two numbers are the entire answer.

The limits: what this calculator does not and cannot know

It does not know your throughput, and it refuses to guess. Aggregate output tokens per second on a given card swings by an order of magnitude with model size, quantisation, batch size, sequence length and serving engine. Publishing a single figure would be precisely the sort of unsourced statistic that makes hardware comparisons useless, so the field is empty until you benchmark your own stack against your own prompts. If the capacity check then says the box cannot produce your output volume, the cost verdict was academic anyway.

It does not know what your card will be worth in three years, and neither does anybody else. GPU street prices have moved substantially within single quarters, and the one price we could verify, the RTX 5090 tracker median, sits far above the launch list price. Depreciation over thirty-six months assumes a smooth decline that the market has not been delivering. Shorten the window if you want the pessimistic case; the calculator will not stop you.

It does not price space, cooling, the network drop, or the spare card you will want the first time one dies. It also does not credit you for resale value. Those four omissions push the bought column up and the fifth pulls it down, and every one of them is specific enough to your situation that a made-up number would be worse than an honest blank.

It does not model the API-side optimisations that are free to enable. Prompt caching on a workload with a large stable prefix, batch processing on anything that is not latency-sensitive, and simply picking a smaller model all reduce the API column without touching the hardware column. Because those are configuration changes rather than purchases, they are the correct first move whenever the calculator says the API is winning, and usually the correct first move even when it says it is close.

When to self-host anyway, and where to go next

Compliance is the honest override. If a contract, a regulator or a client's security review requires that data never leaves infrastructure you control, cost is not the deciding variable and this calculator is documentation rather than a decision. Do check what is actually required first, because zero data retention terms and regional inference options satisfy a large share of these requirements without a server, and a self-host driven by an assumption rather than a clause is an expensive misreading.

Latency and dependency are the other legitimate reasons. A workload that cannot tolerate a provider incident, or that needs single-digit-millisecond first-token latency on a local network, is not really shopping on price. So is a fine-tuned or heavily modified open model that no provider hosts. In each case the calculator still tells you what the choice costs, which is worth knowing even when the choice is already made.

If the verdict came back in favour of the API, the productive next steps are to check whether a smaller model holds quality, and to read the long-form write-up on self-hosting versus the API for the hidden costs and hybrid strategies this calculator deliberately keeps out of the arithmetic. Comparing the current per-token prices across providers is also a five-minute exercise with a larger payoff than most hardware research.

If the verdict came back in favour of hardware, rent before you buy. Take the same card by the hour, run your real workload on it for a month, and measure throughput, duty cycle and the hours you actually spent. Then come back and re-run this page with real numbers instead of estimates. A rented month costs less than a returned card and answers more questions.

At a glance

Published rates used by this calculator, read from the vendor pages on 2026-08-20. Token prices are standard tier with no caching or batch discount applied.

ItemRateUnitSource
OpenAI GPT-5 nano$0.05 in / $0.40 outper 1M tokensdevelopers.openai.com/api/docs/pricing
OpenAI GPT-5 mini$0.25 in / $2.00 outper 1M tokensdevelopers.openai.com/api/docs/pricing
OpenAI GPT-5.6 sol$5.00 in / $30.00 outper 1M tokensdevelopers.openai.com/api/docs/pricing
Claude Haiku 4.5$1.00 in / $5.00 outper 1M tokensclaude.com/pricing
Claude Sonnet 5$3.00 in / $15.00 outper 1M tokensclaude.com/pricing
Claude Opus 5$5.00 in / $25.00 outper 1M tokensclaude.com/pricing
Gemini 2.5 Flash-Lite$0.10 in / $0.40 outper 1M tokensai.google.dev/gemini-api/docs/pricing
Gemini 3.7 Flash$0.75 in / $3.75 outper 1M tokensai.google.dev/gemini-api/docs/pricing
RTX 4090 rental$0.34 community / $0.74 secureper GPU-hourrunpod.io/pricing
RTX 5090 rental$0.69 community / $0.99 secureper GPU-hourrunpod.io/pricing
A100 80GB PCIe rental$1.19 community / $1.39 secureper GPU-hourrunpod.io/pricing
H100 SXM rental$2.69 to $3.29per GPU-hourrunpod.io/pricing
H100 SXM rental, 1x on demand$4.29per GPU-hourlambda.ai/service/gpu-cloud
RTX 4090 board power450 Wmax TGPnvidia.com RTX 4090 spec page
RTX 5090 board power575 Wmax TGPnvidia.com RTX 5090 spec page
A100 80GB PCIe board power300 Wmax TDPnvidia.com A100 page
H100 SXM board power700 Wmax TDP, configurablenvidia.com H100 page
US electricity, commercial13.54 centsper kWh, May 2026EIA Electric Power Monthly table 5.3
US electricity, residential18.44 centsper kWh, May 2026EIA Electric Power Monthly table 5.3
RTX 5090 street price$5,099.99 new / $3,089.00 used lowper card, 2026-08-19videocardprices.com

What mistakes should you avoid?

  • Comparing a bought GPU against list API pricing while ignoring prompt caching and batch discounts, which are free to enable and often close most of the gap.
  • Pricing the card and forgetting the chassis, the power supply, the depreciation window, and the resale value you may never realise.
  • Setting your own maintenance hours to zero, which is the assumption that flips most of these comparisons and never survives contact with production.
  • Using a throughput figure from somebody else's benchmark, at a different model size, quantisation and batch configuration, as if it applied to your workload.
  • Buying to serve a peak that happens twice a week, when the machine then idles through the other five days while the API would have charged nothing.
  • Treating a supply-constrained street price as a stable input, when card prices have moved substantially within single quarters.

FAQ

Is buying an AI server cheaper than paying for OpenAI API tokens?
Only at sustained high volume. The self-hosted cost is fixed each month whatever you do with it, while the API cost scales linearly with tokens and falls to zero when idle. The calculator on this page solves for the crossover using your own token mix and your own hardware quote. Run it before assuming either direction, because the answer depends heavily on which model you are replacing: a frontier model at thirty dollars per million output tokens crosses over far sooner than a small model at forty cents.
Should I rent a GPU instead of buying one?
For a first attempt, almost always. Renting turns a capital decision into a monthly one you can reverse, and published on-demand rates let you measure real throughput on real hardware before committing. If a rented month at your actual duty cycle does not beat the API bill, buying the same card will not either, because buying adds depreciation and maintenance on top.
What does the electricity actually cost?
Take the board power of the card, multiply by the number of cards and by a factor for the rest of the system, multiply by hours run, divide by 1,000 for kilowatt hours, then multiply by your rate. The calculator does this for you and defaults to the US commercial average from the EIA Electric Power Monthly, but the number on your own bill is the one to use.
Does self-hosting help with data residency or compliance?
It can, and this is the one argument that legitimately overrides the arithmetic. If a contract or regulator requires that data never leaves infrastructure you control, cost is not the deciding variable. Note that several providers offer zero data retention and regional inference options that satisfy many of the same requirements without hardware, so establish what is actually required before assuming a server is the only route.
Why does the calculator not fill in tokens per second for me?
Because any number we printed would be wrong for your workload. Aggregate throughput swings by an order of magnitude with model size, quantisation, batch size, sequence length and serving engine. Publishing a single figure would be exactly the kind of unsourced statistic that makes these comparisons useless. Benchmark your own stack and enter the result.
What is missing from the cost model?
Space, cooling, the network drop, a spare card for the day one fails, and the resale value you may or may not recover. The first four push the bought column higher and the last one pulls it lower. All five are specific enough to your situation that we would rather name them than invent numbers for them.

Sources & further reading

Was this page helpful?