5 AI Gateways Developers Use to Run Claude Code with Non-Anthropic Models
Running Claude Code with non-Anthropic models requires a gateway that exposes an Anthropic-compatible endpoint and translates requests. This comparison covers Bifrost, LiteLLM, OpenRouter, Cloudflare AI Gateway, and AWS Bedrock, and which fits each team.
TL;DR
- Claude Code defaults to Anthropic models, and teams route it to other providers for cost control, regional compliance, or fallback coverage.
- This comparison covers five gateway options developers use for that setup: Bifrost, LiteLLM, OpenRouter, Cloudflare AI Gateway, and AWS Bedrock.
- Any non-Anthropic model used with Claude Code must support tool calling, because file edits, bash, and code changes run through tool calls.
- Anthropic does not support routing Claude Code to non-Claude models, so compatibility, fallbacks, and governance depend entirely on the gateway.
- For production teams that want self-hosted control, MCP support, and stronger governance, Bifrost is the strongest fit.
Claude Code ships with Anthropic's own models as the default backend, but many engineering teams want the option to run Claude Code with non-Anthropic models from other providers. The reasons are usually practical: tighter cost control, lower latency on routine calls, or compliance requirements that rule out a specific hosting region. An AI gateway solves this by sitting between Claude Code and any underlying model provider, acting as a unified layer that handles routing, failover, and observability. Bifrost, an open-source AI gateway, is the best choice for enterprises running mission-critical AI workloads that require best-in-class performance, scalability, and reliability.
This article walks through five AI gateways that developers currently use to run Claude Code against non-Anthropic models, with a breakdown of core features and the setup each one fits best. For the step-by-step configuration behind this comparison, see the guide to running non-Anthropic models in Claude Code via an enterprise AI gateway.
What an AI Gateway Does for Claude Code
An AI gateway is an infrastructure layer that intercepts API calls from an AI tool or agent and dispatches them to one or more LLM providers. In the Claude Code context, a gateway lets you redirect traffic away from Anthropic's hosted models toward alternatives on AWS Bedrock, Google Vertex, Azure OpenAI, or open-source providers, all without touching Claude Code's core behavior. Claude Code finds the gateway through the ANTHROPIC_BASE_URL environment variable, so the gateway must expose an Anthropic-compatible Messages endpoint and translate each request for the target provider.

Figure 1: Claude Code never learns which provider answered; the gateway owns translation, which is why its compatibility decides what works.
Teams typically reach for a gateway to run Claude Code with other providers when they need to:
- Send routine coding tasks to cheaper or faster models
- Use region-locked or compliance-approved model deployments
- Add fallback logic for when a primary provider returns errors or times out
- Unify usage tracking and cost reporting across several providers
Anthropic's LLM gateway documentation states that Anthropic does not endorse third-party gateways and does not support routing Claude Code to non-Claude models through any gateway. In practice, that means the gateway owns request translation, tool-call compatibility, and fallback behavior, which is where the options below differ most. The Claude Code gateway guide explains the architecture in more detail.
How We Tested These Gateways for Claude Code
Before the comparison, it helps to know how each gateway behaves once Claude Code is actually pointed at it. Our team ran Claude Code against each of the five options below using the standard ANTHROPIC_BASE_URL override pointed at each gateway's Anthropic-compatible endpoint (for AWS Bedrock, Claude Code's native Bedrock settings), routed to both Anthropic and non-Anthropic backends. Setup paths were not identical.
With the Bifrost gateway, the flow was: start the self-hosted gateway, register provider credentials, and set Claude Code's base URL environment variable to the gateway. Claude Code began routing through Bifrost without any change to how we invoked it. Fallback testing involved forcibly killing one provider connection mid-session; the gateway retried the failed request on the fallback provider, and Claude Code continued the session without a manual retry.
With managed services, the integration was faster to stand up but offered less control over failure handling and logging granularity. With LiteLLM, setup required a few more Python-side configuration passes to get budget tracking and provider weights aligned with what our team needed.
The comparisons below reflect this hands-on setup work, and every competitor capability listed was checked against that product's current documentation.
1. Bifrost

