7 min read

LiteLLM vs Portkey vs Cloudflare AI Gateway for Indie Hackers in 2026

Three AI gateways compared at indie scale: self-hosted LiteLLM, Portkey with observability, and Cloudflare running free at the edge.

LiteLLM vs Portkey vs Cloudflare AI Gateway for Indie Hackers in 2026

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.

flowchart TD
    A[Which gateway?] --> B{Already run a VPS you trust?}
    B -- yes --> C{Want traffic in your own network?}
    C -- yes --> D[LiteLLM]
    C -- no --> E{Biggest pain today?}
    B -- no --> E
    E -- cost and outages --> F[Cloudflare AI Gateway]
    E -- debugging agent behavior --> G[Portkey]

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.

Frequently Asked Questions

Is LiteLLM really free?

The software is. LiteLLM is open source and free to self-host forever, with routing, fallbacks, retries, and spend tracking included. What you pay for is the server it runs on, roughly the cost of a small VPS, and your own time operating it. The paid enterprise tier adds SSO and audit logs, which solo builders can skip.

Does Cloudflare AI Gateway add a markup on tokens?

No. Requests pass through to your provider at the provider's own price, and the gateway's core features, caching, rate limiting, analytics, and fallbacks, are free. The only percentage fee appears if you use unified billing, where Cloudflare buys tokens for you and charges 5% on credit purchases.

What is the difference between Portkey and LiteLLM?

Portkey is a managed platform where the gateway comes wrapped in observability, prompt versioning, and guardrails, free for 10,000 logged requests a month and $49/month in production. LiteLLM is an open source proxy you run and operate yourself, free at any volume. Portkey also publishes an open source gateway, but its hosted console is the reason people choose it.

Do I still need an AI gateway if I only use one model?

Usually not. A single model from a single provider is better called directly, with one less dependency in the request path. The gateway starts paying for itself when you route across models, want automatic failover during provider outages, or need one dashboard showing what every feature spends per day.

Which AI gateway is best after the Stripe OpenRouter acquisition?

If acquisitions make you nervous about hosted routers, LiteLLM is the safest harbor because it runs on your infrastructure and no acquirer can change its terms. Cloudflare is the safest managed option, since routing is a strategic product for them rather than an acquisition target. Portkey was itself acquired by Palo Alto Networks in May 2026, so factor that in.

Found this useful? Follow @devtoolpicks on X for more honest tool comparisons.
Share: X/Twitter | LinkedIn |

Get honest tool comparisons in your inbox

Join 50+ indie hackers and solo developers who get new comparisons, pricing changes, and tool picks. No spam. Unsubscribe anytime.