All articles

OpenRouter Alternatives 2026: LLM Gateway Comparison for Developers Switching Providers

Comparing the top OpenRouter alternatives in 2026 — LiteLLM, Portkey, Cloudflare AI Gateway, and TheRouter — across pricing, model coverage, fallback routing, OpenAI SDK compatibility, and self-hosted deployment options.

· TheRouter

If you are evaluating OpenRouter alternatives in 2026, you are probably running into one of three problems: the 5.5 % platform fee adds up at scale, you need self-hosted deployment for compliance, or you want tighter control over fallback routing than a managed multi-provider endpoint gives you. We went through the same evaluation, so here is a concrete comparison of the five gateways that show up most often when developers search for an OpenRouter replacement.

OpenAI-compatible means a provider exposes a chat-completions endpoint whose request and response shape matches the OpenAI API contract closely enough that an unmodified OpenAI SDK call works against it after swapping three values: API key, base URL, and model name. The minimum surface in practice is POST /v1/chat/completions with messages, model, and an OpenAI-shaped streaming response.

TL;DR comparison table

FeatureOpenRouterLiteLLMPortkeyCloudflare AI GatewayTheRouter
DeploymentManaged onlySelf-hosted (OSS) or EnterpriseManaged + OSS gatewayManaged (Cloudflare edge)Managed
Pricing modelProvider rates + 5.5 % platform feeFree (OSS); Enterprise by annual capacityFree tier → $49/mo Production → Enterprise customFree core; $5/mo Workers Paid for higher log limitsUsage-based
OpenAI SDK compatibleYes (/api/v1/chat/completions)Yes (drop-in proxy)Yes (Universal API)Yes (prefix-based URL rewrite)Yes (routes OpenAI-compatible requests)
Provider count50+100+ (self-configured)250+ (via virtual keys)Any (URL rewrite, no provider lock-in)Configured providers
Fallback routingroute: 'fallback' + model arrayFallback config in YAMLAutomatic fallbacks in gateway configManual (custom Worker logic)Supports fallback when live product paths support it
Self-hosted optionNoYes (core product)Yes (OSS gateway)No (Cloudflare edge only)No
ObservabilityDashboard + usage APIPrometheus metrics, request/response loggingLogs, traces, feedback, custom metadataDashboard analytics, persistent logsUnified billing/accounting surfaces
GuardrailsNone built-inVia external integrations (Lakera, custom)LLM + partner guardrails (Production tier+)Llama Guard 3 (billed as Workers AI)N/A
Free tier28+ free models, 20 RPMUnlimited (self-hosted)10k logged requests/mo, 3-day retention100k logs total (Free plan)N/A

Sources: OpenRouter docs (retrieved 2026-07-29), LiteLLM pricing (retrieved 2026-07-29), Portkey pricing (retrieved 2026-07-29), Cloudflare AI Gateway pricing (retrieved 2026-07-29).

Why developers look for OpenRouter alternatives

OpenRouter solved a real problem: one API key, many models, no per-provider accounts. But three patterns push teams to evaluate alternatives:

Cost at scale. OpenRouter charges provider token rates plus a 5.5 % platform fee on credit purchases. At low volume that is fine. At 10 M+ tokens per month the fee becomes a line item worth optimizing — especially when you already hold direct API keys with providers.

Deployment control. Regulated industries, data-residency requirements, and air-gapped environments need self-hosted gateways. OpenRouter is managed-only; there is no self-hosted option.

Routing granularity. OpenRouter's route: 'fallback' with a model array covers the basic case. Teams needing weighted load balancing, cost-based routing, latency-aware selection, or provider-specific retry policies often outgrow it.

None of these are dealbreakers for everyone. If OpenRouter's model coverage and managed simplicity fit your workload, it remains a strong choice. The comparison below is for teams where one of these constraints has become a blocker.

Head-to-head: pricing models and free tiers

OpenRouter

OpenRouter passes through provider per-token rates with no per-token markup. The platform charges a 5.5 % fee on credit purchases (minimum $0.80 per purchase). Bring-your-own-key (BYOK) usage carries a 5 % tail fee. Free-tier users get access to 28+ free models with 20 requests per minute and 50–1,000 requests per day depending on the model.

Source: OpenRouter pricing blog (retrieved 2026-07-29).

LiteLLM

LiteLLM's open-source proxy is free to self-host, forever — no license fee, no per-token charge. You configure your own provider API keys in a YAML file. The Enterprise tier adds SSO, SCIM, audit logs, secret manager integration, multi-region control plane, and 24/7 support. Enterprise pricing is based on annual gateway request capacity and deployment architecture, never per token.

