Cheapest way to run Claude Code in 2026: 6 free-first LLM gateways compared by real numbers
Claude Code is the most expensive habit most developers picked up this year. Not because any single model is costly — a million input tokens of Claude Sonnet 5.5 is $2, and a heavy day of agentic coding rarely crosses 50 million input tokens — but because the default setup sends every request to the most expensive route available: your Anthropic API key, billed at list price, with no free capacity in front of it.
There is a cheaper shape for the same setup. A gateway that tries free capacity first and falls back to paid routes automatically turns the same Claude Code session into a mostly-free one. I run one of those gateways, so I measured all of them. Here are the numbers.
What "free LLM API gateway" actually means
A free LLM API gateway is a single endpoint that accepts your API calls, routes each one to a model provider, and prefers provider capacity you do not pay for — promotional quotas, free-tier models, off-peak capacity — before touching anything billed. Three properties separate it from a plain proxy:
- It supplies the model access. You bring one key (the gateway's), not ten provider accounts.
- Free-first is the default, not an option. Every request tries free routes first; you do not tag individual calls.
- Failure is a log line, not your problem. When a free route dies, the gateway retries or fails over to paid capacity and returns one response.
If any of the three is missing, what you have is either a dashboard over your own keys or a free trial with a countdown. Both are fine products. Neither is a free gateway.
The 7 numbers that matter more than the model count
Gateway marketing leads with model counts. They are the least comparable number in the industry — counts mix text models, image models, routing aliases and retired entries in one bucket. These seven numbers decide your actual bill:
- Card required to start: does signup demand a credit card before the first call? (FreeModel: no. OpenRouter: no.)
- Free allowance, in requests or tokens per day: OpenRouter gives 50 requests/day on the free tier, rising to 1,000/day after $10 of lifetime credit purchases.
- Credit-purchase fee: OpenRouter takes 5.5% on every credit purchase, $0.80 minimum. On a $20 top-up that is $1.10 gone before a single token is spent.
- Fallback behavior: what happens when free capacity runs out — hard stop, or automatic paid fallback? This is the difference between a 3 a.m. outage and a slightly larger bill.
- Per-token price vs. official: Claude Sonnet 5.5 lists at $2/$10 per million tokens on Anthropic's own pricing page. Any gateway charging more than that per token is adding margin you should be able to name.
- Endpoint compatibility: Claude Code speaks the Anthropic Messages format. A gateway that only offers an OpenAI-compatible endpoint forces you through a translation layer.
- Who operates the request path: hosted (someone else's uptime) or self-hosted (your servers, your database, your patching).
Six gateways, side by side
| Gateway | Card to start | Free allowance | Supplies model access | Claude Code direct | Headline cost |
|---|---|---|---|---|---|
| FreeModel | No | Free capacity tried first, paid fallback behind it | Yes | Yes — Anthropic-compatible endpoint on the same base URL | Free-first routing |
| OpenRouter | No | 50 req/day; 1,000/day after $10 lifetime credit | Yes | Yes | 5.5% fee on credit purchases ($0.80 min) |
| Vercel AI Gateway | Varies | Small monthly free credit (amount unpublished) | Optional (BYOK or theirs) | Yes | No markup on tokens |
| Cloudflare AI Gateway | No | Core features free (analytics, caching, retries) | No — BYOK | Via your own keys | Free core; 5% only if Cloudflare buys tokens |
| Portkey | No | 10,000 req/month | No — BYOK only | Via your own keys | Free to 10K req/mo, then $49/mo |
| LiteLLM | N/A | The software is free (MIT) | No — you supply everything | Yes, self-hosted | Your infra + provider bills |
Two rows deserve a closer look, because they are the two serious answers to "cheapest way to use Claude Code."
FreeModel: free-first routing, in plain numbers
FreeModel is the gateway this article is published on, so read the numbers and check them — every claim below is verifiable from a public endpoint or the vendor's own page.
- 200+ models across three tiers, behind one base URL:
https://freemodel.online/v1. - Two wire formats, one address. The same endpoint accepts OpenAI-format and Anthropic-format requests, so Claude Code points at it with a base-URL change and no translation proxy.
- Free capacity is tried first on every request. Paid routes are the fallback, not a separate product. Models currently listed as Free on the pricing page include GLM-4.7-Flash, GLM-4.5-Flash, Hunyuan-lite, Nex-N2-Pro, and yi-large / yi-medium / yi-lightning.
- Priced models match vendor list prices. Claude Sonnet 5.5 is $2/$10 per million tokens and GPT-5.5 is $5/$30 — identical to Anthropic's and OpenAI's published rates (both verified against the vendors' pricing pages on 2026-10-19).
- The model list is public.
curl -s https://freemodel.online/v1/models | grep -o '"id"' | wc -lanswers without a key, which means any number quoted about coverage can be checked in ten seconds.
The honest limits: it is hosted only, so traffic that must stay inside your network is a non-starter, and there are no compliance certifications, per-team budgets, or audit logs. If you need those, you are in Portkey territory and the price reflects it.
OpenRouter after the Stripe acquisition: the fee math
OpenRouter remains the largest catalogue — 460 models on its public list — and the default that third-party tools and old tutorials assume. Two things changed the math in 2026.
First, the fee. The 5.5% charge applies to credit purchases, with a $0.80 minimum, and it is documented in OpenRouter's own FAQ. Run Claude Code at roughly $30/month of token spend and the fee adds about $1.65. Small, but it is a tax on the exact behavior — topping up — that heavy Claude Code use requires, and it compounds with the free tier's real shape: 50 requests/day is roughly one serious agentic session, so most developers land on paid credits within the first week.
Second, the acquisition. Stripe agreed to acquire OpenRouter in August 2026, with press figures between $7 billion and $8 billion. Nobody outside the two companies knows what that does to pricing, the free tier, or the :free suffix routing. That is not an accusation — it is an unpriced risk sitting in the middle of your request path.
The fair summary: if catalogue breadth is the deciding factor, OpenRouter still wins and nothing here is close. If your actual question is "cheapest way to run Claude Code," the catalogue is not the deciding factor — the fee, the free-tier shape, and the acquisition overhang are.
Pointing Claude Code at a gateway: 4 steps
This is the whole migration. It is a configuration change, not a code change:
- Get a key. Sign up on the gateway (no card required on FreeModel or OpenRouter) and copy the API key.
- Set the base URL. Point Claude Code at the gateway's endpoint —
https://freemodel.online/v1for FreeModel — keeping the Anthropic message format. No translation layer is needed where the gateway speaks both formats. - Run one real session. Not a hello-world: take a task you actually did last week and run it. Compare the answers and the latency against your current setup before you touch billing.
- Check the first bill line. Confirm that free routes were actually preferred — the gateway's usage view should show which requests hit free capacity and which fell back to paid. If it cannot show you that split, you cannot verify the "free-first" claim, and you should treat it as marketing.
A real week of Claude Code: what it costs on each route
Assume a working week of agentic coding: 200 million input tokens and 40 million output tokens, all on Claude Sonnet 5.5-class models.
- Direct Anthropic key: 200 × $2 + 40 × $10 = $800. No free capacity exists on this route.
- OpenRouter, paid credits: same token math, $800 in credits, plus the 5.5% purchase fee — roughly $844 to put the credits in the account. The 50 req/day free tier covers a fraction of one day.
- Free-first gateway (FreeModel): every request tries free capacity first. The paid fallback is billed at the same $2/$10 list price. Your actual spend is $800 minus whatever fraction free routes absorbed — the usage view shows the split, and that split is the only number that matters.
The takeaway is not that one gateway is magic. It is that the default route — direct key, list price, zero free capacity — is the most expensive possible configuration, and anything with free-first routing beats it by exactly the free fraction.
FAQ
Is a free LLM API gateway actually free?
For low-volume use, close to it: free capacity absorbs the traffic and you pay nothing. At Claude Code volumes you will exceed free capacity and pay list-price rates on the overflow — still cheaper than the direct-key default, because the free fraction is never zero.
Can Claude Code really point at a third-party gateway?
Yes, where the gateway offers an Anthropic-compatible endpoint. Claude Code sends the Anthropic Messages format; the gateway translates it to whatever the backing provider speaks. FreeModel exposes both formats on the same base URL, so the change is one setting.
What is the catch with free-first routing?
Free capacity is provider promotional quota, and it fluctuates. The gateway's job is to absorb that fluctuation — retry, fail over, keep your session alive. Evaluate a gateway on its failover behavior (how fast it switches, how many routes it tries), not on the size of its free tier on any given day.
Should I switch off OpenRouter?
Not necessarily. If you value the 460-model catalogue, the tutorial ecosystem that assumes OpenRouter, and you can name what the 5.5% fee costs you per month, staying is rational. Switch when the fee, the free-tier shape, or the post-acquisition uncertainty costs you more than remapping model ids — which is the one real migration cost, since model names differ between gateways.
Do I need provider accounts with a free gateway?
No — that is the structural difference. LiteLLM, Portkey, Vercel, and Cloudflare gateways route with keys you supply, so nothing works until you have accounts and payment methods at each provider. A gateway that supplies its own access removes that entire setup step.
Disclosure
I work on FreeModel, one of the six products compared above. Every third-party number in this article comes from the vendor's own documentation or a public endpoint, linked where it appears. FreeModel's prices were read from freemodel.online/pricing and vendor list prices were verified against the vendors' pricing pages on 2026-10-19. If a number here disagrees with the page it came from, the page is right — tell us and it gets corrected.
Word count: ~1,450