Compare · Cloudflare AI Gateway and Selan
Is there a Cloudflare AI Gateway alternative for a team's Claude Code?
Yes, if the traffic is your team's coding tools rather than your own apps. Cloudflare AI Gateway is a proxy for AI requests that Cloudflare runs, and its core features are free. Claude Code reaches it with a gateway token, or with a Cloudflare Access sign-in on a custom domain. Selan is a hosted gateway that each developer signs in to once. If your apps already run on Cloudflare, AI Gateway is the better answer.
How do Cloudflare AI Gateway and Selan compare?
| Cloudflare AI Gateway | Selan | |
|---|---|---|
| What it is | A proxy for AI requests with logs, analytics, caching, rate limits, spend limits and data loss prevention | A hosted gateway, with a CLI that launches Claude Code, Codex and OpenCode through it |
| Where it runs | Cloudflare's service, set up in your Cloudflare account. Nothing to run | A hosted service, built and hosted in the EU. Nothing to run |
| Coding tools | Setup pages for Claude Code, Claude Desktop, OpenAI Codex, OpenCode, Cursor, Gemini CLI, GitHub Copilot CLI, VS Code, Xcode, Android Studio and Pi | Claude Code, Codex, OpenCode and Claude Desktop |
| Claude for Claude Code | An Anthropic API key, Cloudflare credits, or Amazon Bedrock or Google Vertex credentials stored in the gateway | The Claude and ChatGPT accounts and API keys your company connects |
| A developer's credential | A gateway token, or a short-lived Access token fetched by cloudflared | One sign-in with Google or Microsoft through selan login |
| Usage per person | With Access on a custom domain, or a user id you attach to each request | One usage record per person, across every tool |
| Limits | Spend limits by model, provider or metadata, up to 20 rules per gateway, and rate limits by request count | A spend limit per person, by day, week or month in UTC, on pay-per-use keys |
| Secrets | Data loss prevention scans prompts and answers, then flags or blocks a match | Secret scanning replaces a secret it recognises before the request leaves |
| Cost | Core features free; Cloudflare credits carry a 5% fee | Free for up to three seats, no card |
Cloudflare AI Gateway is a proxy for the AI traffic in a Cloudflare account. Selan is a gateway a team signs in to for its coding tools.
When is Cloudflare AI Gateway the better answer?
When your apps already run on Cloudflare. A Worker reaches the gateway through a binding, with no header to add. Dashboard analytics, caching and rate limiting are free on every plan.
It reaches Claude on Amazon Bedrock and Google Vertex with credentials stored in the gateway. Its Unified Billing puts OpenAI, Anthropic, Google and other providers on one Cloudflare bill, from prepaid credits, at the providers' own token prices.
It has setup pages for more coding tools than Selan covers, among them Cursor, Gemini CLI, GitHub Copilot CLI and Xcode. With a Zero Trust subscription that includes data loss prevention, the detection profiles you already use elsewhere in Cloudflare scan prompts too.
If no team runs coding tools through a gateway, you do not need Selan.
How does Cloudflare AI Gateway tell developers apart?
By a Cloudflare Access sign-in, or by metadata you attach yourself. A gateway token on its own names no person.
Cloudflare's docs say AI Gateway tokens are scoped to the account, not to one gateway. Any token with Run permission can send requests through every gateway in the account. It then uses the provider keys stored on those gateways.
With Access in front of a custom domain, Claude Code fetches a short-lived token through
cloudflared in its apiKeyHelper. The gateway then records the
person as cf.user_id. A spend limit rule split by cf.user_id
gives each person their own budget. Requests made with a service token carry no
cf.user_id.
Without Access, a per-person budget needs a user id that you add to every request as custom metadata.
What does Cloudflare AI Gateway cost?
Its core features are free on all plans. Accounts that created their first gateway on or after 24 September 2026 keep logs in Workers Logs, priced as that product is. Older accounts keep up to 100,000 logs on Workers Free and 10 million per gateway on Workers Paid.
Data loss prevention scanning is free. Without a Zero Trust subscription it has two predefined profiles: financial information, and social, insurance and national identifier numbers. Guardrails are billed as Workers AI inference.
Cloudflare credits cost 5% on top, so a $100 purchase is a $105 charge, by credit card only. Requests paid from credits are limited to 200 per 60 seconds per gateway. Requests on your own provider keys are not.
When is Selan the better answer?
When the traffic is a team's coding tools and nobody wants to hand out gateway tokens. A
developer runs selan login once, then selan claude,
selan codex or selan opencode. Claude Desktop goes through the
same gateway with one settings file.
Claude Code, Codex, OpenCode and Claude Desktop go into one usage record per person, with no identity proxy or metadata to set up. A limit per person applies across every pay-per-use key.
An owner connects the company's accounts and keys once, and switches on the models the team may use. No provider key reaches a laptop. With secret scanning on, a secret it recognises is replaced before the request leaves.
The trade-off is that requests travel through Selan, so if Selan is unavailable those requests fail. Your accounts can still be used directly.
Which providers serve which models is in models and providers, limits per person are on the spend page, and scanning is in the secret scanning docs.
How do you move Claude Code from Cloudflare AI Gateway to Selan?
Cloudflare's setup adds three variables: ANTHROPIC_BASE_URL,
ANTHROPIC_API_KEY and ANTHROPIC_CUSTOM_HEADERS. Remove them from
your shell profile or from the env block of ~/.claude/settings.json.
With Access, delete the cloudflared apiKeyHelper line too. On the
Bedrock or Vertex route, also remove CLAUDE_CODE_USE_BEDROCK or
CLAUDE_CODE_USE_VERTEX with their base URL and skip-auth variables.
Then run selan login and selan claude. Connect the same Anthropic
or Vertex accounts in Selan and switch on their models. You can keep AI Gateway for your
own apps and run the team's coding tools through Selan. Keeping provider keys off laptops
is covered in Claude Code without API keys on laptops,
and the kinds of gateway in Claude Code gateways.
Free for up to three seats, and the Free plan needs no card.
The short version
- Cloudflare AI Gateway is a proxy for AI requests that Cloudflare runs, and its core features are free.
- Claude Code reaches it with a gateway token scoped to the whole account, or with an Access sign-in on a custom domain.
- It reaches Claude on Anthropic, Bedrock and Vertex, and has setup pages for more coding tools than Selan.
- Selan is hosted in the EU: one sign-in per person, no provider key on the laptop, and a spend limit per person.
What Cloudflare AI Gateway does is as its documentation (the Claude Code, Claude Desktop, coding agents, authenticated gateway, spend limits, Unified Billing, data loss prevention, pricing and limits pages) described it, read on 4 November 2026. It changes: check the date before relying on it. What Selan does is as its CLI and docs stated it on that date.