Originally published at devtoolpicks.com
Stripe just agreed to buy OpenRouter for over $7 billion. Palo Alto Networks closed its acquisition of Portkey in May. That's two independent AI gateways bought in one year, and every indie hacker running traffic through a hosted router should be re-reading the terms of service. If your router can be acquired, your routing costs can change. So this comparison looks at the three gateways you'd shortlist when you want more control than OpenRouter offers: LiteLLM on your own server, Portkey as a managed control panel, and Cloudflare AI Gateway at the edge.
The short answer first. Cloudflare for most people, LiteLLM if you already run a VPS, Portkey if observability is the actual problem you're solving.
Quick Verdict
| Tool | Best for | Price | Rating |
|---|---|---|---|
| Cloudflare AI Gateway | Most indie hackers, zero ops | Free core features | 9/10 |
| LiteLLM | Self-hosters, full control | Free (OSS) + your VPS | 8.5/10 |
| Portkey | Observability and debugging | Free tier, $49/mo production | 8/10 |
Cloudflare AI Gateway
Point your OpenAI-style base URL at Cloudflare, and you get caching, rate limiting, analytics, and automatic fallbacks running at their edge. The core features are free with any Cloudflare account. Not free-trial free. Actually free.
Limits show up in log retention. The free Workers plan stores 100,000 logs total, and the $5/month Workers Paid plan raises that to 10 million per gateway. Unified billing, where Cloudflare buys the tokens and you pay one bill, adds a 5% fee on credit purchases, with inference itself passing through at provider list price. Skip unified billing and there's no percentage anywhere.
Who should NOT use it? Anyone who needs their gateway to see inside prompts. Cloudflare counts and caches requests, but it won't version your prompts or trace a multi-step agent conversation.
LiteLLM
LiteLLM is the open source answer. A Python proxy that speaks the OpenAI format, routes across providers, retries failures, and tracks spend per key. It's free forever, self-hosted, and after the OpenRouter news that phrase carries new weight. Nobody can acquire the container running in your basement.
The honest math, though. LiteLLM itself costs nothing, but it needs a server, a database for its config, and someone who notices when it falls over at 2 AM. That someone is you. If a VPS is already in your stack, the marginal cost is close to zero and this is a great deal. If you'd be renting a server just to run a gateway, you've traded a free managed service for an ops chore.
Who should NOT use it? Builders with no infrastructure habit. A gateway is in the critical path of every AI request you serve. Self-host it only if you'd be comfortable self-hosting your database.
Portkey
Portkey sells the layer the other two skip. Every request gets logged, traced, and inspectable, with prompt versioning and guardrails on top of the usual routing and fallbacks. The Developer tier is free and records 10,000 requests a month, which genuinely covers a prototype. Production costs $49/month for 100,000 logs, then $9 per additional 100,000. There's an open source gateway too, if you want the routing without the console.
One ownership note. Portkey belongs to Palo Alto Networks since May 2026, and its pricing above is current under the new owner. Enterprise parents tend to steer products upmarket over time, so treat the indie-friendly tiers as worth enjoying now rather than guaranteed forever.
That $49 buys answers, not tokens. When your agent burned through $40 overnight and you need to know which loop did it, this is the tool that shows you. We've written about exactly that failure in runaway agent bills.
Who should NOT use it? Anyone whose monthly AI spend is smaller than $49. Paying more for the dashboard than for the tokens is backwards.
What Does the Self-Host Math Actually Say?
Enterprise comparisons of these tools argue about SOC 2 and VPC deployment. At indie scale the question is simpler. What does each path cost per month for, say, a side project doing 200,000 requests?
Cloudflare: $0, or $5 if you want long log retention. LiteLLM: $0 software plus a $5 to $10 VPS you may already have, plus your evenings when it misbehaves. Portkey: $49 plus $9 in log overage. Three real numbers, three different products. The spread isn't about generosity, it's about what you're buying. Zero-ops routing, sovereignty, or visibility.
The Bottom Line
Start with Cloudflare AI Gateway. It's free, it's managed, and it solves routing, caching, and failover, which is everything most indie projects need from a gateway. Move to LiteLLM when data locality or acquisition-proofing starts to matter and you already have the ops muscle. Add Portkey when your product leans on agents and you're spending real money you can't explain, because at that point the $49 pays for itself in one debugging session.
And if you're deciding between leaving a hosted router entirely, our Vercel AI Gateway alternatives and OpenRouter alternatives posts cover those exits. Model prices themselves are identical through every gateway here, and our AI models pages track them daily.
Running one of these in production? Tell me what broke on X @devtoolpicks.
Top comments (0)