Platform Overview
Bifrost is a high-performance, open-source AI gateway written in Go and built by Maxim AI. It provides a single OpenAI-compatible API, plus an Anthropic-compatible endpoint for Claude Code, that routes to 25+ providers and 10,000+ models including AWS Bedrock, Google Vertex AI, Azure OpenAI, Mistral, Cohere, Groq, and Ollama. Bifrost is designed as a drop-in replacement for native provider SDKs, and its Claude SDK compatible endpoint makes it straightforward to integrate with Claude Code without any additional code changes.
Bifrost can be self-hosted with zero configuration overhead and is purpose-built for teams that want enterprise-grade infrastructure without vendor lock-in.
For Claude Code specifically, Bifrost is useful because teams can keep the local developer workflow unchanged while moving model routing into the gateway layer. That makes it easier to test Anthropic, Bedrock, Vertex, or other providers behind the same interface while keeping fallback and usage controls centralized. The Claude Code integration maps each Claude Code model tier to any provider with a provider/model value in settings.json:
| Claude Code setting | Example non-Anthropic value through Bifrost |
|---|---|
ANTHROPIC_DEFAULT_SONNET_MODEL |
vertex/gemini-3.1-pro |
ANTHROPIC_DEFAULT_HAIKU_MODEL |
openai/gpt-5.5 |
ANTHROPIC_DEFAULT_OPUS_MODEL |
Any tool-calling model configured in Bifrost |
/model mid-session |
/model openai/gpt-5.5 or /model vertex/gemini-3.1-pro |
Features
- Unified provider interface: One OpenAI-compatible API for all supported providers, including Anthropic, AWS Bedrock, and Google Vertex
- Automatic fallbacks: Automatic failover between providers and models
- Semantic caching: Reduces redundant LLM calls by caching responses based on semantic similarity, cutting both cost and latency
- MCP gateway support: Native support for the Model Context Protocol, allowing Claude Code to use external tools like web search, databases, and file systems across any connected provider. MCP Code Mode reduces input tokens by up to 92.8% in large multi-server MCP deployments.
- Budget management and governance: Hierarchical cost controls with virtual keys, team-level budgets, and usage tracking
- Custom plugins: Extensible native Go plugins for analytics, monitoring, and request transformation
- Observability: Native Prometheus metrics, distributed tracing, and structured logging by default
Best for: Bifrost is built for enterprises running mission-critical AI workloads that require best-in-class performance, scalability, and reliability. It serves as a centralized AI gateway to route, govern, and secure all AI traffic across models and environments with ultra low latency. Bifrost unifies LLM gateway, MCP gateway, and Agents gateway capabilities into a single platform. Designed for regulated industries and strict enterprise requirements, it supports air-gapped deployments, VPC isolation, and on-prem infrastructure. It provides full control over data, access, and execution, along with robust security, policy enforcement, and governance capabilities.
2. LiteLLM

Platform Overview
LiteLLM is an open-source proxy server and Python SDK that provides a unified interface to 100+ LLM providers. It is widely used for local development and self-hosted deployments. For Claude Code, Anthropic's cost documentation notes that several large enterprises reported using LiteLLM to track spend by key, while also noting that the project is unaffiliated with Anthropic and has not been audited for security.
Features
- OpenAI-compatible proxy with support for 100+ LLMs across OpenAI, Anthropic, Vertex AI, Bedrock, and more
- Load balancing and fallback routing across providers
- Virtual keys with per-key, per-team, and per-user budgets
- Centralized logging, guardrails, caching, and an MCP gateway
Best for: Python-first teams that want a self-hosted gateway inside the Python ecosystem and can own patching after the March 2026 PyPI supply-chain compromise of LiteLLM packages. Teams weighing a move can compare Bifrost as a LiteLLM alternative.
3. OpenRouter

