惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
博客园_首页
Vercel News
Vercel News
WordPress大学
WordPress大学
美团技术团队
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Y
Y Combinator Blog
博客园 - 【当耐特】
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
腾讯CDC
M
MIT News - Artificial intelligence
爱范儿
爱范儿
Recent Announcements
Recent Announcements
雷峰网
雷峰网
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
Jina AI
Jina AI
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
P
Privacy & Cybersecurity Law Blog
Recorded Future
Recorded Future
Help Net Security
Help Net Security
N
News and Events Feed by Topic
博客园 - Franky
P
Proofpoint News Feed
L
LINUX DO - 热门话题
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
D
Docker
Google DeepMind News
Google DeepMind News
有赞技术团队
有赞技术团队
IT之家
IT之家
Security Latest
Security Latest
L
LangChain Blog
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks

OpenRouter Blog

Choosing the Optimal Image Input Detail Level in LLMs — OpenRouter Blog DeepSeek V4 Is Earning Agentic Token Share — OpenRouter Blog The Open Weight Models that Matter: June 2026 — OpenRouter Blog The OpenRouter MCP Server — OpenRouter Blog Introducing the Unified Image API — OpenRouter Blog The AI Governance Checklist That Maps to Your Stack — OpenRouter Blog Enforce AI Data Residency at the Routing Layer — OpenRouter Blog OpenRouter vs Portkey: Routing Network vs Control Plane — OpenRouter Blog Connect OpenClaw to OpenRouter: One Key, Failover, Free Models — OpenRouter Blog Connect SillyTavern to OpenRouter: Setup, Models, Fixes — OpenRouter Blog A Robot is Sprinting Towards You: Do You Want it Running on Claude or Grok? Kilo Code + OpenRouter: Setup, Routing, and Free Models — OpenRouter Blog Codex CLI with OpenRouter: config.toml Setup and Models — OpenRouter Blog Claude Code with OpenRouter: Setup, Models, and Costs — OpenRouter Blog How to Use OpenRouter With Any Coding Agent or AI Tool — OpenRouter Blog Subagent: Let Your Model Delegate the Busywork — OpenRouter Blog Free LLM API in 2026: 13 Options Ranked and Compared — OpenRouter Blog How to Enforce Agentic AI Governance at the API Layer — OpenRouter Blog Keep Your Agent Running When Models Disappear — OpenRouter Blog Hermes Agent + OpenRouter: Setup, Model Choice & Routing Config — OpenRouter Blog Lowest-Cost LLM Inference: The Complete OpenRouter Guide — OpenRouter Blog How OpenRouter Model Routing Works: Providers, Fallbacks & Auto Router — OpenRouter Blog OpenRouter Failover: Provider Failover vs Model Fallbacks Explained — OpenRouter Blog Surpassing Frontier Performance with Fusion — OpenRouter Blog Dinner is Served — OpenRouter Blog LLM Gateway: What It Is and How to Choose One — OpenRouter Blog Advisor: Give Any Model a Lifeline to a Smarter One — OpenRouter Blog Gemini 2.5 Flash API - Pricing, Quickstart & Provider Comparison — OpenRouter Blog EU AI Act & Colorado ADMT Compliance: Human Oversight for AI Agents — OpenRouter Blog May Release Spotlight — OpenRouter Blog Guardrails: Protect your Agents, Data, and Costs — OpenRouter Blog OpenRouter Raises $113M Series B — OpenRouter Blog Human-in-the-Loop Tools for the Agent SDK — OpenRouter Blog Consistent Web Search and Fetch Across Every Model — OpenRouter Blog GPT-5.5 Price Increase: What It Actually Costs — OpenRouter Blog New Audio APIs for Speech and Transcription — OpenRouter Blog Response Caching: Zero Cost for Identical Requests — OpenRouter Blog April Release Spotlight — OpenRouter Blog Create OpenRouter Accounts via CLI with Stripe Projects — OpenRouter Blog Opus 4.7 Agent SDK: Building Multi-turn Agent Workflows on OpenRouter — OpenRouter Blog Build Your Own Harness with the Agent SDK — OpenRouter Blog Introducing Workspaces — OpenRouter Blog Announcing Video Generation — OpenRouter Blog Auto Exacto: Adaptive Quality Routing, On by Default — OpenRouter Blog February Release Spotlight — OpenRouter Blog OpenRouter Outages on February 17 and 19, 2026 — OpenRouter Blog January Release Spotlight — OpenRouter Blog Distillable Models and Synthetic Data Pipelines with NeMo Data Designer — OpenRouter Blog December Release Spotlight — OpenRouter Blog Response Healing: Reduce JSON Defects by 80%+ — OpenRouter Blog The 2025 State of AI Report — OpenRouter Blog Is Implicit Caching Prompt Retention? — OpenRouter Blog Provider Variance: Introducing Exacto — OpenRouter Blog 1 million free BYOK requests per month — OpenRouter Blog The First-Ever Image Model Is Up on OpenRouter — OpenRouter Blog GPT-5 is now live — OpenRouter Blog Audio Inputs and PDF URLs for Apps — OpenRouter Blog Presets: How To Seamlessly Transfer Model Configurations Across Apps — OpenRouter Blog New Privacy-Focused Provider Drop: Venice — OpenRouter Blog Use OpenRouter Models in Cursor: Try it with Moonshot AI Updates to Our Free Tier: Sustaining Accessible AI for Everyone — OpenRouter Blog New Stealth Model: "Cypher Alpha" — OpenRouter Blog Introducing Presets: Manage LLM Configs from Your Dashboard! — OpenRouter Blog Dev & BYOK Updates: Uptime API + Smarter Key Management — OpenRouter Blog Simplifying Our Platform Fee — OpenRouter Blog GIF Prompts, Omni Search, Tool Caching, and BYOK Flags — OpenRouter Blog New Features: Reasoning Streams, Crypto Invoices, End-User IDs & More — OpenRouter Blog Passkeys, DevEx Upgrades, and a New Guide for TypeScript Agents — OpenRouter Blog New Provider Drop: Cerebras Is Here — OpenRouter Blog Better Insights, Faster Metrics, and New Developer Power Tools — OpenRouter Blog Privacy Clarity, New Providers, OAuth Upgrade, and Gemini Gets Parallel Tools — OpenRouter Blog Universal PDF Support — OpenRouter Blog Smarter Charts, Inline SVGs, and Live Usage Accounting — OpenRouter Blog Quasar Alpha and Optimus Alpha Reveal — OpenRouter Blog "Stealth" model: Optimus Alpha — OpenRouter Blog “Stealth” model: Quasar Alpha — OpenRouter Blog Never Pay for Empty AI Responses Again — OpenRouter Blog Deep Research & Many New Models — OpenRouter Blog Introducing Nitro and Floor Price Shortcuts — OpenRouter Blog Introducing Cloudflare as a new provider — OpenRouter Blog Reasoning Tokens for Thinking Models — OpenRouter Blog Introducing Web Search via the API — OpenRouter Blog Standardized finish reasons — OpenRouter Blog Happy New Year! Introducing a new Auto Router — OpenRouter Blog Holiday launches: Web Search & Price Cuts — OpenRouter Blog Bring Your Own API Keys — OpenRouter Blog Crypto Payments API — OpenRouter Blog Structured Outputs & Free Gemini Flash 2.0 — OpenRouter Blog Price Drops and Llama 3.3 70b — OpenRouter Blog Author Pages & Amazon Nova — OpenRouter Blog
OpenRouter vs LiteLLM: Managed vs Self-Hosted Gateway — OpenRouter Blog
OpenRouter · 2026-06-19 · via OpenRouter Blog

