Skip to content
MAMasterAI Now
Outils IA

Self-Host vs API Cost Calculator

One side is a variable bill that scales with every token; the other is a fixed bill you pay whether or not anyone calls it. Enter your own rental price and your own measured throughput to find the volume where the two cross.

Tout s’exécute dans votre navigateur — rien de ce que vous saisissez ne quitte la page.

⚠ Cet outil n’est pas encore entièrement traduit en Français ; la version anglaise est affichée. La traduction est en cours.

Votre charge

Côté API

2,50 $US entrée / 10,00 $US sortie par million de jetons

Prix vérifiés le 1 février 2025

Millions de jetons par mois ; 10 correspond à dix millions.

Millions de jetons par mois ; 10 correspond à dix millions.

Préréglages

Fixe le volume mensuel de sortie.

Côté auto-hébergé

Seules les cartes à VRAM vérifiée sont proposées.

GPU

Saisissez le prix de votre fournisseur — il n’y a pas de valeur par défaut.

Mesurez-le sur votre propre déploiement. Le débit en lots est bien supérieur à la vitesse d’un seul flux et dépend du moteur, p. ex. vLLM.

Ingénierie, stockage, sortie de données — tout ce qui s’ajoute à la facture GPU.

API

45,00 $US

par mois

Par million de jetons de sortie
22,50 $US
Modèle
GPT-4o

Auto-hébergé

—

par mois

Par million de jetons de sortie
—
GPU nécessaires
—

Saisissez un prix de location et un débit pour chiffrer le côté auto-hébergé.

Saisissez le prix de location et le débit mesuré pour voir quel côté est le moins cher.

Volume d’équilibre
—
Jetons de sortie mensuels où les deux factures sont égales.
Capacité
—
Jetons de sortie que le déploiement peut servir par mois.
Capacité utilisée
—
Volume demandé en part de la capacité.
Coût selon le volumeAPIAuto-hébergé
0Jetons de sortie par mois: 8M

Coût mensuel maximal: 180,00 $US

Ce que ce calcul ignore

  • Le temps d’ingénierie et d’exploitation — le premier coût caché d’une pile que l’on opère soi-même.
  • Les différences de qualité entre le modèle API et le modèle ouvert que vous hébergeriez.
  • Les limites de débit, les quotas et la disponibilité de l’API.
  • Le temps d’inactivité et la capacité dimensionnée pour le pic.
  • Les démarrages à froid des GPU serverless et le temps de chargement des poids.
  • La valeur de garder les données dans votre réseau, parfois le motif principal. Le débit doit être mesuré sur votre propre installation.

Fixed versus variable: the whole decision in one sentence

An API bill is variable: zero requests cost zero dollars, and the bill grows in a straight line with tokens. A self-hosted deployment is fixed: the GPU is rented by the hour whether it answers one request or a million, so cost per token falls as utilization rises. There is no universally cheaper option — only a cheaper option at a given volume.

API = in ÷ 1e6 × price_in + out ÷ 1e6 × price_out
The variable side. Two prices, two volumes, nothing else — which is why API costs are easy to forecast and easy to underestimate once prompts grow.
self-host = GPUs × $/hour × hours + extra
The fixed side. Note what is missing: any term for traffic — below capacity, doubling the volume does not change it.

That asymmetry is the entire analysis. Below the crossover an API is cheaper because you pay only for what you use; above it, hardware wins because the marginal cost of one more token is nearly zero.

Utilization is the number that decides it

Two people can rent the same H100 at the same hourly price and get wildly different costs per token. The difference is utilization — the share of rented hours actually doing inference. A card busy 20% of the month costs five times more per token than one kept busy, because the bill is identical and only the denominator moved.

capacity = throughput × hours × 3600 × utilization
Monthly output tokens the deployment can produce. At 500 tokens/s, 730 hours and 50% utilization: 500 × 2,628,000 × 0.5 = 657 million tokens.

This is why self-hosting rarely wins for traffic with a daily peak. Renting for the peak means paying for an idle machine most of the night. Batch work — overnight re-indexing, dataset labelling, synthetic data — is the opposite: it runs flat out, so its utilization approaches 100%.

Watch outA quiet deployment is an expensive one

Before comparing, be honest about utilization. If the box exists for one internal tool that a dozen people use, it will sit idle for most of the month, and the cost per million tokens will look nothing like the number in the blog post that recommended self-hosting.

Throughput is the hardest number on the page

Throughput is the one input this calculator refuses to guess, because it varies by an order of magnitude between a stock single-stream setup and a properly batched engine. A 7B model can answer one chat stream at a few dozen tokens per second and serve hundreds in aggregate once requests are batched. Both numbers are true; they answer different questions.

Three things move it: the engine (vLLM, TensorRT-LLM and llama.cpp trade off differently), the batch size the workload can sustain, and the model itself — a sparse mixture-of-experts model decodes far faster than a dense model of the same total size. That is why the VRAM calculator reports a bandwidth ceiling and warns that real throughput lands 50–80% below it.

