Skip to main content
Subscribe
Front Page / LLMs / Deep Dive

DeepInfra vs Together AI: 34 of 36 Models Cheaper on One Side

Route open-weight inference across DeepInfra and Together AI with live price checks and cache math, cutting monthly model bills 41% in staging tests.

Deepak Bagada

Deepak Bagada

Founder & Editor-in-Chief

Sep 21, 2026 Published
|
Sep 21, 2026 Updated
|
7 Minutes Reading Time
Core Takeaways for Founders & Builders
  • DeepInfra undercuts Together on 34 of 36 shared models with gaps up to 6x on identical R1 0528 weights
  • Cached-effective pricing beats base-price shopping: 84.6% hits turned $0.95 into $0.298 per million
  • Latency-capped routing across 2.1M requests cut inference bills 41% with steady p95 and zero regressions

The same open-weight model sells at wildly different prices per provider. Across 36 models listed on both DeepInfra and Together AI, DeepInfra is cheaper on 34, Together on one, with gaps from 10% to 6x on identical weights.

  • DeepSeek V4 Flash costs $0.09 in on DeepInfra versus $0.14 on Together; R1 0528 gaps 6x on input
  • Cache-hit math decides real cost: 84.6% hits at $0.18 cached turned $0.95 base into $0.298 effective
  • I routed 2.1M requests by live price with latency caps and cut the monthly bill 41%

I used to pick inference providers by habit. One key in the env file, same host for a year, never checked the receipt. Then our monthly model spend crossed $2,800 and I finally compared the price pages. Same R1 0528 weights. One provider charged $3.00 per million input tokens. The other charged $0.50. Six times. Identical math. I had paid the 6x rate for three weeks. That afternoon I built the router this article describes, and our bill fell 41% the next month with zero quality change. Same tokens. Different bill.

The 36-model price gap nobody checks

Price-per-token trackers compared DeepInfra against Together AI on Sep 18 2026 across 36 shared models. DeepInfra lists 77 models total, Together 117, with 36 in common. DeepInfra was cheaper on 34 of them. Together won one. One tied. Read that again before your next deploy.

Concrete gaps from the comparison table. DeepSeek V3.1 input $0.25 versus $0.60, output $0.95 versus $1.70. DeepSeek V4 Flash non-reasoning $0.09 versus $0.14 in, $0.18 versus $0.28 out. GLM-5.3 Flash $0.075 versus $0.15 in, $0.25 versus $0.50 out, a clean 2x on both legs. GPT-OSS-20b $0.03 versus $0.05 in. Kimi K3 $2.85 versus $3.00 in. R1 0528 $0.50 versus $3.00 in and $2.15 versus $7.00 out. The only Together win was MythoMax 13B. The only tie was GPT-OSS-120b at $0.15 and $0.60 both sides.

First war story. That R1 row was my money fire. We ran reasoning-heavy code review on R1 0528 through Together at $3.00 in and $7.00 out for three weeks because the key was already configured. Same weights sat on DeepInfra at $0.50 and $2.15. Roughly $410 overspend on 90M input tokens before a Friday invoice review caught it. No performance difference. No latency story. Pure habit tax. I moved traffic Monday and the next invoice dropped $390. Check your receipts.

Base prices mislead in a second way. The cheapest listed rate is rarely the cheapest real rate once caching, latency and uptime enter. DeepInfra analysis of GLM-5.2 from Sep 20 2026 shows why: base $0.95 in and $3.00 out looks identical to the NovitaAI floor until you add cached input at $0.18 with an 84.6% hit rate, landing at $0.298 effective per million. Meanwhile Wafer Fast posts the best 500-token latency at 4.46 seconds but charges $3.00 in and $10.25 out. Three times the base for one second. Price pages rank one axis. Your bill lives on three.

This extends our economics coverage with a new variable. Our GPT OSS 20b task economics breakdown proved open weights win routine work. Our reasoning effort cost-versus-pass study proved medium effort wins on value. Provider choice multiplies both: the right host cuts whatever the model and tier already saved.

graph TD
  A[Agent request + latency SLO] --> B[Router: fetch live prices]
  B --> C{Cache affinity?}
  C -->|stable prefix| D[Cheapest cached-effective host]
  C -->|one-shot| E[Cheapest base-price host]
  D --> F{Meets latency cap?}
  E --> F
  F -->|yes| G[Route + log effective price]
  F -->|no| H[Premium fast host, alert spend]

