OpenRouter测算自托管LLM何时比API便宜,Qwen3.8 27B单卡6%到12%负载即打平
Self-Hosted LLM vs API: When Does Self-Hosting Pay Off
- 1OpenRouter测算:租一张RTX 3090跑Qwen3.8 27B,负载约6%到12%即比API便宜
- 2DeepSeek V4.1 Flash租H200对最便宜ZDR永不回本,B200最低租金下需76%负载
- 3自托管成本约每百万token一美分的报价多按缓存输入计,这类token走API也近乎免费
- 4作者称多数隐私需求可用API满足,provider.zdr限零留存端点,欧美域名锁区域
自托管是否省钱本质是利用率问题,GPU时租要对比同一小时token量的API费用,多卡大模型常打不过API,单卡小模型和自有GPU才有成本空间。
- 影响:GPU按小时计租、忙闲都收费,只有工作时段的流量最多约24%利用率,多数团队租卡跑大模型难回本;公开的超低自托管成本多按缓存输入计价,口径不一致会误导采购对比;隐私需求大多可用零留存端点和区域路由满足,自托管留给必须掌控硬件的场景。
- 参考:可先用公式自算平衡点,以现价把GPU每小时租金除以满负荷一小时token的API费用;已有闲置GPU的值得优先评估,其电费口径约1%负载即可打平;可按稳定基流量定自建规模,峰值走API并设置provider.zdr,采购前再核对最新价格。
- 依据:API侧按作者实跑的计费请求测算,自托管侧用公开基准与租金、作者未实际租用;价格为2026年10月8日实价,10月19日新低价端点已把3090平衡点推至约29%。
If you pay an API bill for an open-weight model, you may wonder whether your own GPU would cost less. GPU rent is charged every hour, busy or idle, while an API charges only for the tokens you use.
A self-hosted LLM costs less only when your traffic keeps the GPU busy enough of the time. At October 8, 2026 prices, a 27B model on one rented RTX 3090 breaks even at about 12% load, while a large mixture-of-experts model on rented H200s never beats the cheapest zero-data-retention (ZDR) API endpoint.
This post works out the break-even with live per-provider prices from our API, then shows how our data controls cover privacy.
TL;DR
-
Break-even load is the GPU’s hourly rent divided by what the same hour of tokens would cost through the API. Below that load, the API is cheaper.
-
DeepSeek V4.1 Flash on four rented H200s never breaks even against the cheapest ZDR endpoint. On two B200s, it needs 76% load at the lowest rent we found.
-
At October 8 prices, Qwen3.8 27B on one RTX 3090 at $0.50 an hour breaks even at 6 to 12% load, but each user gets only about 15 tokens per second.
-
Published self-hosting costs of around a cent per million tokens mostly count cached input tokens, which are nearly free through the API too.
-
Most privacy requirements don’t need self-hosting. provider.zdr limits a request to zero-data-retention endpoints, and our EU and US domains keep requests in-region.
How do you work out whether self-hosting pays off?
Take one hour of a GPU’s time and price it two ways. On one side is the rent. On the other is what the API would charge for the tokens that GPU can serve in an hour, at a speed your users accept.
break-even load = GPU rent per hour / API cost of one fully loaded GPU-hour of tokensA break-even of 30% means the GPU has to be busy for 30% of the hours you rent it before it costs less than the API. Anything above 100% means the API wins even if the GPU never rests.
Both sides have to be priced on the same token mix, because input, cached input and output tokens have very different API prices. We also left out engineering time and the spare capacity you’d keep for traffic peaks, so every break-even in this post is a lower bound.
What does the API cost for the same open-weight model?
Most open-weight models are served by many providers. Each one runs its own copy of the weights on its own hardware and sets its own price. Our endpoints API (GET /api/v1/models/{author}/{slug}/endpoints) returns every provider’s price and precision for a model, and GET /api/v1/endpoints/zdr lists the endpoints with a ZDR policy. As of October 8, 2026, they returned:
| Model | Endpoints (ZDR) | Input $/M | Cached input $/M | Output $/M |
|---|---|---|---|---|
| qwen/qwen3.8-27b | 18 (14) | 0.024 to 0.99 | 0.02 to 0.99 | 1.49 to 5.25 |
| deepseek/deepseek-v4.1-flash | 31 (24) | 0.016 to 0.45 | 0.0007 to 0.20 | 0.14 to 1.80 |
For the same weights, the most expensive provider charges 3.5 times the cheapest for Qwen3.8 27B output, and nearly 13 times for DeepSeek V4.1 Flash. A break-even worked out against a single list price can be far off. Providers also serve different precisions, from fp4 to bf16, and our LLM quantization post measures how much that changes the answers.
What we paid for real workloads
Reasoning models spend output tokens thinking before they answer, and agents resend their whole context every turn. So we ran two workloads per model with ZDR enforced and priced each request with GET /api/v1/generation, which reports the tokens and cost the provider actually billed:
| Workload | Model | Requests | Input tokens (% cached) | Output tokens (% reasoning) | Cost | Per 1M output tokens |
|---|---|---|---|---|---|---|
| Chat over a 5k-token document | DeepSeek V4.1 Flash | 10 | 53,330 (68%) | 12,476 (97%) | $0.0110 | $0.88 |
| 8-turn agent, 60k-token context | DeepSeek V4.1 Flash | 8 | 504,747 (75%) | 28,509 (83%) | $0.0243 | $0.85 |
| Chat over a 5k-token document | Qwen3.8 27B | 10 | 72,329 (56%) | 25,084 (97%) | $0.0694 | $2.77 |
| 7-turn agent, 85k-token context | Qwen3.8 27B | 7 | 595,223 (100%) | 81,870 (99%) | $0.1900 | $2.32 |
The last column divides the full cost, input included, by the output tokens. Almost every output token was reasoning, and a self-hosted copy of the model would spend the same GPU time producing them. Qwen3.8 27B also hit our 16,000-token cap while still thinking on 3 of its 7 agent turns. Every API run for this post cost $0.49 in total.
What does a self-hosted LLM cost to run?
We didn’t rent these GPUs ourselves. The self-hosted side uses published benchmarks and rental prices, so treat each row as an assumption:
| Setup | Throughput per GPU | Source | Rent per GPU-hour |
|---|---|---|---|
| DeepSeek V4.1 Flash, 4x H200, vLLM fp4, 32 concurrent sessions | 35,084 input + 231 output tok/s, 95% of input cached, 71 tok/s per user | InferenceX agentic traces, 2026-09-21 | $2.90 (InferenceX retail tier), $4.59 (RunPod) |
| DeepSeek V4.1 Flash, 2x B200, vLLM fp4, 32 concurrent sessions | 117,225 input + 683 output tok/s, 96% cached, 232 tok/s per user | InferenceX, 2026-10-03 | $3.70 (InferenceX retail), $6.79 (RunPod), $6.89 (Lambda) |
| Qwen3.8 27B, 1x RTX 3090, vLLM W4A16, 64 concurrent | 942 output tok/s at 128 tokens in / 512 out, about 15 tok/s per user | HyperQwen benchmarks | $0.50 (RunPod), or about $0.05 in power for a card you own (250 W at the EIA July 2026 US residential rate) |
DeepSeek V4.1 Flash has 552B backbone parameters, so it needs a multi-GPU node. Qwen3.8 27B is a dense model that fits on one 24 GB card at 4 bits.
Throughput is per GPU, the way InferenceX reports it, so every cost in this post is per GPU-hour. Per-user speed counts only the time a response is being generated, and these agentic sessions spend much of their time on prefill, so it doesn’t multiply out to the total. The 3090 figure comes from HyperQwen’s heavily patched vLLM build, so treat it as a best case.
We used its end-to-end figure, which includes prefill, rather than its 1,035 tok/s decode-only headline. HyperQwen benchmarked 128-token prompts, and our chat prompts are much longer, so for our chat mix we estimated 565 output tokens per second from its measured prefill and decode rates.
When does self-hosting pay off?
For each setup, we took the hour of tokens the benchmark measured, split it into uncached input, cached input and output, and priced that mix at every ZDR endpoint for the model, then divided the rent by the result. API prices are from October 8, 2026:
| Setup | Rent per GPU-hour | API cost of the same hour, cheapest ZDR / median ZDR | Break-even load vs cheapest ZDR | Break-even load vs median ZDR |
|---|---|---|---|---|
| DeepSeek V4.1 Flash, 4x H200 | $2.90 | $1.70 / $3.54 | never | 82% |
| DeepSeek V4.1 Flash, 4x H200 | $4.59 | $1.70 / $3.54 | never | never |
| DeepSeek V4.1 Flash, 2x B200 | $3.70 | $4.87 / $9.95 | 76% | 37% |
| DeepSeek V4.1 Flash, 2x B200 | $6.79 | $4.87 / $9.95 | never | 68% |
| Qwen3.8 27B, 1x RTX 3090, short prompts | $0.50 | $5.89 / $8.35 | 8% | 6% |
| Qwen3.8 27B, 1x RTX 3090, our chat mix (estimated) | $0.50 | $4.33 / $6.14 | 12% | 8% |
| Qwen3.8 27B, own RTX 3090, power only | $0.05 | $5.89 / $8.35 | 1% | 1% |
“Never” means the rent is higher than the API cost even at 100% load. Prices move quickly. On October 19, a new ZDR endpoint for Qwen3.8 27B charged $0.50 per million output tokens, which moves the short-prompt break-even to about 29%.