If you’re choosing between OpenRouter and LiteLLM for a production gateway, the decision comes down to where the routing layer should run.

Both give you a single OpenAI-compatible API across many providers. OpenRouter runs that layer for you, so there’s no infrastructure to operate. LiteLLM runs inside your own infrastructure, so your data stays on your network and you pay no platform fee, in exchange for operating PostgreSQL, Redis, and Docker yourself.

Pick LiteLLM when data can’t leave your network, you need role-based access control inside your own infrastructure, or your model spend is high enough that the 5.5% platform fee costs more than running the proxy. Most other cases favor the managed option.

Decide where the routing layer lives

OpenRouter sits between your app and 70+ providers, running on Cloudflare’s edge. Your app calls https://openrouter.ai/api/v1, OpenRouter applies routing and failover, and forwards the request to an upstream provider. You never manage a server, a database, or per-provider credentials.

LiteLLM is a proxy you deploy yourself, as a Docker container or Kubernetes pod. It exposes the same OpenAI-compatible endpoint inside your network, rewrites each request into a provider’s native format, and forwards it. PostgreSQL stores spend data and keys; Redis handles caching and rate limits in production. You run all three.

That difference is what a compliance team asks about first. With LiteLLM, request data never leaves your network before it reaches the provider. With OpenRouter, requests pass through a managed layer first, so teams with strict data-residency rules should review the available routing and Zero Data Retention controls.

OpenRouter:  app -> OpenRouter (Cloudflare edge) -> provider
LiteLLM:     app -> LiteLLM proxy (your infra: Docker + PostgreSQL) -> provider

What each gateway costs

OpenRouter passes provider pricing through at 0% markup, then charges a 5.5% platform fee on pay-as-you-go credit purchases, with a $0.80 minimum per purchase. Bring Your Own Key drops the fee to 5%, and the first 1 million requests each month are waived. Failed requests aren’t billed.

LiteLLM is free to self-host. You pay for infrastructure instead: the PostgreSQL database, optional Redis, and compute, which typically runs a few hundred dollars a month for a production deployment. LiteLLM Enterprise adds SSO, SCIM, RBAC, audit logs, and Prometheus metrics, priced through their sales team.