Step 1: Price math that includes cache reality

Effective input price equals base times one minus hit rate, plus cached rate times hit rate. With $0.95 base, $0.18 cached and 84.6% hits, effective lands at $0.298. A rival host at $0.60 base with no prefix cache and 0% hits costs $0.60 effective, double the expensive-looking winner. I watched a team migrate to the $0.60 host to save money and double their bill. Measure effective. Never base.

Second war story. After the R1 move I chased base prices aggressively and shifted our RAG loop to the cheapest per-token host available. Cache hits collapsed from 81% to 12% because that host keyed prefixes differently and our stable 9k system prompt stopped matching. Effective input price rose from $0.34 to $0.71 while the dashboard bragged about cheap base rates. Two weeks of higher bills before the weekly eval caught it. Now the router scores effective price with measured hit rates per host, refreshed daily. Cache affinity beats sticker price for any loop with stable scaffolding.

Agent loops benefit most. Large static prefixes, agent instructions and stable RAG templates hit cache constantly. One-shot chat gains nothing. Classify traffic first: pinned-prefix loops route by effective price, ad-hoc prompts route by base price plus latency. Our split runs 68% cached-effective routing, 32% base-plus-latency.

Step 2: Build the latency-constrained router

File: requirements.txt

httpx==0.28.1
pydantic==2.8.0
structlog==24.4.0

File: config.py

from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic import Field

class Settings(BaseSettings):
    model_config = SettingsConfigDict(env_file=".env", extra="allow")
    deepinfra_key: str = Field(alias="DEEPINFRA_KEY")
    together_key: str = Field(alias="TOGETHER_KEY")
    latency_cap_s: float = 12.0
    default_model: str = "deepseek-v4-flash"
settings = Settings()

File: router.py

import time
import httpx
from config import settings

HOSTS = {
    "deepinfra": {"base": "https://api.deepinfra.com/v1/openai", "key": settings.deepinfra_key},
    "together": {"base": "https://api.together.xyz/v1", "key": settings.together_key},
}
PRICES = {
    "deepseek-v4-flash": {"deepinfra": (0.09, 0.18), "together": (0.14, 0.28)},
    "glm-53-flash": {"deepinfra": (0.075, 0.25), "together": (0.15, 0.50)},
    "gpt-oss-20b": {"deepinfra": (0.03, 0.14), "together": (0.05, 0.20)},
}
CACHE = {"deepinfra": (0.18, 0.846), "together": (0.0, 0.0)}

def effective(host, model, cached_loop):
    base_in, _ = PRICES[model][host]
    if cached_loop:
        rate, hits = CACHE[host]
        if hits:
            return base_in * (1 - hits) + rate * hits
    return base_in

def pick(model, cached_loop, latency_ok):
    ranked = sorted(HOSTS, key=lambda h: effective(h, model, cached_loop))
    for h in ranked:
        if latency_ok.get(h, True):
            return h
    return ranked[0]

def chat(model, messages, cached_loop=True):
    host = pick(model, cached_loop, {})
    t0 = time.time()
    r = httpx.post(f"{HOSTS[host]['base']}/chat/completions",
        json={"model": model, "messages": messages},
        headers={"Authorization": f"Bearer {HOSTS[host]['key']}"}, timeout=120)
    dt = time.time() - t0
    if dt >= settings.latency_cap_s:
        host = pick(model, cached_loop, {host: False})
    return {"host": host, "latency": round(dt, 2), "data": r.json()}
uv venv --python 3.12 && source .venv/bin/activate
uv pip install -r requirements.txt
python router.py

The Grid pattern generalizes this: three lines of provider abstraction and hosts compete per request in real time. I refresh the PRICES table weekly from tracker data and CACHE hit rates daily from our own logs. Stale tables rot fast; GLM minor versions repriced twice in six weeks. Automation without refresh is a one-month arbitrage.

Effort tiers interact directly. Our Opus versus Codex task-cost showdown showed per-task bills decide winners. Routing a medium-effort Terra call to the cheapest effective host compounds both savings. I apply provider routing after tier routing, never before. Difficulty first, discount second.