Start from the load you actually have. Traffic that only arrives during working hours, 40 of the week’s 168 hours, keeps a GPU busy at most 24% of the time. At October 8 prices, that rules out every DeepSeek row and leaves the 3090. Against the October 19 endpoint, the 3090 would need about 29%, so check current prices before you buy. A batch pipeline running around the clock can reach 70%, which brings both B200 rows into range against the median ZDR price, but neither against the cheapest.
In monthly terms, the rented 3090 costs $365 and pays for itself after about 170 million output tokens of our chat mix. The two-B200 node costs $5,402 a month at retail rent and has to serve 2.7 billion output tokens before it beats the cheapest ZDR endpoint.
The small model comes out ahead because its API prices are high compared with the hardware it needs. Providers charge $1.49 to $5.25 per million output tokens for Qwen3.8 27B, and a $0.50-an-hour card produces about 3.4 million of them an hour. DeepSeek V4.1 Flash is the opposite case. Twenty-four ZDR endpoints compete for its traffic, and the cheapest charges $0.18 per million output tokens.
The 3090’s low cost comes with a speed trade-off. It reaches that throughput by serving 64 requests at once, at about 15 tokens per second each. That’s slow for a chat interface, and slower still for a reasoning model that writes thousands of hidden tokens before its answer. Across the 18 API endpoints for Qwen3.8 27B, the median ran at 45 tokens per second in the 30 minutes before our pull, and the fastest at 474.
Why do published self-hosting costs look so low?
If you’ve seen self-hosting quoted at around a cent per million tokens, the token mix is usually the reason. InferenceX puts DeepSeek V4.1 Flash on H200 at $0.012 per million tokens at hyperscaler pricing. That figure is per million total tokens, and in its agentic workload, 99% of tokens are input, 95% of them served from the prefix cache. Through the API, cached input for that model costs $0.0007 to $0.20 per million, so those tokens are cheap either way.
Priced per output token, the same H200 at the $2.90 retail rent costs $3.49 per million before any input is counted. The cheapest ZDR endpoint charges $0.18.
Do you need to self-host for privacy?
Privacy is the other common reason to self-host, and you can get most of it through the API. Setting provider.zdr on a request limits it to endpoints whose providers don’t store your prompts or completions. If your ZDR setting also allows Safety Retention endpoints, those may keep prompts and responses to detect abuse, so choose ZDR only when you need no retention at all. Providers with implicit caching may also hold derived KV-cache data for a short time, as our implicit caching explainer describes. You can also enforce ZDR account-wide, per model group, or in a guardrail that covers specific API keys. On the Business and Enterprise plans, requests sent to eu.openrouter.ai or us.openrouter.ai run only on endpoints in that region, and they fail rather than leave it.
This script tries both, including two requests we expected to fail:
"""The privacy paths: ZDR per request, a ZDR conflict, and EU in-region routing."""
import os
import requests
KEY = {"Authorization": f"Bearer {os.environ['OPENROUTER_API_KEY']}"}
MSG = [{"role": "user", "content": "Reply with the word ok."}]
def ask(base, model, provider=None):
body = {"model": model, "messages": MSG, "max_tokens": 400, "provider": provider or {}}
r = requests.post(f"{base}/api/v1/chat/completions", json=body, headers=KEY, timeout=120)
data = r.json()
if r.status_code == 200:
return f"{r.status_code} served by {data['provider']}"
return f"{r.status_code} {data['error']['message']}"
GLOBAL, EU = "https://openrouter.ai", "https://eu.openrouter.ai"
print("1. ZDR on, any provider: ", ask(GLOBAL, "deepseek/deepseek-v4.1-flash", {"zdr": True}))
print("2. ZDR on, only DeepSeek API:", ask(GLOBAL, "deepseek/deepseek-v4.1-flash", {"zdr": True, "only": ["deepseek"]}))
print("3. EU domain, DeepSeek: ", ask(EU, "deepseek/deepseek-v4.1-flash"))
print("4. EU domain, GLM 5.3 + ZDR: ", ask(EU, "z-ai/glm-5.3", {"zdr": True}))
eu_models = requests.get(f"{GLOBAL}/api/v1/models", params={"region": "eu"}, timeout=60).json()["data"]
print(f"5. models eligible for EU in-region routing: {len(eu_models)}")Output recorded October 8, 2026:
1. ZDR on, any provider: 200 served by Decart
2. ZDR on, only DeepSeek API: 404 No endpoints found matching your data policy (Zero data retention). Configure: https://openrouter.ai/settings/privacy
3. EU domain, DeepSeek: 404 No endpoints found supporting your data region.
4. EU domain, GLM 5.3 + ZDR: 200 served by Inceptron
5. models eligible for EU in-region routing: 72Both filters run before we pick a provider, so they shrink the list of candidate endpoints instead of rerouting after the fact. With zdr on, DeepSeek’s own API drops out because it retains data. Pinning the request to that provider with only leaves no endpoint at all, which returns the first 404. The EU domain keeps only endpoints we’ve onboarded in Europe. DeepSeek V4.1 Flash had none, so the third request failed instead of quietly going to the US. To use EU routing, pick a model with EU endpoints from GET /api/v1/models?region=eu, which listed 72 models, including GLM 5.3.
ZDR has one limit. Your prompts are still processed on a provider’s GPU, so it doesn’t give you control of the hardware. If your policy requires the model to run on a deployment you control, Private Endpoints (Enterprise plan) add your own dedicated or fine-tuned deployment to a catalog model’s provider list. It must be hosted with a provider we support for BYOK, your team calls it with the same slug, and public endpoints stay available as fallbacks if you list them. If data must never leave hardware you operate, self-host and size the hardware from the break-even table above. Our ZDR explainer and data residency guide compare the options in more detail.
Can you self-host and use the API together?
Yes, and for most teams the break-even table points to this setup. A GPU only pays off at high load, so size your own for the steady base of your traffic, where it stays busy, and send the peaks to the API, where you pay only for what you use.
This works because vLLM and SGLang expose the same OpenAI-compatible chat API we do. A client moves between them by changing the base URL, key and model name. Fall back to the API on a connection error, or on the 429 or 503 your server returns when its queue is full. Set provider.zdr on the API side so overflow traffic keeps zero data retention. If your policy requires prompts to stay on hardware you control, don’t overflow to the API.
Two things can go wrong with this setup. If your local copy runs at a different precision from the API endpoint, the same prompt can get different answers, so pin the API side to a matching quantization with provider routing. And a conversation that switches backends partway through loses its prompt cache, so keep each conversation on one side once it starts.
Frequently asked questions
Is self-hosting an LLM worth it?
For cost alone, only if you can keep the GPU busy. In our numbers, Qwen3.8 27B on a rented RTX 3090 breaks even at 6 to 12% load. DeepSeek V4.1 Flash on rented data-center GPUs needs 37% load or more, and against the cheapest zero data retention endpoint it often never breaks even. Privacy and control can justify self-hosting at any load.
Which LLM is best for self-hosting?
Models that fit on one GPU are the best fit, because they avoid multi-GPU servers and their API prices leave the most room to save. Qwen3.8 27B, for example, runs on one 24 GB card at 4 bits. Our rankings and the open-weight vs closed-weight comparison show which models developers use most.
What is the cheapest self-hosted LLM option?
A GPU you already own. An RTX 3090 limited to 250 W costs about $0.05 an hour in electricity at the July 2026 US residential average, so it beats the cheapest zero data retention endpoint for Qwen3.8 27B once it’s busy about 1% of the time. The trade-offs are slower responses for each user and your own time spent on maintenance.
Can I host my own model and still use it through OpenRouter?
Yes, on the Enterprise plan. Private Endpoints route a catalog model’s slug to your own dedicated or fine-tuned deployment, hosted with a provider we support for BYOK. Only the users and organizations you approve can see or call it.
Next steps
-
Zero Data Retention: enforce ZDR per request, per model group, in a guardrail or account-wide.
-
In-Region Routing: send requests through the EU and US domains, and enforce a region with a guardrail.
-
The model pages for DeepSeek V4.1 Flash and Qwen3.8 27B list current per-provider prices and throughput.
来源:OpenRouter:Blog(Announcements) · openrouter.ai