Before you start: words you need#
| Word | Plain meaning |
|---|---|
| Per-token API | You send requests to someone else’s model and pay per million input and output tokens. No GPUs to manage. |
| Open-model host | A company that serves open-weight models (Llama, gpt-oss, Qwen, DeepSeek and others) behind a per-token API. |
| Managed (dedicated) endpoint | A provider runs a model, often your own fine-tune, on GPUs reserved for you. You pay per GPU-hour, not per token, and they run the software. |
| Self-hosted | You run the serving stack (vLLM, SGLang, a platform) on GPUs you rent or own. |
| Open-weight model | A model whose weights you can download and run yourself. |
| Lock-in | How hard it would be to leave a provider: data formats, APIs, contracts, prompts tuned to one model. |
| Crossover point | The volume at which one option becomes cheaper than another. |
1. What is it?#
Every inference workload is served in one of four ways:
flowchart LR A["Per-token API<br/><small>closed model or open-model host</small>"] --> B["Managed endpoint<br/><small>dedicated GPUs, their software</small>"] B --> C["Self-hosted, rented GPUs<br/><small>your software, their hardware</small>"] C --> D["Self-hosted, owned GPUs<br/><small>your software and hardware</small>"] class A io class B memory class C compute class D warn
Moving right gives you more control and a lower marginal cost per token at high volume, and costs you more fixed spend, more people and more risk. Build, buy or rent is the decision of where on that line each workload should sit, and when to move it.
The answer is rarely one choice for the whole company. A typical 2026 portfolio has a premium closed API for the hardest tasks, an open-model host for cheap bulk work, managed endpoints for fine-tunes at low volume, and a self-hosted fleet for the few high-volume workloads where it pays.
Facts checked on 13 November 2026.
2. Why does it matter?#
- Price differences are huge. A request in section 6 costs $0.00055 on an open-model API and $0.00815 on a premium closed model: a factor of fifteen. The choice of which model often matters more than the choice of where to run it.
- Self-hosting is not automatically cheaper. For a popular open model, hosts pool thousands of customers on the newest GPUs and often price near cost (23.c). A self-hosted fleet must beat that plus the cost of the team that runs it.
- Some reasons are not about price. Data that may not leave your network, a fine-tuned model, latency you control, a model the API will retire next year. These can force self-hosting at any volume.
- The decision changes with time. Volume grows, prices move (rental prices rose through 2026, 31.d), new models arrive. A good decision includes the trigger for revisiting it.
3. Simple analogy#
Getting to work: taxi, leased car with a driver, leased car you drive, or a car you bought. The taxi costs most per kilometre but nothing when you stay home. The bought car is cheapest per kilometre only if you drive a lot, and you pay for insurance, parking and repairs whether you drive or not. Most families mix: their own car for the daily commute, a taxi to the airport. And nobody buys a lorry because they once had to move house.
4. Tiny example#
One workload: 1 million requests a day, 3,000 input tokens (half cached) and 500 output tokens each, on a gpt-oss-120b-class model.
open-model API (Fireworks list): $16,400 / month
managed endpoint (17 × H100 at $8/h): $99,000 / month
self-hosted (17 × H100 at $2.80/h,
+18% platform, +3 engineers): $104,000 / month
premium closed API (Sonnet 5.5 list): $244,000 / monthAt this volume the open-model API wins by six times. Against the premium model, self-hosting the open model saves more than half, if the open model is good enough for the task. The real question is the quality comparison, not the hosting.
5. Technical explanation#
The four options#
| Per-token API | Managed endpoint | Self-host, rented | Self-host, owned | |
|---|---|---|---|---|
| You pay for | tokens | GPU-hours (their price) | GPU-hours + team | capital + power + team (7.l) |
| Cost when idle | zero | full (unless scale-to-zero) | full | full |
| Marginal cost per token | highest | medium | low | lowest at high utilization |
| Models | their list | open models, your fine-tunes | anything | anything |
| Data leaves your network | yes | yes (their cloud) | no (if your cloud account) | no |
| Latency control | little | some | full | full |
| People needed | ~0 | ~0.5 | 2–5+ | 5+, plus facilities |
| Time to start | minutes | hours | weeks | months (31.d) |
| Main risk | price, deprecation, rate limits | price, provider | capacity, ops | capacity, obsolescence |
Managed endpoints come from open-model hosts (Fireworks, Together, Baseten and others) and from the hyperscalers’ model platforms (Amazon Bedrock, Google Vertex AI, Microsoft Foundry) as “provisioned throughput” or dedicated deployments. The price premium over raw GPU rental is large: Fireworks lists an on-demand H100 deployment at $8.00 per GPU-hour and a B200 at $13.00, where the same GPUs rent raw for roughly $2–4.50 and $6–10 (31.d). You are paying for their software, their operations and their spare capacity.
What actually drives the decision#
Put price last and go through these first:
- Quality. Is the open or fine-tuned model good enough for this task on your evals? If only a frontier closed model passes, the decision is made; the rest is negotiation (Module 28).
- Data and compliance. Can prompts leave your network? Which regions? Is the provider’s retention policy acceptable? Some customers’ contracts decide this for you (23.i).
- Control. Do you need a specific model version to stay available for years, custom kernels, a context length or a latency the API does not offer?
- Volume and shape. Steady high volume favours owning or reserving. Spiky or uncertain volume favours paying per token.
- Team. Do you have, or want to build, the 3–5 engineers a self-hosted platform needs (21.m)? The team is a fixed cost that only pays at volume.
- Price, with the full waterfall for self-hosting (23.c), not the GPU price alone.
Crossovers#
API cost per month = requests × (input × in price + cached × cached price + output × out price)
Managed cost per month = GPUs at peak × managed $/GPU-hour × 730
Self-hosted cost per month = GPUs at peak × raw $/GPU-hour × 730 × (1 + platform overhead) + teamThree points fall out of the formulas:
- The API has no fixed cost, so it always wins at low volume.
- Self-hosting has a large fixed cost (the team) and the lowest slope, so it wins only at high volume, and only against an API whose per-token price is above your fully-loaded cost per token.
- Managed endpoints have a small fixed cost and a steep slope. They win in the middle, typically for a fine-tuned model at modest volume, and are the natural stepping stone before self-hosting.
Hybrid patterns#
- Base load on your fleet, peaks to an API. Size the owned or reserved fleet for the 70th percentile hour; overflow goes to a host serving the same open model. You stop paying for GPUs that only work at 09:00 (31.d).
- Cascades. A small self-hosted model answers most requests; hard ones go to a premium API (21.k).
- API first, then move. Launch on an API, collect real traffic and evals, then self-host the workload once volume and model choice are stable. The API traffic is the best capacity forecast you will ever get.
- Two providers for one model. For an open model, keep a second host or your own fleet as a fallback, so one provider’s outage or rate limit is not yours (23.f).
Lock-in and exit cost#
Write down, for each provider, what leaving would take:
| Lock-in | How to reduce it |
|---|---|
| API shape | an internal gateway with one API in front of all providers (21.i) |
| Prompts tuned to one model | eval suite per task, so a switch is measured, not guessed (Module 28) |
| Fine-tunes trained on their platform | keep the training data and recipe; prefer exportable weights |
| Volume commitments | short terms, or commitments in dollars rather than one model |
| Deprecation | track the provider’s retirement dates; budget a migration per year |
6. Under the hood: the crossover table#
The program computes the monthly cost of one workload at five volumes, for an open-model API, a premium closed API, a managed endpoint and self-hosting on rented H100s. Prices are list prices checked on 13 November 2026 (23.c and the further reading). The H100’s capacity for this model is an assumption; replace it with your own benchmark at your SLO (22.g).
// buildbuy.go — monthly cost of one workload as an API, a managed endpoint, or self-hosted.
package main
import (
"fmt"
"math"
)
// Workload: per request, 3,000 input tokens (half of them prefix-cache hits) and 500 output.
const (
inTok, outTok = 3000.0, 500.0
cachedShare = 0.5
peakToAvg = 2.5 // peak hour traffic ÷ daily average
hoursPerMonth = 730.0
)
type price struct{ in, cached, out float64 } // $ per million tokens
func (p price) perRequest() float64 {
return (inTok*(1-cachedShare)*p.in + inTok*cachedShare*p.cached + outTok*p.out) / 1e6
}
// Capacity of one H100 at the SLO for a gpt-oss-120b-class model:
// ASSUMED, replace with your own benchmark (22.g).
const gpuOutTokS, gpuInTokS = 1500.0, 20000.0
func gpusFor(reqPerDay float64) float64 {
peakRPS := reqPerDay / 86400 * peakToAvg
busy := peakRPS*outTok/gpuOutTokS + peakRPS*inTok*(1-cachedShare)/gpuInTokS
return math.Max(2, math.Ceil(busy/0.7)) // 70% peak utilization, never fewer than 2
}
func main() {
// List prices checked 13 Nov 2026 (23.c): an open model on a host, and a premium closed model.
openAPI := price{0.15, 0.015, 0.60} // gpt-oss-120b, Fireworks serverless
premium := price{2.00, 0.10, 10.00} // Claude Sonnet 5.5
const managedGPUh = 8.00 // Fireworks on-demand H100 deployment
const rentedGPUh = 2.80 // H100, 1-year contract, market index (31.d)
const team = 750000.0 / 12 // 3 platform engineers, fully loaded (23.c)
const overhead = 1.18 // non-GPU platform costs (23.c)
fmt.Println("monthly cost, $ thousands")
fmt.Printf("%9s %9s %9s %6s %9s %10s\n", "req/day", "open API", "premium", "GPUs", "managed", "self-host")
for _, r := range []float64{1e4, 1e5, 1e6, 1e7, 1e8} {
month := r * 30
g := gpusFor(r)
managed := g * managedGPUh * hoursPerMonth
self := g*rentedGPUh*hoursPerMonth*overhead + team
fmt.Printf("%9.0e %9.1f %9.0f %6.0f %9.0f %10.0f\n", r,
month*openAPI.perRequest()/1e3, month*premium.perRequest()/1e3, g, managed/1e3, self/1e3)
}
perReqSelf := func(r float64) float64 {
g := gpusFor(r)
return (g*rentedGPUh*hoursPerMonth*overhead + team) / (r * 30)
}
fmt.Printf("\nper request at 1e8/day: open API $%.5f, self-host $%.5f, premium $%.5f\n",
openAPI.perRequest(), perReqSelf(1e8), premium.perRequest())
}Output:
monthly cost, $ thousands
req/day open API premium GPUs managed self-host
1e+04 0.2 2 2 12 67
1e+05 1.6 24 2 12 67
1e+06 16.4 244 17 99 104
1e+07 164.2 2445 169 987 470
1e+08 1642.5 24450 1688 9858 4134
per request at 1e8/day: open API $0.00055, self-host $0.00138, premium $0.00815How to read it:
- Against the open-model API, self-hosting never wins in this table, even at 100 million requests a day. The host runs the same model on newer GPUs at higher batch and higher utilization than our H100s at a 2.5:1 peak-to-average ratio. This matches 23.c’s conclusion.
- Against the premium API, self-hosting the open model wins from about a million requests a day, by five times at 10 million. That saving is only real if the open model passes your evals for this task. This is why quality evaluation is the first item in the decision, not the last.
- The managed endpoint beats self-hosting at small scale (no team) and loses badly at large scale (the GPU price is almost three times higher). It is the right home for a fine-tune at modest volume.
- What would change the self-host column: newer GPUs (B200, Rubin, 7.c, 7.e), FP4 weights (13.g), a better utilization (fill troughs with batch work, Module 27), or overflowing peaks to an API instead of provisioning for them. Exercise 2 tries these.
7. Performance implications#
- APIs give you their latency, not yours. Per-token APIs share GPUs across customers; time to first token and per-user speed vary with their load. If your product’s latency is the product (voice, coding agents), measure the API’s p95 and p99 over a week before relying on it (31.i, 31.j).
- “Fast” tiers (priority processing, fast modes, SRAM-machine hosts, 7.k) sell lower batch at a higher price. Buying speed is often cheaper than building it.
- Self-hosting lets you tune for your traffic: prefix caching for your system prompts (12.m), speculative decoding trained on your outputs (13.n), disaggregation for your prompt lengths (14.j). These can be worth 2–5x, and are the main way a self-hosted fleet beats a generic host.
8. Production implications#
- Put a gateway in front of everything (21.i). One internal API, routing to any provider or your fleet, makes every later move cheap.
- Run evals continuously against every candidate model, so “could we switch?” has a measured answer (Module 28).
- Track API spend per team and per feature as you would fleet cost (23.c). Per-token bills grow quietly.
- Negotiate with data. Committed-spend discounts from API providers and managed hosts are common; your measured volume and a credible self-hosting alternative are your leverage.
- Plan for deprecation. Closed models are retired on the provider’s schedule. Every model dependency should have an owner and a migration budget.
- Write the trigger to revisit: “if volume exceeds X, or the API price changes by Y, or the open model reaches Z on our eval, we re-run this decision”.
9. Common mistakes#
- Comparing a GPU-hour price with an API price. Use the full waterfall (23.c) and include the team.
- Comparing hosting options for different models. The model choice dominates; compare at equal quality on your evals.
- Self-hosting a popular open model to save money at modest volume. The hosts are usually cheaper.
- Provisioning a fleet for the peak hour when overflow to an API would cost less.
- No gateway. Every provider switch becomes a code change in every product.
- Ignoring data and compliance until late. It can veto the cheapest option outright.
- Treating the decision as permanent. Volume, prices and models move every quarter.
10. Hands-on exercise#
- Run
buildbuy.go. At what requests per day does self-hosting beat the managed endpoint? Find it by adding volumes between 1e5 and 1e7. - Change the self-host column to B200s: $8.50 per GPU-hour on demand (Nebius list) or about $7 on a reservation, with three times the H100 capacity (an assumption to check, 7.c). Does self-hosting now beat the open-model API at any volume?
- Model a hybrid: provision self-hosted GPUs for the average hour (peakToAvg = 1) and send the rest of the peak to the open-model API. What does it cost at 1e7 requests a day?
- For a workload you know, fill in the six drivers in section 5 in order. Does price even get a vote?
11. Interview questions#
- When does self-hosting an open model beat buying the same model from a host? When does it not?
- Why can a managed endpoint cost more per month than self-hosting at large scale, and less at small scale?
- Your CFO says “GPUs cost $3 an hour and the API costs $10 per million tokens, so we should self-host”. What is missing?
- Design a hybrid that uses an owned fleet for base load and an API for peaks. What could go wrong?
- How do you reduce lock-in to a single model provider?
- A customer requires data to stay in the EU. How does that change the options?
12. Further reading#
Checked on 13 November 2026.
- Fireworks pricing — serverless per-token prices and on-demand deployment per-GPU-hour prices on one page; a good illustration of the managed premium.
- Claude API pricing and OpenAI API pricing
- Artificial Analysis: model and provider comparisons — price, speed and latency across providers for the same model.
- Nebius GPU prices — a neocloud’s list prices for raw GPUs.
- 23.c (cost per token and the API price table), 21.i (gateways), 21.k (cascades), 15.f (choosing a serving stack), 31.d (renting, reserving or owning hardware).