如果你为开源模型支付 API 费用,你可能会想知道使用自己的 GPU 是否成本更低。GPU 租赁费按小时收取,无论繁忙还是空闲;而 API 仅根据你使用的 token 数量收费。
只有当你的流量让 GPU 在足够多的时间内保持忙碌时,自托管的 LLM 成本才会更低。以 2026 年 10 月 8 日的价格为例,在一台租赁的 RTX 3090 上运行 27B 模型,盈亏平衡点约为 12% 的负载;而在租赁的 H200 上运行大型混合专家(MoE)模型,其成本永远无法低于最便宜的零数据保留(ZDR)API 端点。
本文利用我们 API 中各提供商的实时价格计算盈亏平衡点,随后展示我们的数据控制措施如何保障隐私。
TL;DR
盈亏平衡负载等于 GPU 的小时租金除以通过 API 提供相同数量 token 所需的小时成本。低于该负载时,API 更便宜。
在四台租赁的 H200 上运行 DeepSeek V4.1 Flash,其成本永远无法与最便宜的 ZDR 端点持平。在两台 B200 上,即使在我们找到的最低租金下,也需要达到 76% 的负载才能实现盈亏平衡。
以 10 月 8 日的价格计算,在一台每小时 0.50 美元的 RTX 3090 上运行 Qwen3.8 27B,盈亏平衡点为 6% 到 12% 的负载,但每位用户每秒只能获得约 15 个 token。
公开公布的自托管成本约为每百万 token 一美分,这主要计算了缓存输入 token 的成本,而这些 token 通过 API 获取几乎也是免费的。
大多数隐私需求并不需要自托管。provider.zdr 将请求限制为零数据保留端点,且我们的欧盟和美国域名确保请求保留在区域内。
你如何计算自托管是否划算?
通过订阅,你同意接收 OpenRouter 新闻通讯:模型使用数据、产品更新和研究报道,大约每周一封电子邮件。您可以通过每封电子邮件中的链接随时取消订阅。请参阅我们的隐私政策。
取一小时 GPU 的时间,并用两种方式定价。一方面是租金。另一方面是 API 为该 GPU 在用户可接受的速度下一小时内所能处理的 token 所收取的费用。
盈亏平衡负载 = GPU 每小时租金 / 满载一小时的 GPU token 的 API 成本
30% 的盈亏平衡意味着在你租赁 GPU 的小时数中,GPU 必须忙碌 30% 的时间,其成本才会低于 API。任何超过 100% 的数字意味着即使 GPU 从不休息,API 仍然更便宜。
两侧都必须基于相同的 token 组合进行定价,因为输入、缓存输入和输出 token 的 API 价格差异很大。我们还排除了工程时间和为应对流量高峰而保留的备用容量,因此本文中的每个盈亏平衡点都是一个下限。
对于相同的开源模型,API 的成本是多少?
大多数开源模型由许多提供商提供服务。每个提供商都在自己的硬件上运行自己的一份权重副本,并设定自己的价格。我们的端点 API(GET /api/v1/models/{author}/{slug}/endpoints)返回了某模型所有提供商的价格和精度,而 GET /api/v1/endpoints/zdr 列出了具有 ZDR 政策的端点。截至 2026 年 10 月 8 日,它们返回了以下数据:
对于相同的权重,Qwen3.8 27B 输出的最贵提供商收费是最便宜提供商的 3.5 倍,而 DeepSeek V4.1 Flash 则接近 13 倍。针对单一标价计算的盈亏平衡点可能会相差甚远。提供商还服务于不同的精度,从 fp4 到 bf16,我们的 LLM 量化文章测量了这会对答案产生多大的影响。
我们为实际工作负载支付的费用
推理模型在回答之前会花费输出 token 进行思考,而智能体(Agent)会在每一轮重新发送整个上下文。因此,我们对每个模型运行了两项工作负载,并强制执行 ZDR,使用 GET /api/v1/generation 对每次请求进行定价,该接口报告提供商实际收取的 token 和成本:
| 工作负载 | 模型 | 请求数 | 输入 token(% 缓存) | 输出 token(% 推理) | 成本 | 每百万输出 token 成本 |
|---|---|---|---|---|---|---|
| 5k token 文档的聊天 | DeepSeek V4.1 Flash | 10 | 53,330 (68%) | 12,476 (97%) | $0.0110 | $0.88 |
| 8 轮智能体,60k token 上下文 | DeepSeek V4.1 Flash | 8 | 504,747 (75%) | 28,509 (83%) | $0.0243 | $0.85 |
| 5k token 文档的聊天 | Qwen3.8 27B | 10 | 72,329 (56%) | 25,084 (97%) | $0.0694 | $2.77 |
| 7 轮智能体,85k token 上下文 | Qwen3.8 27B | 7 | 595,223 (100%) | 81,870 (99%) | $0.1900 | $2.32 |
最后一列将包含输入在内的总成本除以输出标记数。几乎所有输出标记都涉及推理,而自托管的模型副本在生成这些标记时将消耗相同的 GPU 时间。Qwen3.8 27B 也在其 7 次代理轮次中的 3 次仍在思考时达到了我们设定的 16,000 标记上限。本文涉及的每次 API 运行总成本为 0.49 美元。
自托管大语言模型(LLM)的运行成本是多少?
我们并未自行租赁这些 GPU。自托管部分使用的是已发布的基准测试数据和租赁价格,因此请将每一行视为一种假设:
配置 | 每张 GPU 的吞吐量 | 来源 | 每张 GPU-小时的租金
DeepSeek V4.1 Flash, 4x H200, vLLM fp4, 32 个并发会话 | 35,084 输入 + 231 输出 标记/秒,95% 的输入已缓存,每位用户 71 标记/秒 | InferenceX agentic traces, 2026-09-21 | $2.90 (InferenceX 零售层级), $4.59 (RunPod)
DeepSeek V4.1 Flash, 2x B200, vLLM fp4, 32 个并发会话 | 117,225 输入 + 683 输出 标记/秒,96% 已缓存,每位用户 232 标记/秒 | InferenceX, 2026-10-03 | $3.70 (InferenceX 零售), $6.79 (RunPod), $6.89 (Lambda)
Qwen3.8 27B, 1x RTX 3090, vLLM W4A16, 64 个并发 | 在输入 128 标记、输出 512 标记的情况下,输出吞吐量为 942 标记/秒,每位用户约 15 标记/秒 | HyperQwen 基准测试 | $0.50 (RunPod),或对于自有显卡约为 $0.05 的电费(250 W,基于美国能源信息署 EIA 2026 年 7 月的住宅电价)
DeepSeek V4.1 Flash 拥有 552B 骨干参数,因此需要多 GPU 节点。Qwen3.8 27B 是一个密集模型,在 4 位量化下可适配于一张 24 GB 显存的显卡。
吞吐量是按 InferenceX 报告的方式计算的每张 GPU 的指标,因此本文中的每项成本均为每张 GPU-小时的成本。每位用户的速度仅计算生成响应的时间,而这些代理会话将大量时间花在预填充(prefill)阶段,因此它不会直接乘以总成本。3090 的数据来自 HyperQwen 经过大量修改的 vLLM 构建版本,因此请将其视为最佳情况。
我们使用的是其端到端数据,其中包含预填充部分,而非其 1,035 标记/秒的纯解码(decode-only) headline 数据。HyperQwen 对 128 标记的提示进行了基准测试,而我们的聊天提示要长得多,因此对于我们的聊天混合场景,我们根据其测量的预填充和解码速率估算出每秒输出 565 个标记。
自托管在何时能收回成本?
对于每种配置,我们取基准测试所测量的一小时标记量,将其拆分为未缓存输入、已缓存输入和输出,并以该模型在每个 ZDR(零延迟区域)端点的价格对该混合比例进行定价,然后将租金除以结果。API 价格来自 2026 年 10 月 8 日:
配置 | 每张 GPU-小时的租金 | 相同一小时的 API 成本,最便宜 ZDR / 中位数 ZDR | 相对于最便宜 ZDR 的盈亏平衡负载 | 相对于中位数 ZDR 的盈亏平衡负载
DeepSeek V4.1 Flash, 4x H200 | $2.90 | $1.70 / $3.54 | 永远不会 | 82%
DeepSeek V4.1 Flash, 4x H200 | $4.59 | $1.70 / $3.54 | 永远不会 | 永远不会
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 | 永远不会 | 68%
Qwen3.8 27B, 1x RTX 3090, 短提示 | $0.50 | $5.89 / $8.35 | 8% | 6%
Qwen3.8 27B, 1x RTX 3090, 我们的聊天混合(估算) | $0.50 | $4.33 / $6.14 | 12% | 8%
Qwen3.8 27B, 自有 RTX 3090, 仅电费 | $0.05 | $5.89 / $8.35 | 1% | 1%
“永远不会”意味着即使在 100% 负载下,租金仍高于 API 成本。价格变动迅速。在 1026 年 10 月 19 日,Qwen3.8 27B 的一个新 ZDR 端点每百万输出标记收费 0.50 美元,这使得短提示的盈亏平衡点移至约 29%。
从你实际拥有的负载开始计算。仅在每周 168 小时中的工作时间(40 小时)到达的流量,最多只能让 GPU 在 24% 的时间内处于忙碌状态。按 10 月 8 日的价格计算,这排除了所有 DeepSeek 行,只剩下 3090。面对 10 月 19 日的端点,3090 需要约 29% 的负载,因此在购买前请检查当前价格。全天候运行的批处理管道可以达到 70% 的负载,这将使两个 B200 行在相对于中位数 ZDR 价格时进入可接受范围,但相对于最便宜的价格则不行。
按月计算,租赁的 3090 成本为 365 美元,在我们的聊天混合场景下,产生约 1.7 亿输出标记后即可收回成本。双 B200 节点在零售租赁价格下每月成本为 5,402 美元,必须在击败最便宜的 ZDR 端点之前服务 27 亿个输出标记。
小型模型之所以胜出,是因为其 API 价格相对于所需硬件而言偏高。Qwen3.8 27B 的提供商按每百万输出令牌收取 1.49 至 5.25 美元的费用,而一张每小时 0.50 美元的显卡每小时可生成约 340 万个这样的令牌。DeepSeek V4.1 Flash 则情况相反。有 24 个 ZDR(零数据保留)端点为其分担流量,其中最便宜的收费为每百万输出令牌 0.18 美元。
3090 显卡的低成本是以速度为代价的。它通过同时处理 64 个请求来实现该吞吐量,每个请求的速度约为每秒 15 个令牌。对于聊天界面来说,这已经很慢了;而对于在给出答案前会生成数千个隐藏令牌的推理模型而言,速度更慢。在 Qwen3.8 27B 的 18 个 API 端点中,在我们抓取数据前的 30 分钟内,中位数为每秒 45 个令牌,最快者达到每秒 474 个令牌。
为什么公布的自托管成本看起来如此低廉?
如果你看到自托管成本报价约为每百万令牌一美分,通常是因为令牌的构成所致。InferenceX 在 H200 上以超大规模云厂商定价将 DeepSeek V4.1 Flash 标价为每百万令牌 0.012 美元。该数字是按每百万总令牌计算的,在其代理工作负载中,99% 的令牌是输入令牌,其中 95% 来自前缀缓存。通过 API,该模型的缓存输入成本为每百万 0.0007 至 0.20 美元,因此无论哪种方式,这些令牌都很便宜。
若按输出令牌计价,同一张 H200 显卡以 2.90 美元的零售租赁价格计算,在计入任何输入令牌之前,成本为每百万 3.49 美元。最便宜的 ZDR 端点收费仅为 0.18 美元。
你是否需要为了隐私而自托管?
隐私是自托管的另一个常见原因,而你可以通过 API 获得大部分隐私保护。在请求中设置 provider.zdr 可将其限制为那些不存储你的提示词或补全内容的提供商所在的端点。如果你的 ZDR 设置也允许使用安全保留(Safety Retention)端点,这些端点可能会保留提示词和回复以检测滥用行为,因此只有在完全不需要数据保留时才选择 ZDR。具有隐式缓存功能的提供商可能还会短暂保存派生的 KV 缓存数据,正如我们的隐式缓存解释文章所述。你还可以在全账户范围、按模型组或在覆盖特定 API 密钥的护栏中强制执行 ZDR。在 Business 和 Enterprise 计划中,发送至 eu.openrouter.ai 或 us.openrouter.ai 的请求仅在该区域的端点上运行,如果无法在该区域找到端点,请求将会失败而不是离开该区域。
此脚本尝试了两种情况,包括两个我们预期会失败的请求:
"""隐私路径:每次请求的 ZDR、ZDR 冲突以及欧盟区域内路由。"""
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) } " )
输出记录于 2026 年 10 月 8 日:
这两个过滤器在我们选择提供商之前运行,因此它们缩小了候选端点的列表,而不是事后重新路由。当开启 zdr 时,DeepSeek 自己的 API 因为会保留数据而被排除。仅将请求固定到该提供商会导致没有任何可用端点,从而返回第一个 404 错误。EU 域名仅保留我们在欧洲接管的端点。DeepSeek V4.1 Flash 没有此类端点,因此第三个请求失败,而不是悄悄转向美国服务器。要使用欧盟路由,请从 GET /api/v1/models?region=eu 中选择具有欧盟端点的模型,该列表列出了 72 个模型,包括 GLM 5.3。
ZDR 有一个限制。您的提示词仍在提供商的 GPU 上处理,因此它无法让您控制硬件。如果您的策略要求模型在您控制的部署上运行,Private Endpoints(企业计划)会将您自己的专用或微调部署添加到目录模型的提供商列表中。该部署必须托管在我们支持 BYOK(自带密钥)的提供商处,您的团队使用相同的 slug 调用它,如果您列出了公共端点,它们将作为回退方案保持可用。如果数据绝不能离开您操作的硬件,请自行托管并根据上述盈亏平衡表配置硬件规模。我们的 ZDR 解释器和数据驻留指南更详细地比较了这些选项。
能否同时自行托管和使用 API?
可以,对于大多数团队来说,盈亏平衡表指向这种设置。GPU 只有在高负载下才划算,因此根据您的流量稳定基础部分来配置自己的 GPU 规模,使其保持繁忙,并将峰值流量发送到 API,您只需为使用的部分付费。
这之所以可行,是因为 vLLM 和 SGLang 暴露了与我们相同的 OpenAI 兼容聊天 API。客户端通过更改 base URL、密钥和模型名称在这两者之间切换。在连接错误时,或在您的服务器返回其队列已满时的 429 或 503 错误时,回退到 API。在 API 端设置 provider.zdr on,以确保溢出流量保持零数据保留。如果您的策略要求提示词必须留在您控制的硬件上,请不要溢出到 API。
这种设置可能会出现两个问题。如果您的本地副本与 API 端点的精度不同,相同的提示词可能会得到不同的答案,因此请使用提供商路由将 API 端固定到匹配的量化版本。此外,中途切换后端的对话会丢失其 prompt cache(提示缓存),因此一旦对话开始,请将其保持在同一侧。
常见问题解答
自行托管 LLM 值得吗?
仅从成本角度来看,只有当您能让 GPU 保持繁忙时才值得。根据我们的数据,在租用 RTX 3090 上运行 Qwen3.8 27B,在负载达到 6% 到 12% 时实现盈亏平衡。DeepSeek V4.1 Flash 在租用的数据中心 GPU 上需要 37% 或更高的负载,而针对最便宜的零数据保留端点,它往往永远无法盈亏平衡。隐私和控制权可以在任何负载水平下证明自行托管的合理性。
哪个 LLM 最适合自行托管?
能够适配单张 GPU 的模型是最合适的选择,因为它们避免了多 GPU 服务器及其 API 价格留下的最大节省空间。例如,Qwen3.8 27B 在 4 bits 精度下可在一张 24 GB 显卡上运行。我们的排名以及开源权重与闭源权重的比较展示了开发者最常使用的模型。
最便宜的自托管 LLM 选项是什么?
您已经拥有的 GPU。RTX 3090 限制在 250 W,按照 2026 年 7 月美国住宅平均电价计算,电费约为每小时 0.05 美元,因此一旦它约 1% 的时间处于繁忙状态,其成本就低于 Qwen3.8 27B 的最便宜零数据保留端点。权衡之处在于每个用户的响应速度较慢以及您花在维护上的时间。
我可以托管自己的模型并通过 OpenRouter 使用它吗?
是的,在企业版计划中。私有端点将目录模型的标识符路由到您自己专属或微调的部署实例,该实例托管于我们支持的、允许自带密钥(BYOK)的服务提供商上。只有您批准的用户和组织才能查看或调用它。
后续步骤
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?
By subscribing you agree to receive the OpenRouter newsletter: model usage data, product updates, and research reports, about one email a week. Unsubscribe anytime via the link in every email. See our Privacy Policy .
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 tokens
A 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:
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:
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
首次收录 · 2026-11-13 · 9.95 分