This calculator answers one question: at a given monthly token volume, does owning the hardware to run a model locally cost less than buying those tokens from an API? It runs entirely in the browser — no network call, no external library. Enter the monthly token split, the one-time hardware cost, and the electricity price, then read the local monthly cost against budget, mid, and frontier API pricing tiers, plus the number of months until local pays for itself. The companion article on LLM API cost comparison explains why these tiers are ranges rather than fixed prices.

The calculator

Advanced inputs (hours per day, amortization, system watts)

These defaults are editable. System watts is the whole box draw at load, not just the GPU. Hours per day drives the electricity estimate. Amortization months spreads the one-time hardware cost into a monthly figure.

LOCAL VS API TOKEN COST

Amortization, usage hours, and system watts (defaults applied)

The math, written out

Every number above is computed from six inputs and three tier constants. The formulas are shown here so the result can be checked by hand:

monthly_electricity   = (watts / 1000) × hours_per_day × 30 × price_per_kwh
monthly_amortization  = hardware_cost / amortization_months
monthly_local         = monthly_electricity + monthly_amortization

monthly_api_tier      = (input_tokens / 1e6) × input_price
                       + (output_tokens / 1e6) × output_price

break_even_months     = hardware_cost / (monthly_api_tier − monthly_electricity)

The tier constants are midpoints of order-of-magnitude ranges checked on 2026-09-17: budget input about $0.02–0.10 and output about $0.06–0.30 per 1M tokens; mid input about $0.30–1.00 and output about $1.00–3.00; frontier input about $2.00–5.00 and output about $8.00–15.00. Vendor pricing pages are authoritative and the ranges shift over time.

Reading the break-even number

The break-even month is the point at which the cumulative saving from owning hardware equals the original hardware spend. Two rules keep the number honest:

  1. The denominator uses electricity, not total local cost. The formula divides by (monthly_api_tier − monthly_electricity) because the hardware cost is already being paid off through amortization. If the monthly electricity alone already exceeds the API tier, the denominator is zero or negative and local hardware never recovers its cost against that tier.
  2. Lower tiers are harder to beat. Cheap API pricing is often below the electricity of even a small box, so budget-tier workloads only flip to local at very high volumes. Frontier-tier workloads flip to local much sooner because the API alternative is expensive per token.

The cheap-hardware critical-point table

This table fixes a cheap local setup — about $800 hardware, 36-month amortization, a 350 W draw at 8 hours per day, and $0.15/kWh — and shows how many months until local breaks even against each API tier at different monthly token volumes. The split is 80% input / 20% output, which is typical for retrieval and agent workloads. All figures are estimates from the formulas above.

Monthly tokensBudget tierMid tierFrontier tier
10Mlocal never beats (electricity exceeds tier)local never beats (electricity exceeds tier)~21 months
50Mlocal never beats (electricity exceeds tier)~24 months~3.3 months
200M~190 months (≈16 yr; effectively never)~5 months<1 month
1B~11 months<1 month<1 month

The pattern is the whole point: at 10M tokens a month, the cheapest API tier is already cheaper than the electricity of running a small box, so local ownership cannot win. At 1B tokens a month, local pays for itself within a year even against budget pricing and within weeks against frontier pricing. The crossover sits somewhere in the tens-of-millions-of-tokens range, and it moves earlier as hardware gets cheaper or electricity gets pricier.

Electricity and hardware assumptions

Electricity price is entered as a single editable number but real rates vary widely by region and tariff — residential rates commonly sit between $0.05 and $0.40 per kWh, and datacenter or off-peak rates differ again. The default of $0.15/kWh is a midpoint for illustration, not a quote. System watts should be the whole machine at load, not just the GPU, because the CPU, memory, and fans draw power whenever the model runs. A 350 W default covers a single mid-range card with a modest CPU; larger builds or multiple GPUs push this higher and shorten or lengthen the break-even accordingly.

What this tool does not tell you

  • It excludes the operator’s time — building, maintaining, and updating a local stack has a cost that does not appear in any token math.
  • It excludes whole-system overhead beyond the entered watts, including idle draw, display, and storage power.
  • It excludes cooling and depreciation; hot rooms need more airflow and hardware loses resale value over the amortization window.
  • It does not compare model capability differences — a cheaper local model and a frontier API model may return different-quality answers, which is a separate decision from cost.

For the full memory picture behind a local deployment, see the VRAM calculator and the KV cache calculator. For deciding what hardware a workload needs, see the local LLM hardware guide and the model file size lookup. To size the context that drives token spend, see context length cost, and for serving multiple users see the LLM engine comparison. The per-month SaaS side is covered on ChatGPT cost per month.