Platform Overview
OpenRouter is a managed API aggregation service that provides a single API key for accessing hundreds of models from providers like Anthropic, OpenAI, Mistral, and Meta. Claude Code connects by setting ANTHROPIC_BASE_URL to OpenRouter's API, and OpenRouter's own Claude Code guide states that Claude Code is optimized for Anthropic models and may not work correctly with other providers.
Features
- Single OpenAI-compatible endpoint for hundreds of models across multiple providers
- Automatic fallbacks, with selection of a cost-effective option for each request
- Direct Claude Code connection with no local service to run
- Hosted only, so prompts and code transit OpenRouter's infrastructure
Some upstreams, OpenRouter among them at the time of writing, do not stream function-call arguments correctly, which breaks Claude Code file operations for affected models; the Claude Code provider compatibility notes list the workaround.
Best for: individual developers and prototypes that want the widest hosted model catalog with no infrastructure to operate.
4. Cloudflare AI Gateway

Platform Overview
Cloudflare AI Gateway is a managed gateway service built into Cloudflare's global network that adds observability and caching to LLM API calls. For Claude Code, Cloudflare exposes a provider-specific Anthropic endpoint in the form gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/anthropic, which adds logging, caching, and rate limiting to Claude traffic; Cloudflare's Anthropic provider documentation covers Anthropic models only.
Features
- Caching and rate limiting for LLM requests at the edge
- Request logs and analytics covering requests, tokens, and cost in the Cloudflare dashboard
- Request retries and model fallbacks
- Support for providers including Workers AI, Anthropic, Google Gemini, OpenAI, and Replicate
- No self-hosting required; routes through Cloudflare's network by default
Best for: teams already on Cloudflare that want visibility and caching for Claude traffic more than cross-provider model substitution inside Claude Code. Teams that need the same controls inside their own network can compare self-hosted AI gateway options.
5. AWS Bedrock

Platform Overview
AWS Bedrock is a fully managed service from Amazon Web Services that provides access to foundation models from Anthropic, Meta, Mistral, Cohere, and others through a unified AWS API. Claude Code's native Bedrock integration (CLAUDE_CODE_USE_BEDROCK=1) calls Claude models through the Bedrock Invoke API, so running Claude Code against a non-Anthropic model hosted on Bedrock requires a gateway in front that translates Anthropic-format requests; Bifrost does this with the bedrock/ model prefix, and the Bifrost AWS Bedrock resource covers the setup.
Features
- Access to Claude, Llama, Mistral, and other models through a single AWS service
- Native integration with AWS IAM for access control and VPC for private networking
- Bedrock Guardrails, which Claude Code can apply through custom request headers
- In scope for compliance standards including ISO, SOC, GDPR, and FedRAMP High, and HIPAA eligible
Best for: AWS-native enterprises that want Claude models inside their AWS account and billing, with a gateway added when non-Anthropic Bedrock models are in scope.
What matters when Claude Code is not tied to Anthropic
When teams move Claude Code onto non-Anthropic models, the problem is usually not model access alone. The harder part is keeping routing, fallback behavior, and cost controls predictable once multiple providers are in the mix.
Tool-calling fidelity matters as much as routing. Claude Code relies on tool calls for file edits, bash, and code changes, and Claude-specific server-side tools such as web search and computer use are only available on Claude-family models. A gateway that exposes one Anthropic-compatible endpoint lets a team swap to a known-good model in seconds when a provider's tool calls fail.

Figure 2: Keeping a known-good Claude model at the end of the fallback chain protects sessions from provider-specific tool-call failures.
For production use, the gateway needs to do more than proxy requests. It needs to keep Claude Code usable when a provider slows down, expose clear usage and latency signals, and make provider swaps possible without reworking the developer workflow around a new SDK.
That is why the strongest production setups usually favor gateways that combine OpenAI-compatible routing, fallback handling, governance controls, and observable request paths in one place instead of spreading those responsibilities across separate tools. The same reasoning applies to specific model families, covered in the guides to using Claude Code with OpenAI models and the best AI gateway to use Claude Code with Gemini models.
Choosing the Right Gateway for Claude Code
The right gateway for Claude Code depends primarily on where your team sits on the self-hosted versus managed spectrum, and how much governance and observability your production environment requires.

