OpenRouter by default: one key and one bill for every model, with fallbacks between providers, for 5.5% on credits. Cloudflare AI Gateway in front of it when you want logs, caching, rate and spend limits per client, and a way around OpenRouter itself, for a URL change and no fee. A self-hosted LiteLLM proxy only when every call and every log must stay inside the client's AWS account, in Sydney, in front of Bedrock, and the team will patch it: its 2026 supply-chain incidents make pinned versions non-negotiable. Usually two of them together: OpenRouter serves the models, the gateway controls the traffic.
When to pick which
Pick OpenRouter when
- You want every model behind one key, one SDK and one bill, and switching models is one string.
- Fallbacks between providers of the same model, and between models, without writing them.
- Per-key credit limits for each client or feature, and traces sent to Langfuse, Datadog or PostHog.
Pick Cloudflare AI Gateway when
- Logs, cost analytics, rate limits and spend limits per client, with no code change beyond a base URL, and no fee.
- A fallback that goes around OpenRouter itself, straight to a provider with your own key.
- Caching repetitive, identical prompts, or stopping personal data before it reaches a provider.
Pick LiteLLM, self-hosted when
- Every request and every log must stay inside the client's AWS account in Sydney, in front of Bedrock, and no outside gateway is allowed.
- The team will run it like any production service: pinned versions, a Postgres, patches within days.
Both, when
- OpenRouter behind Cloudflare AI Gateway is my usual shape: OpenRouter picks and serves the model, the gateway logs and limits the traffic, and a gateway fallback reaches a provider directly if OpenRouter is down.
- Per-user rules (login, quota, 50 messages a day) belong in your own Worker or Lambda, in front of either: a gateway knows the traffic, not the user.
- LiteLLM and an outside gateway together defeats the point of LiteLLM: if the logs may leave AWS, a managed gateway does the job without a server to patch.
Questions that change the answer
Must the prompts and the logs stay in Australia? Then neither OpenRouter nor Cloudflare's logs qualify: Bedrock in Sydney, with LiteLLM if you need a gateway at all.
How many providers do you really call? One provider and no budgets to enforce needs no gateway: call it directly.
Who answers when the gateway breaks at 2 am? A managed one is someone else's pager; a self-hosted one is yours.
What do you need per client: spend caps, logs, separate keys? That decides between OpenRouter's key limits, a gateway per client, or both.
Proxy, router, gateway: the words
Three words get used for the same box, and they mean different things:
- A proxy forwards requests. Mine is a Worker that holds the provider key, so the browser never sees it: The LLM streaming proxy is the worked example. Every app that calls a model from a browser needs one, gateway or not.
- A router decides which model or provider answers each request: by price, by latency, by availability. OpenRouter is a router you rent.
- A gateway sits in the traffic and governs it: keys, logs, cost per client, rate and spend limits, caching, retries and fallbacks. Cloudflare AI Gateway is one, and LiteLLM's proxy server is one you host.
So the real question is rarely "which gateway?". It's which of those jobs you need, and who should run each.
The short version
| OpenRouter | Cloudflare AI Gateway | LiteLLM proxy, self-hosted | |
|---|---|---|---|
| My verdict | My default | Watching: on my shortlist | Not something I run |
| What it is | A router that serves every model, on one key | A gateway in front of any provider | An open-source gateway you host |
| Serves models itself | Yes, through its providers | No: it forwards to them | No: it forwards to them |
| Fee | 5.5% on credits; with your own keys, the first $25,000 a month free, then 5% | Free; logs beyond 20M events a month at $0.60 per million | MIT-licensed; you pay the hosting, about $77 a month on AWS for one small setup (my estimate), and the engineer |
| Per-client control | Credit limits per key | One gateway per client: logs, rate and spend limits | Virtual keys with budgets and spend tracking |
| Fallbacks | Between providers and models | Retries; route fallbacks for OpenAI-format requests | Fallbacks and load balancing |
| Data in Australia | No: global routing, in-region only for the EU and the US, on Business | No: logs can't be pinned to a jurisdiction | Yes, if you host it in Sydney in front of Bedrock |
| Who runs it | OpenRouter | Cloudflare | You |
OpenRouter: the router I already use
OpenRouter is how my client systems reach models: one SDK, one key, every vendor, and the price of each model passes through, plus 5.5% on credit purchases. Bring your own provider keys and the first $25,000 of usage a month carries no fee at all, then 5%. It already does the router's job well. If a provider of a model is down or slow, it tries the next; a models list falls back to another model; and provider routing can sort by price, latency or throughput, exclude providers, or require zero data retention.
It has a gateway's basics too: a credit limit on each key, presets that name a model with its fallbacks and parameters, and Broadcast, which sends traces to about twenty tools, Langfuse, Datadog and PostHog among them. For many apps that's enough, and adding a gateway in front buys nothing but a hop.
What it can't give you is a way out of OpenRouter. If OpenRouter itself fails, every model fails with it.
Cloudflare AI Gateway: control for a URL change
The gateway doesn't host models. You point the SDK's base URL at it, and every call to OpenRouter, Anthropic, OpenAI, Bedrock or Workers AI passes through Cloudflare first, where it's logged, counted, rate-limited, capped, cached if identical, and retried. One gateway per client and environment gives each client its own logs, cost analytics and limits, with no change to the app's code. The core is free; Workers Paid ($5 a month) includes 20 million log events a month.
Its best trick in front of OpenRouter is redundancy: a fallback that sends the request straight to a provider with your own key when OpenRouter is down. That fallback runs through dynamic routing, which only accepts the OpenAI chat-completions format, so it works for OpenRouter calls but not for Anthropic-format traffic such as Claude Code's, which still gets the logs, retries and limits.
Three limits to plan for. Spend limits are estimates from token counts, enforced with a lag, so they're a guardrail, not a wallet. The cache matches identical requests only. And a gateway token reaches every gateway and stored key in the account, so a client whose keys must be isolated gets an account of their own. Setup, the costs and the Claude Code variables are on the entry.
LiteLLM: a gateway you host and patch
LiteLLM's proxy server is open source (MIT, apart from an enterprise folder) and does a gateway's whole job: virtual keys, budgets and rate limits per key, spend tracking, fallbacks and load balancing across a hundred-odd providers, and guardrails. It needs a Postgres, and Redis once it runs on more than one instance. On AWS, one small Fargate task, a small Postgres and a load balancer come to roughly $77 a month at list prices, before logs, networking and the time of whoever runs it. That's my estimate, not a vendor price.
The case for it is narrow and real: a client whose prompts, answers and logs must all stay in their own AWS account in Sydney. Bedrock keeps the inference there; Cloudflare's logs and OpenRouter's routing don't. A LiteLLM proxy in the same account, in front of Bedrock, is the one gateway here that stays inside that boundary.
The case against it is 2026's record. In March, two releases on PyPI were malicious, published with the maintainers' PyPI credentials after a poisoned security-scanner GitHub Action stole them. On 21 October, version 1.107.0 was poisoned on PyPI and on the Docker latest tags with a credential stealer, traced back to a key leaked in May and never revoked. A gateway holds every provider key you own, so that's the worst place for a supply-chain compromise. If you run it: pin an exact version and image digest, never latest, build from a reviewed release, keep it off the internet behind your own auth, and give it keys scoped to what it calls.
Do you need one at all?
Often not on day one. An app on one provider, with no budgets to enforce per client, needs a proxy for the key and nothing else. OpenRouter covers the next stage, many models on one bill. A gateway earns its place when there are several clients to separate, spend to cap, or an outage you can't afford to wait out. And for strict Australian residency, the model call itself has to happen in Sydney first: Amazon Bedrock, compared with the alternatives in Anthropic API, Bedrock or OpenRouter?.
Sources, checked on 27 October 2026: AI Gateway pricing, AI Gateway dynamic routing, AI Gateway authentication, OpenRouter FAQ (fees), OpenRouter BYOK, OpenRouter provider routing, OpenRouter model fallbacks, deploying the LiteLLM proxy, LiteLLM enterprise features, LiteLLM security incident, 21 October 2026, Snyk on the March compromise, Datadog Security Labs on the October compromise.