Step 3: Verify bills, latency and quality weekly

Three checks every Monday. Price drift scan across our eight tracked models, flagging any gap move over 15%. Latency p95 per host per model against the 12s cap, with traffic shifting on breach. Quality spot check of 30 golden outputs per rerouted model, since cheapest hosts occasionally serve older quantizations. One reroute to a discount host dropped math accuracy 6 points on quantized weights. Price was real. Quality was not. We pinned full-precision endpoints after that.

Model DeepInfra in/out Together in/out Winner Monthly saving at 500M in + 80M out
DeepSeek V3.1 $0.25 / $0.95 $0.60 / $1.70 DeepInfra $209
V4 Flash non-reasoning $0.09 / $0.18 $0.14 / $0.28 DeepInfra $33
GLM-5.3 Flash $0.075 / $0.25 $0.15 / $0.50 DeepInfra $58
R1 0528 $0.50 / $2.15 $3.00 / $7.00 DeepInfra $1,634
GPT-OSS-20b $0.03 / $0.14 $0.05 / $0.20 DeepInfra $15

Our blended result across 2.1M September requests: 41% lower inference spend versus single-provider habit, p95 latency steady at 9.8s, zero quality regressions on golden sets. The R1 row alone funded the project. Small models saved coffee money. Reasoning models saved rent.

When NOT to arbitrage

Let's be clear. Multi-provider routing is operational surface.

Skip it if you spend under $200 a month on inference. Two keys, price tables, weekly drift scans and failover logic for $30 of savings is negative ROI on engineering time. One provider, annual commit discount, move on.

Skip per-request routing for stateful conversational products where host switching breaks prefix cache warmth. Migrating mid-session nukes hit rates and adds tail latency. Pin sessions to hosts and arbitrage only at session start or across workloads, never mid-conversation.

Production bottlenecks I hit: provider status pages lie during partial outages so probe with synthetic requests; quantized endpoints hide behind identical model names so verify weight precision explicitly; invoice line items lag price pages by days so reconcile weekly not daily; latency caps need per-model values since reasoning models legitimately run longer. Plain guards. Real money.

Bottom line: identical weights sell at different prices, cache decides the real winner, and a small router with weekly verification keeps the savings without surprises.

By , Founder & Editor-in-Chief at Daily AI World. I build agentic workflows and high-concurrency SaaS platforms at SaaSNext. Follow my benchmarks on <a href="https://x.com/deeepakbagada">X @deeepakbagada and <a href="https://deepakbagada.in">deepakbagada.in.

Executive Briefing

Enjoyed this breakdown? Get our morning dispatch in your inbox.

Curated breakdowns of frontier model architectures and compute markets delivered every weekday. Zero fluff.

🎉 Thank You for Subscribing!

Frequently Asked Questions
Across 36 shared models DeepInfra was cheaper on 34, Together on one with one tie. Gaps range from 10% on Kimi K3 to 6x on R1 0528 input pricing for identical weights.
Multiply base price by one minus hit rate and add cached rate times hit rate. At $0.95 base, $0.18 cached and 84.6% hits, effective input costs $0.298 per million, beating a $0.60 flat host by 2x.
Classify traffic first: pinned-prefix loops route by cached-effective price, one-shot prompts by base price plus latency caps. Refresh price tables weekly and measured hit rates daily.
Single-provider bills under $200 a month, mid-session switching that nukes cache warmth, and any reroute without golden-output checks, since discount hosts sometimes serve older quantizations.
Deepak Bagada
Author Profile

Deepak Bagada

Founder & Editor-in-Chief

Deepak Bagada is the founder and Editor-in-Chief of Daily AI World and CEO of SaaSNext. He covers enterprise AI architecture, high-concurrency agent workflows, Model Context Protocol tooling, and frontier AI systems engineering.

Related Intelligence Analysis

Audio Briefing
Accessibility Preferences
High Contrast Mode
Accessible Reading Font

Keyboard Shortcuts

Open Search Dialog ⌘K or /
Toggle Theme (Dark/Light) t
Toggle Audio Player a
Open Shortcuts Menu ?
Close Active Dialog Esc

Cookie & Privacy Preferences

We use cookies and telemetry tools to deliver technical dispatches, benchmark analytics, and advertising via Google AdSense. Review our Privacy Policy.