Figure 3: The first question is whether Claude Code must run non-Anthropic models at all; the second is whether traffic may leave your network.
| Gateway | Deployment | Non-Anthropic models in Claude Code | MCP Support | Best Fit |
|---|---|---|---|---|
| Bifrost | Self-hosted, open source | Yes, per-tier mapping to any configured provider | Yes | Enterprise, regulated teams |
| LiteLLM | Self-hosted, open source | Yes, through its proxy | Yes | Developer-led, Python-first teams |
| OpenRouter | Managed | Yes, with provider-dependent compatibility | Not published | Prototyping, lightweight production |
| Cloudflare AI Gateway | Managed | Anthropic endpoint covers Anthropic models | Not published | Cloudflare-native apps |
| AWS Bedrock | Managed (AWS) | Claude models natively; others need a gateway | Not published | AWS-native enterprise workloads |
For teams that want a production-grade, self-hosted gateway with native MCP support, automatic fallbacks, and enterprise cost controls, Bifrost covers the full stack without additional tooling layered on top. The Bifrost buyer's guide covers the decision criteria in more depth.
Frequently Asked Questions
Can Claude Code run on models other than Claude?
Yes, when routed through a gateway. Bifrost as the Claude Code gateway remaps Claude Code's model tiers to OpenAI, Gemini, Mistral, or open-weight models behind its Anthropic-compatible endpoint, so a team can run non-Anthropic models for coding while keeping the Claude Code interface unchanged. The chosen model must support tool calling.
Why route Claude Code to non-Anthropic models?
Three practical reasons: cost control by sending routine coding tasks to cheaper models, lower latency on simple calls, and fallback coverage so an Anthropic outage or rate limit does not stop work. A gateway makes all three a configuration decision rather than an application rewrite.
Does running Claude Code through a gateway change the workflow?
No. Claude Code behaves identically; only the base URL it points at changes. Tool calling, file operations, and the model-switching command all work as before on tool-capable models, while the gateway adds routing, failover, and governance underneath. Claude-specific server tools such as web search may be unavailable on non-Claude models. The Claude Code integration needs no client-side code changes.
What is the difference between a self-hosted and a managed gateway for Claude Code?
Self-hosted gateways keep prompts and code inside your own infrastructure and give full control, at the cost of operating the service. Managed services start faster but route requests through the vendor's network. For teams whose Claude Code prompts contain proprietary source, self-hosting is usually the deciding factor.
Does Anthropic support using Claude Code with non-Anthropic models?
No. Anthropic's documentation says it does not support routing Claude Code to non-Claude models through any gateway and does not endorse third-party gateway products. Teams that run Claude Code with other models rely on the gateway for request translation and compatibility, which is why a gateway with documented Claude Code support and a quick fallback to Claude matters.
How do you keep Claude Code reliable across providers?
Configure automatic failover, including fallback routing between OpenAI and Anthropic models, so a degraded provider is bypassed without a manual retry, and add virtual key governance to cap spend per developer. The strongest production setups pair multi-provider routing with failover and per-key budgets so reliability and cost are controlled at the same layer.
Conclusion
Running Claude Code with non-Anthropic models is a practical need for engineering teams optimizing for cost, compliance, or provider flexibility. Each gateway covered here addresses a different part of that problem, from OpenRouter's simplicity to the enterprise infrastructure depth of Bifrost. The enterprise gateway guide to Claude Code with non-Anthropic models covers rollout at organization scale.
If your team wants Claude Code to route across multiple providers without losing control over fallback, governance, or observability, book a demo with the Bifrost team.