Self-hosting versus API costs: compare accepted work and idle capacity

Build a hosting cost ledger that includes acceptance, idle capacity, operations and recovery, with a tested break-even example and explicit assumptions.

By benchr Editorial Team · · · Changelog

Self-hosting is cheaper only if your measured capacity can deliver acceptable work for less than the complete hosted bill. A rental price divided by an advertised token rate does not establish that. Start with the same task, a recorded quality threshold and a realistic traffic schedule.

Compare completed jobs before comparing token prices

A hosted endpoint and a local checkpoint may use different weights, quantization, templates, sampling settings and tool implementations. Treat them as different deployments until you establish equivalence for your workload. Record how often each output passes review and what retries, fallbacks or human repairs cost. A cheap rejected response is still a cost.

Use the pricing calculator for the supported hosted model and billing mode, including the actual input/output mix. Retain the quote's source date, cache assumptions and unavailable charges. Feed measured token usage from the chosen deployment into that quote; do not assume both alternatives produce the same number of tokens or receive the same cache discount.

Build the monthly ledger

Inference

Hosted API: Applicable input, output, cache, modality and service-tier rates.

Self-hosted deployment: Reserved or running instance time, including idle periods and warm-up.

Capacity

Hosted API: Account limits and any separately purchased reserved capacity.

Self-hosted deployment: The whole cluster needed for the checkpoint and target concurrency, plus redundancy.

Supporting services

Hosted API: Billable tools, retrieval, storage and network charges that apply.

Self-hosted deployment: Model storage, volumes, egress, routing, logs, monitoring and backups.

Operations

Hosted API: Integration, evaluation, incident handling and provider migration.

Self-hosted deployment: Those tasks plus serving software, security updates, deployment and capacity management.

Rejected work

Hosted API: Retries, fallback models and human review.

Self-hosted deployment: The same categories, measured independently.

A spot quote is not a reservation guarantee. Read interruption terms, storage persistence, minimum billing increments, region, tax and resource-cleanup rules from the supplier before budgeting a rented system. Check that the model license permits your intended deployment and distribution. This article does not publish a current GPU vendor price or assume that a named model fits a particular card.

A break-even calculation with explicit assumptions

The following example is pure local arithmetic. It uses fictional planning inputs, makes no provider request and does not predict throughput. The API cost per accepted job must come from a source-backed quote divided by an observed acceptance rate. The local cost must already include the complete required deployment.

"""Planning arithmetic only; no provider prices or capacity measurements."""
from decimal import Decimal, InvalidOperation


def break_even_jobs(monthly_fixed_usd, api_usd_per_accepted_job,
                    local_usd_per_accepted_job=0):
    try:
        values = [Decimal(str(value)) for value in
                  (monthly_fixed_usd, api_usd_per_accepted_job,
                   local_usd_per_accepted_job)]
    except InvalidOperation as error:
        raise ValueError("Costs must be numeric.") from error
    if any(not value.is_finite() or value < 0 for value in values):
        raise ValueError("Costs must be finite and non-negative.")
    fixed, api, local = values
    if api <= local:
        return None  # No volume-based saving pays back the fixed cost.
    return fixed / (api - local)


if __name__ == "__main__":
    print(break_even_jobs("2000", "0.02", "0.005"))

For an illustrative local monthly cost of $2,000, $0.02 per accepted API job and $0.005 of variable local cost per accepted job, the arithmetic threshold is 133,333.33 jobs. You would need at least 133,334 whole accepted jobs under those assumptions. That is a planning threshold, not evidence that your hardware can serve that volume. If local variable cost meets or exceeds API cost, increasing traffic does not recover the fixed local cost.

Measure capacity at the latency you need

Replay a representative workload against a staging deployment with explicit prompt lengths, output limits, concurrency and arrival patterns. Measure completed accepted jobs over wall-clock time, time to first token, full-response latency, queue delay, failures and peak memory. Separate prefill-heavy requests from long generated answers. A batch throughput result is not an interactive latency promise.

vLLM's memory guide documents context, concurrent-sequence and CUDA-graph tradeoffs. A smaller configuration may avoid an out-of-memory error while changing capacity or latency. Treat each configuration as a separate measurement. benchr has not run a GPU serving benchmark for this article.

Account for idle time and recovery

A continuously provisioned instance is billed through quiet periods; multiplying only the busy hours understates that bill. An on-demand service that shuts down between jobs may instead pay startup time, repeated weight loading and storage. Include rolling updates, incident recovery and a spare replica if the availability target requires one. A single machine's ideal utilization cannot represent a redundant service.

If the workload is small, bursty or changing quickly, hosted billing can avoid idle capacity and operational commitments. If traffic is steady and a validated checkpoint meets the task, self-hosting may justify a controlled pilot. Run the ledger with low, expected and high acceptance rates and traffic levels before committing capacity. Revisit the decision when the model, provider prices or workload changes.

For memory feasibility, read the deployment-options guide. For problems in an existing process, use the CUDA memory diagnosis. Keep performance measurements and invoices with the decision so another engineer can reproduce its assumptions.

Changelog

  • 2026-10-16 — Rebuilt the cost investigation around accepted jobs, complete deployment costs, measured capacity and source-backed API quotes. Removed stale vendor rates and unmeasured throughput claims; added tested local break-even arithmetic with fictional planning inputs.
  • September 12, 2026 — Added a dated note that the DeepSeek row is a June 2026 snapshot: DeepSeek moved to peak/off-peak billing on August 16, 2026 and retired the hosted V4-Flash for DeepSeek-V4.1-Flash on September 10, 2026. The GPU-rental figures and worked examples are unchanged.
  • June 19, 2026 — Originally published. GPU hourly rates, hosted open-model API prices, and throughput figures verified against RunPod's pricing and serverless documentation and current provider rates; the 3-to-5× hidden-cost multiplier is flagged as an analyst estimate, not an audited figure.

Sources and documentation review

Documentation review dates are recorded per source. No provider inference or independent benchmark replication was performed for this revision.

  1. vLLM context, concurrency and graph memory tradeoffs — read