Source: LiteLLM pricing page (retrieved 2026-07-29).

Portkey

Portkey offers a free Developer tier (10,000 recorded logs per month, 3-day log retention). The Production tier costs $49 per month and includes 100,000 recorded logs, 30-day log retention, LLM guardrails, unlimited prompt templates, and RBAC. Enterprise pricing is custom, starting at 10 M+ recorded logs per month with custom retention, SSO, private cloud deployment, and SOC2/GDPR/HIPAA compliance options. Exceeding log limits does not block requests — only logs beyond the limit are dropped.

Source: Portkey pricing page (retrieved 2026-07-29).

Cloudflare AI Gateway

Cloudflare AI Gateway's core features — dashboard analytics, caching, and rate limiting — are free on all plans. Log storage scales with your Cloudflare Workers plan: 100,000 logs total on the free plan, 10,000,000 logs per gateway on the $5/month Workers Paid plan. Unified Billing (letting you purchase provider credits through Cloudflare) carries a 5 % fee on credit purchases, with provider inference pricing passed through at cost. Guardrails use Llama Guard 3 on Workers AI and are billed as Workers AI inference.

Source: Cloudflare AI Gateway pricing (retrieved 2026-07-29).

TheRouter

TheRouter routes OpenAI-compatible requests through configured providers and provides unified billing and accounting surfaces where implemented. Pricing is usage-based.

Head-to-head: model coverage and provider breadth

OpenRouter aggregates 50+ providers and hundreds of models behind one API key. You do not need direct provider accounts — OpenRouter handles credentials. The trade-off is that model availability depends on OpenRouter's integration timeline; new models may lag provider launches by hours or days.

LiteLLM supports 100+ providers, but you supply your own API keys. Coverage is as broad as your provider contracts. LiteLLM maintains a model cost map that tracks pricing for supported models, so spend tracking works across providers without manual configuration.

Portkey claims 250+ provider integrations through its Universal API. Like OpenRouter, you can use Portkey-managed keys or bring your own. Virtual keys abstract provider credentials at the gateway level.

Cloudflare AI Gateway is provider-agnostic by design — it rewrites URLs at the edge. You point it at any provider's endpoint and Cloudflare proxies the request. This means it works with any provider that accepts HTTP requests, but you manage all provider relationships yourself.

TheRouter routes requests through configured providers with model routing and fallback support. Provider coverage depends on the configured routing table.

Head-to-head: fallback routing and reliability features

Fallback routing — automatically retrying a request on a different provider or model when the primary fails — is the feature that separates gateways from simple API proxies.

OpenRouter supports fallback via the models array with route: 'fallback'. If the first model returns an error, OpenRouter tries the next model in the array. This covers the basic "primary model down, try backup" case. Provider-level routing preferences can be specified via the provider parameter.

from openai import OpenAI

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="sk-or-...",
)

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
    extra_body={
        "models": ["openai/gpt-4o", "anthropic/claude-sonnet-4", "google/gemini-2.5-flash"],
        "route": "fallback",
    },
)

LiteLLM supports fallback lists, retries, and timeouts in its proxy configuration. You define fallback models in a YAML config, set retry counts, and configure timeout thresholds. Because it is self-hosted, you control the retry logic, including provider-specific retry policies and circuit breakers via custom callbacks.

model_list:
  - model_name: gpt-4o
    litellm_params:
      model: openai/gpt-4o
      api_key: sk-...
  - model_name: gpt-4o
    litellm_params:
      model: anthropic/claude-sonnet-4
      api_key: sk-ant-...

litellm_settings:
  num_retries: 3
  request_timeout: 30

Portkey provides automatic fallbacks, load balancing, retries, and timeouts through its gateway configuration. Fallback targets can include different providers, models, or even different Portkey virtual keys. The gateway handles routing decisions at the edge.

Cloudflare AI Gateway does not include built-in fallback routing. You implement fallback logic in a Cloudflare Worker that sits in front of the gateway, giving you full control but requiring more code.

TheRouter supports provider/model routing and fallback when live product paths support it.

Head-to-head: OpenAI SDK compatibility depth

All five gateways accept OpenAI-format requests. The differences are in how deeply they support the full OpenAI API surface:

CapabilityOpenRouterLiteLLMPortkeyCloudflare AI GatewayTheRouter
Chat completionsYesYesYesYes (pass-through)Yes
StreamingYesYesYesYesYes
Tool callingYes (transforms for non-OpenAI providers)Yes (maps across providers)YesYes (pass-through)Yes
Structured output / response_formatYesYesYesYes (pass-through)Yes
EmbeddingsYesYesYesYes (pass-through)Yes
Image generationYesYesYesYes (pass-through)Supports async media jobs through /v1/jobs/:id

The practical test: can you switch base_url in your OpenAI SDK client and have everything work? For chat completions and streaming, all five pass. For advanced features like provider-specific parameters, response field preservation, and edge-case error mapping, test with your specific models.

Head-to-head: self-hosted vs managed deployment

This is the sharpest differentiator:

Self-hosted options:

  • LiteLLM — the core product is a self-hosted proxy. Deploy via Docker, Kubernetes, or bare metal. Air-gapped deployment is available on Enterprise. Your data and API keys never leave your infrastructure.
  • Portkey — offers an open-source gateway for self-hosting with Universal API, retries, routing, guardrails, and a basic dashboard. The full feature set (advanced guardrails, governance, SSO) requires the managed platform or Enterprise self-hosted deployment.

Managed-only:

  • OpenRouter — no self-hosted option. All traffic routes through OpenRouter's infrastructure.
  • Cloudflare AI Gateway — runs on Cloudflare's edge network. No self-hosted version, but your provider API keys are stored in your Cloudflare account.
  • TheRouter — managed service.

If data residency or air-gapped deployment is a hard requirement, LiteLLM is the strongest option. If you want managed convenience with an escape hatch, Portkey's OSS gateway provides a middle ground.

Decision matrix: pick X if you need Y

If you need…Consider
Fastest setup, no provider accounts, maximum model breadthOpenRouter — one API key, 50+ providers, free models available
Self-hosted gateway, full infrastructure control, zero platform feesLiteLLM — free OSS proxy, 100+ providers, your keys
Managed gateway with observability, guardrails, and prompt managementPortkey — $49/mo Production tier covers most team needs
Edge caching, DLP scanning, Cloudflare ecosystem integrationCloudflare AI Gateway — free core features, pay for log volume
OpenAI-compatible routing with provider fallback and unified billingTheRouter — routes requests through configured providers with fallback support

How TheRouter fits

TheRouter routes OpenAI-compatible requests through configured providers. When you point the OpenAI SDK at TheRouter's endpoint, it handles provider selection and fallback routing where supported. Unified billing and accounting surfaces give you one view of spend across providers.

from openai import OpenAI

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

response = client.chat.completions.create(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
)

The switch from OpenRouter (or any OpenAI-compatible gateway) is a base_url and api_key change. No SDK swap, no request format changes.

For a broader gateway-level comparison covering architecture and observability in more depth, see our Unified LLM API Providers and Gateway Comparison 2026.

FAQ

Is OpenRouter's 5.5 % fee per-token or per-purchase? Per credit purchase. OpenRouter passes through provider token rates without per-token markup. The 5.5 % is applied when you buy credits (minimum $0.80 per purchase). BYOK usage carries a separate 5 % tail fee. Source: OpenRouter pricing (retrieved 2026-07-29).

Can I use LiteLLM without paying anything? Yes. The open-source proxy is free to self-host with no license fee. You pay only your provider API costs. Enterprise adds governance, SSO, and support on top of the same gateway, priced by annual request capacity. Source: LiteLLM pricing (retrieved 2026-07-29).

Does Cloudflare AI Gateway add any markup to provider token prices? No. Provider inference pricing is passed through at cost. Cloudflare's Unified Billing charges a 5 % fee on credit purchases (similar to OpenRouter's model). Core gateway features are free. Source: Cloudflare AI Gateway pricing (retrieved 2026-07-29).

Which gateway has the best free tier for prototyping? For managed: OpenRouter (28+ free models) or Cloudflare AI Gateway (free analytics, caching, rate limiting). For self-hosted: LiteLLM (unlimited, free forever). Portkey's free tier covers 10k logged requests per month.

Can I migrate from OpenRouter to another gateway without changing my application code? In most cases, yes. All five gateways support the OpenAI chat completions format. The migration is typically a base_url and api_key change. Model IDs may differ between gateways, so verify your model identifiers against the target gateway's model list. See our OpenAI to TheRouter Migration Guide for a step-by-step walkthrough.


Sources cited in this post: OpenRouter API docs, OpenRouter free LLM APIs comparison, LiteLLM pricing, LiteLLM GitHub, Portkey pricing, Cloudflare AI Gateway pricing, Cloudflare AI Gateway overview. All retrieved 2026-07-29.

Customer Support