The crossover is arithmetic. Divide your monthly infrastructure cost by the 5.5% fee. At roughly $200/month of infra, LiteLLM gets cheaper once your model spend passes about $3,600/month; at $500/month of infra, that line moves to about $9,100/month. Below it, the managed fee costs less than the engineering time to run the proxy.

Compare routing, failover, and latency

OpenRouter routes well by default. Its Auto Router, powered by NotDiamond, picks a model per prompt, and provider-level routing deprioritizes any provider that has seen outages in the last 30 seconds. You can constrain routing with a provider object that filters by price, throughput, latency, data policy, ZDR, and quantization.

LiteLLM gives you more strategies and full custom logic. It ships six routing modes: weighted pick, latency-based, rate-limit-aware, least-busy, lowest-cost, and a custom mode where you write Python. Fallback lists let the proxy try the next model when one fails. If you need per-team or per-model rules enforced at the proxy, LiteLLM gives you the hooks.

Latency depends on how much you tune. LiteLLM reports about 2ms of median overhead (8ms P95, 13ms P99) on a 4-instance deployment of 4 CPUs and 8 GB each, tested against a mock endpoint; drop to 2 instances and median overhead rises to about 12ms (LiteLLM’s self-reported benchmarks). OpenRouter adds a network hop on Cloudflare’s edge that you don’t tune or scale. One is a knob you own, the other is a constant you don’t.

Match compliance needs to the right gateway

OpenRouter brings third-party attestation. It’s SOC 2 Type 2 compliant, with the full report at trust.openrouter.ai, supports GDPR, offers Zero Data Retention per request or account-wide, and can route through EU-based providers for enterprise accounts. Workspaces add per-team organization, budgets, and cost attribution on top.

LiteLLM brings data sovereignty. Because you host it, requests never leave your infrastructure before reaching the provider, so you enforce your own controls. LiteLLM Enterprise adds RBAC, SSO/JWT auth, audit logs, and per-team budgets. It doesn’t hold independent SOC 2, ISO 27001, or HIPAA certifications, so your deployment is responsible for meeting those standards.

Use both, or switch in a few lines

The two aren’t mutually exclusive. LiteLLM can use OpenRouter as an upstream provider, so you get LiteLLM’s local RBAC and logging while OpenRouter handles multi-provider failover and model breadth.

model_list:
  - model_name: or-claude
    litellm_params:
      model: openrouter/anthropic/claude-opus-4.6
      api_key: "your-openrouter-key"
      api_base: "https://openrouter.ai/api/v1"
  - model_name: or-gpt4o
    litellm_params:
      model: openrouter/openai/gpt-4o
      api_key: "your-openrouter-key"
      api_base: "https://openrouter.ai/api/v1"

Switching direction is a base URL and key change, since both speak the OpenAI format.

from openai import OpenAI

# OpenRouter
client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="your-openrouter-key",
)

# LiteLLM
client = OpenAI(
    base_url="http://your-litellm-host:4000",
    api_key="your-litellm-master-key",
)

That keeps both gateways behind one client. If you aren’t standardizing on the OpenAI SDK, OpenRouter has its own (openrouter for Python, @openrouter/sdk for TypeScript) that calls the OpenRouter side natively, with no base URL to set.

from openrouter import OpenRouter
import os

with OpenRouter(api_key=os.environ["OPENROUTER_API_KEY"]) as client:
    response = client.chat.send(
        model="anthropic/claude-opus-4.6",
        messages=[{"role": "user", "content": "Hello"}],
    )

If you’re weighing more than these two, our LLM gateway comparison covers Portkey, Helicone, Cloudflare AI Gateway, and others.

Frequently asked questions

Is LiteLLM like OpenRouter?

They share an OpenAI-compatible API across many providers, but they’re built differently. LiteLLM is an open-source proxy you self-host; OpenRouter is a managed gateway that runs on infrastructure you don’t operate. The split shows up in data residency, operational overhead, and fees.

Can I use LiteLLM and OpenRouter together?

Yes. LiteLLM supports OpenRouter as an upstream provider, so you can route through LiteLLM locally for RBAC and audit logging while OpenRouter handles multi-provider failover and model breadth.

Is OpenRouter free?

OpenRouter has 20+ free models for evaluation. Paid usage passes through provider pricing at 0% markup, plus a 5.5% platform fee on credit purchases. Bring Your Own Key drops the fee to 5%, with the first 1 million requests each month waived.

Does OpenRouter store my prompts?

By default, no. OpenRouter doesn’t retain prompts or responses. Zero Data Retention is available per request via a header or account-wide in your settings.

What’s the latency overhead of OpenRouter vs LiteLLM?

LiteLLM reports about 2ms of median overhead on a tuned 4-instance deployment, tested against a mock endpoint; a 2-instance setup rises to about 12ms. OpenRouter adds a network hop on Cloudflare’s edge that you don’t tune or scale yourself.