NoteMeasure, then calculate

Run your actual model on your actual card at your actual prompt lengths, and note the aggregate output tokens per second at the concurrency you expect. A calculator fed a plausible-sounding benchmark produces a confident answer to somebody else’s question.

When each side actually wins

  • APIs win below the crossover, for spiky traffic, for prototypes, for anything with a compliance budget instead of an ops team, and whenever the frontier model you need is one you cannot host at all.
  • Self-hosting wins at steady high volume, on batch pipelines, when the data cannot leave your network, when you need a specific fine-tune you own, and when you already employ someone who can run a serving stack.
  • Both win in the hybrid pattern most teams settle on: a small self-hosted model for the bulk of cheap classification and extraction, with an API for the rare hard request.

A word on quality: the API model and the open model are almost never the same model. A frontier model and a self-hosted 7B are not substitutes for every task, so price the gap deliberately instead of assuming the cheap option is good enough.

The costs that never appear on the invoice

The GPU hourly rate is the visible part. The invisible part is a person: someone has to pick a serving engine, tune batching, watch for out-of-memory crashes at 3 a.m. and keep the thing patched. That is a real salary, and it does not shrink because the instance is small.

  • Engineering time — the largest hidden line item, and what the extra-cost field exists for.
  • Storage and egress — model weights are tens of gigabytes, and moving them between regions is not free.
  • Idle capacity — you provision for the peak and pay for it through the trough.
  • Cold starts — a serverless GPU that loads 15 GB of weights before answering is not comparable to a warm API.
  • Rate limits — an API that throttles you at the wrong moment has a cost too, just not on the invoice.
  • Privacy and control — sometimes worth paying for, and sometimes the entire reason for the exercise.
NoteEverything runs in this tab

The API prices come from this site’s checked catalogue and are shown with the date they were verified; the GPU table holds only memory and bandwidth, never a rental price. The rental rate and the throughput are yours to enter, and the arithmetic runs in your browser: no request leaves the page.

Questions fréquentes

Is it cheaper to self-host an LLM or use an API?
It depends entirely on volume and utilization, which is why this page asks for both. Below the break-even volume the API wins, because you pay only for the tokens you use. Above it, the fixed GPU bill is spread over enough tokens that the marginal cost falls near zero. One $2/hour card at 50% utilization costs about $1,560 a month and serves roughly 657 million output tokens; whether that beats an API depends on the API price and your real throughput.
How do you calculate the break-even volume?
Divide the fixed monthly self-host bill by the API cost per output token at your own input:output ratio. If the API charges $30 per million output tokens at your ratio and the hardware costs $1,560 a month, the crossover is 1,560 ÷ 30 = 52 million output tokens per month. Keeping the ratio fixed is what makes the number meaningful: change the mix of prompt and completion and the crossover moves.
Why do you not fill in a GPU rental price for me?
Because there is no single price. The same card rents for very different amounts depending on provider, region, commitment length and whether it is on-demand or spot, and the spread is a factor of several. A default would anchor the whole comparison on a number you were never quoted, so the field stays empty until you enter what your provider actually charges.
What throughput should I enter?
The aggregate output tokens per second your deployment sustains at the concurrency you expect, measured on your own hardware. Do not enter single-stream chat speed, which is far lower, and do not enter a vendor benchmark for a different model. If you have not measured it yet, run a short load test with realistic prompt lengths — this is the input that moves the answer most.
Why does utilization matter so much?
Because the bill does not care. Renting a GPU for 730 hours costs the same whether it serves one request or a billion, so utilization is the denominator of your cost per token. Halving utilization doubles the effective cost per million tokens. Spiky consumer traffic is the worst case for self-hosting; steady batch work is the best.
Does this account for the API model being better than the open model?
No, and it cannot. This is a cost comparison between two line items, not a quality comparison between two models. If the open model you can host is weaker at your task, the real comparison is between the frontier API and an open model plus whatever extra work closes the gap. Price that gap explicitly rather than assuming it away.
What if my volume exceeds one GPU?
The calculator steps the bill up in whole cards and shows the figure for however many GPUs the volume actually needs, because comparing an API bill against an under-provisioned cluster is the classic mistake. Capacity grows with the added cards, so the cost per million tokens is recomputed against the larger deployment rather than the original one.
Do the API prices on this page update themselves?
No. They come from this site’s checked catalogue and the page prints the date they were last verified against provider pricing pages. An unpriced model is excluded rather than treated as free. Always confirm the current rate on the provider’s own page before committing to a budget.

Le cours correspondant

Cet outil accompagne ces étapes du parcours gratuit en 11 étapes.

  • LLM VRAM Calculator →

    Pick a model and a card to see how many gigabytes it really takes to serve — weights, the KV cache your context length creates, and the runtime overhead nobody mentions. Every formula is printed on the page.

  • LLM API Cost Calculator →

    Turn a token count and a traffic guess into a real monthly bill. Set the prompt size, the answer size and how many requests you expect, and every priced model is compared side by side.

Tous les outilsProposer une correction