LLM Inference Power Cost: Self-Host or Use an API?

    This article estimates the electricity cost of large language model (LLM) inference and uses it to compare self-hosting open-weight models against calling commercial APIs. It explains why benchmark rankings need careful verification, lays out the assumptions behind a per-token power calculation, shows that electricity accounts for well under 0.05% of the equivalent API revenue, and derives a break-even formula (N* = F ÷ (p − v)) for deciding when self-hosting becomes cheaper. A worked example with an 8-GPU node, an open-versus-closed comparison table, and answers to common questions about compliance, bursty workloads, and vendor lock-in are included. All prices and throughput figures are illustrative assumptions, not measured data or vendor quotes.

    1. Benchmarks Are Useful, but Check the Conditions First

    A recent open-source model ranked near the top of a public leaderboard, reigniting the open-versus-closed debate. Benchmarks do reflect model quality, but they only show results under a specific question set, prompt format, and scoring method. Common evaluations cover general knowledge QA, code generation, math reasoning, and instruction following. Their question distributions differ widely, so the same model can rank very differently across benchmarks.

    Before citing a benchmark result, verify the following:

    • Evaluation version and release date
    • Composition and distribution of the question set
    • Prompt format and number of few-shot examples
    • Scoring method: automatic grading or human grading
    • Model parameter count and quantization scheme
    • Runtime conditions: context length, sampling temperature, tool use
    • Reproducibility: whether code and environment are public

    Open-source software has long held a major position in infrastructure layers such as databases, operating systems, and middleware. LLMs are at a similar stage today. Open-weight models are improving quickly, the general-capability gap among mainstream models is narrowing, and some models only hold an edge in specific vertical scenarios.

    If general capabilities continue to converge, users will care more about unit cost, service stability, and terms of service, and model inference will increasingly resemble a standardized compute resource. This view rests on three premises: model capabilities genuinely converge, data and compliance requirements do not force lock-in to a single provider, and migration costs stay low. All calculations and recommendations below assume these premises hold.

    2. Calculation Scope and Assumptions

    The full cost of inference includes R&D amortization, GPU purchase and depreciation, data center rent, network bandwidth, operations staff, and security and compliance. This article calculates only the electricity consumed during inference, so the results indicate the order of magnitude of power cost. They cannot be treated as total cost.

    The parameters are as follows. Throughput is an assumed value, not measured data. Power and throughput in the table refer to a single GPU.

    Parameter Assumed value Unit Effect on results
    Single-GPU full-load power 700 W Proportional to power consumption
    Data center PUE 1.3 dimensionless Accounts for cooling, networking, and other overhead
    Effective power per GPU 910 W 700 × 1.3; determines energy use
    Decode throughput (output) 1000 tokens/s Determines output token yield; largest impact
    Prefill throughput (input) 10000 tokens/s Determines input token yield
    Cluster utilization 100 % Assumes full load; usually lower in practice
    Electricity price (example) 0.6 yuan/kWh Affects only the power bill, not token yield

    This article does not specify model size, quantization, context length, or batch size, all of which significantly change throughput. Running a larger model or a longer context on the same GPU lowers per-GPU throughput and raises per-token energy use. To reproduce the throughput in the table, record the model size, quantization precision (e.g., FP8 or INT4), input and output lengths, batch size, inference framework, and test duration.

    The calculation:

    1. Output-side energy per token: 910 J/s ÷ 1000 tokens/s = 0.91 J/token.
    2. Input-side energy per token: 910 J/s ÷ 10000 tokens/s = 0.091 J/token.
    3. One kWh equals 3.6 million joules. In a pure-output scenario, one kWh yields about 3.96 million tokens. In a pure-input scenario, it processes about 39.56 million tokens.

    Throughput uncertainty propagates directly into energy cost. If decode throughput drops to 500 tokens/s, energy per token rises to 1.82 J, and the power cost per million output tokens is about 0.30 yuan. At 1500 tokens/s, energy per token falls to 0.61 J, and the cost is about 0.10 yuan per million output tokens. The baseline is about 0.15 yuan. Even when throughput varies by half, the power cost stays between 0.10 and 0.30 yuan.

    Cluster utilization matters as well. Assuming power draw does not fall with load, the power cost per million output tokens can be approximated as 0.152 ÷ utilization. At 50% utilization it is about 0.30 yuan; at 80%, about 0.19 yuan. Idle power further raises per-token energy use but is not counted separately here, so this estimate is conservative.

    3. The Equivalent Revenue of One kWh

    The conclusion first: counting only electricity, the power bill corresponds to less than 0.05% of the equivalent revenue. Electricity is nearly negligible. What really drives per-token cost is hardware depreciation, utilization, and service pricing.

    All prices here are examples: output tokens at $50 per million, input tokens at $10 per million. The reference date is November 2026, and the source is the author’s assumption — not any provider’s public price list, nor an industry average. Always use the provider’s current pricing. The exchange rate is assumed at 7.2 yuan per US dollar. When the rate moves between 7.0 and 7.3, the electricity share only fluctuates between 0.041% and 0.043%.

    “Equivalent revenue” means the amount you would pay to buy the same number of tokens at the example API prices. For a provider selling tokens, this is real revenue. For an enterprise running a private deployment, it is only a magnitude comparison and does not represent cash inflow.

    The table below computes the token yield and equivalent revenue of one kWh under different input-to-output ratios.

    Input:Output Mixed tokens per kWh (10k) Equivalent revenue (USD) Equivalent revenue (yuan) Electricity share of revenue
    0:1 (pure output) 396 197.8 1424 0.042%
    1:1 719 215.8 1554 0.039%
    3:1 1217 243.5 1753 0.034%
    5:1 1582 263.7 1899 0.032%
    10:1 2176 296.7 2136 0.028%
    1:0 (pure input) 3956 395.6 2848 0.021%

    Take the 1:1 row as an example. One kWh processes about 3.596 million input tokens and 3.596 million output tokens, roughly 7.19 million tokens in total. The input portion at $10 per million is about $35.96; the output portion at $50 per million is about $179.80. Together that is $215.80, or about 1554 yuan at 7.2. The 0.6 yuan power bill is roughly 0.039% of that.

    Even at an electricity price of 1.0 yuan per kWh, the electricity share in the pure-output scenario is only about 0.07%. Under an electricity-only accounting, power cost is not a major pricing factor.

    4. Open-Source vs. Closed-Source: How to Compare

    Two concepts need distinguishing first. An open-source (open-weight) model publishes its weights, so you can download it and deploy it on your own or rented compute. A closed-source model is usually accessible only through the provider’s API. Some closed-source providers also offer private-deployment licenses, but terms vary and must be confirmed item by item.

    Dimension Open model, self-hosted or privately deployed Closed model via API
    Cost structure Mostly fixed costs (hardware, facility, staff); marginal power cost is low Mostly variable costs, billed per token
    Upfront investment Must buy or rent GPUs, then deploy and tune Essentially none
    Data and compliance Data stays on your network, easing regulatory requirements Must assess data transfer, retention, and training clauses
    Capability updates You track new versions and run your own evaluations and regression tests Provider iterates continuously; upgrades are usually transparent
    Vendor lock-in Low; can switch between open models Medium to high; interfaces and prompt habits create dependence
    Operations burden High; requires inference, monitoring, and scaling staff Low
    Elasticity Must reserve capacity; peak-valley swings cause idle resources Scales on demand; suits volatile workloads
    Best-fit workloads Long-term, stable, high utilization Low-frequency, bursty, or exploratory workloads

    5. The Break-Even Formula for Private Deployment

    Monthly costs for self-hosting and API calls can be written as:

    • Monthly self-hosting cost = F + v × N
    • Monthly API cost = p × N

    Setting them equal gives the break-even monthly token volume:

    N* = F ÷ (p − v)

    Here, N is the monthly token volume in millions of tokens. F is the monthly fixed cost — GPU depreciation, facility and bandwidth, operations staff, compliance and security — in yuan. v is the variable cost per million tokens, mainly electricity, estimated as 0.152 ÷ utilization, in yuan. p is the API price per million tokens, converted to yuan.

    Example with one 8-GPU node, under these assumptions:

    • Hardware price of 2 million yuan, straight-line depreciation over 60 months: about 33,300 yuan per month.
    • Facility and bandwidth: 6,000 yuan per month.
    • Allocated operations staff: 15,000 yuan per month.
    • Compliance and security: 3,000 yuan per month.

    This gives F of about 57,300 yuan per month. At 60% utilization, v is about 0.25 yuan per million tokens. Using the example API price of $50 per million output tokens, converted at 7.2, p = 360 yuan.

    Plugging in:

    N* = 57,333 ÷ (360 − 0.25) ≈ 159 million tokens

    That is about 160 million output tokens per month. Above this volume, self-hosting has a lower unit cost than calling the API at the example price; below it, the API is cheaper.

    The API price is the main variable affecting the threshold. If the price drops to $10 per million (about 72 yuan), the threshold rises to roughly 800 million tokens per month: 57,333 ÷ (72 − 0.25) ≈ 799 million tokens.

    The threshold only defines the cost boundary; whether the node can reach it depends on measured throughput. At the table’s throughput, an 8-GPU node at 60% utilization produces about 12.4 billion tokens per month. Even at one-tenth of that throughput, it yields about 1.2 billion tokens, still above the example threshold. This does not prove self-hosting is always cheaper. The table’s throughput is unmeasured, varies greatly across models and batch sizes, and operations staffing may be underestimated. Before going live, measure throughput, utilization, and staffing with real workloads, then rerun the formula.

    6. FAQ

    At what monthly token volume is self-hosting worthwhile?

    Estimate your stable monthly usage first, then compare it against the break-even threshold. The threshold must be recalculated with measured throughput and current API prices. If usage stays below the threshold long-term, prefer the API. If it stays above the threshold with stable utilization, self-hosting has the advantage.

    What if the data cannot leave our environment — should we still use an API?

    Compliance comes first. If data cannot leave your internal network, choose a privately deployed open model, or a closed-source option that supports private deployment, even if self-hosting costs slightly more.

    What if the workload is highly volatile?

    Use a hybrid deployment. Let self-hosted capacity handle the baseline load and spill peaks to the API. Sizing self-hosted capacity to the median daily demand reduces idle costs.

    What if the business depends on a unique capability of a closed model?

    Call the API directly. At the same time, decouple prompts and evaluation sets from that specific model to lower future migration costs.

    Does a higher-benchmark open model always save money?

    Not necessarily. Benchmarks reflect model quality; cost depends on per-token energy use, throughput, utilization, and operations investment. Evaluate the two separately.

    7. Conclusion

    Electricity is a very small share of total inference cost — under the assumptions here, roughly 0.02% to 0.04% of equivalent revenue. The choice between self-hosting and calling an API mainly depends on whether monthly token volume crosses the break-even threshold, along with data compliance requirements, workload stability, and operational capability. When running your own numbers, replace the example values in this article with measured throughput and current prices.