---
title: Running Non-Anthropic Models in Claude Code via an Enterprise AI Gateway
description: "TL;DR: Claude Code is a powerful agentic coding tool, but it's locked to Anthropic's models by default. Bifrost, an open-source AI gateway by Maxim AI, lets you route Claude Code requests through any LLM provider, including OpenAI, Google Gemini, Mistral, and more.\n\n\nThe Claude Code Lock-"
image: https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/07/running-non-anthropic-models-in-claude-code-via-an-enterpris-bifrost-paper-waves.optimized.png
---

Try Bifrost Enterprise free for 14 days. [Request access](https://www.getmaxim.ai/#enterprise-trial)

*****TL;DR:***** **Claude Code is a powerful agentic coding tool, but it's locked to Anthropic's models by default.** [**Bifrost**](https://www.getmaxim.ai)**, an** [**open-source**](https://www.github.com/maximhq/bifrost) **AI gateway by Maxim AI, lets you route Claude Code requests through any LLM provider, including OpenAI, Google Gemini, Mistral, and more.**

## The Claude Code Lock-In Problem

[Claude Code](https://www.anthropic.com/claude-code) has quickly become one of the most capable agentic coding tools available. It brings Claude's reasoning abilities directly into the terminal, letting developers delegate complex coding tasks, debug issues, and architect solutions from the command line. However, Claude Code only works with Anthropic's models out of the box.

For engineering teams operating in production environments, this creates real friction. You might need to route requests through GPT-4o for specific tasks where it excels, use Gemini for cost-effective bulk operations, or fall back to a different provider when Anthropic's API hits rate limits. Some organizations have compliance requirements that mandate specific cloud providers like AWS Bedrock or Google Vertex AI. Others simply want the flexibility to use and compare different models against each other without switching tools.

The underlying reason is straightforward: [Anthropic's API format](https://docs.anthropic.com/en/api/messages) differs significantly from the OpenAI-compatible standard that most providers have adopted. Claude Code speaks Anthropic's protocol natively and doesn't offer a built-in way to swap providers.

## How Bifrost Solves This

[Bifrost](https://github.com/maximhq/bifrost) is an open-source, high-performance AI gateway built in Go by [Maxim AI](https://www.getmaxim.ai/). It sits between your application (in this case, Claude Code) and any LLM provider, translating requests across API formats transparently.

The integration works at the transport layer. Claude Code sends Anthropic-formatted requests to what it thinks is Anthropic's API. Bifrost intercepts those requests, converts them to the target provider's format, forwards them, and translates the responses back into Anthropic's format before returning them to Claude Code. The client never knows the difference.

This means you can point Claude Code at GPT-4o, Gemini, Mistral, or any of the [1000+ models Bifrost supports](https://docs.getbifrost.ai/quickstart/gateway/provider-configuration), all without modifying the Claude Code binary or writing custom proxy scripts.

## Setup in Under a Minute

Getting started requires just two environment variables:

```bash
export ANTHROPIC_BASE_URL="<http://localhost:8080/anthropic>"
export ANTHROPIC_API_KEY="dummy-key"
```

`**ANTHROPIC_BASE_URL**` redirects Claude Code's API calls to Bifrost's local endpoint. The `/anthropic` path routes requests to Bifrost's Anthropic-compatible handler.

**`ANTHROPIC_API_KEY`** is set to a placeholder value because Bifrost handles the actual provider authentication on the backend. If you're using an [Anthropic MAX account](https://www.anthropic.com/pricing), Bifrost integrates with session-based auth out of the box, so this variable may not even be needed.

To get Bifrost running:

```bash
npx -y @maximhq/bifrost
```

That's it. Bifrost starts with a [web UI](https://docs.getbifrost.ai/quickstart/gateway/setting-up) at `localhost:8080` where you can configure providers, add API keys, and set routing rules visually. No YAML files, no Docker compose configurations for basic usage.

## What You Unlock Beyond Model Switching

Routing Claude Code through Bifrost isn't just about swapping models. It opens up several enterprise-grade capabilities that matter in production.

**Automatic Failover.** If your primary provider goes down or starts returning errors, Bifrost [automatically reroutes traffic](https://docs.getbifrost.ai/features/fallbacks) to a configured fallback. No manual intervention, no 3 AM pages.

**Observability.** Every request flowing through Bifrost gets logged with token usage, latency, and full request/response inspection. The built-in [observability dashboard](https://docs.getbifrost.ai/features/observability/default) gives you real-time visibility into how Claude Code is consuming API resources, which is critical for teams managing budgets across multiple developers.

**MCP Tool Injection.** [Model Context Protocol tools](https://docs.getbifrost.ai/mcp/overview) configured in Bifrost automatically become available to Claude Code. Bifrost injects [MCP tools](https://www.getmaxim.ai/topics/mcp-tools) into the request's `tools` array before forwarding it to the model provider. This means Claude Code can use filesystem tools, web search, database queries, or any custom [MCP server](https://www.getmaxim.ai/topics/mcp-server) without any client-side configuration.

**Governance and Cost Control.** Bifrost supports [virtual keys with independent budgets](https://docs.getbifrost.ai/features/governance), rate limiting, and access control. For teams with multiple developers using Claude Code, this prevents runaway costs and enforces usage policies at the gateway level.

**Semantic Caching.** Repeated or similar queries get served from [Bifrost's semantic cache](https://docs.getbifrost.ai/features/semantic-caching), reducing both latency and cost without any changes to how developers interact with Claude Code.

## Why an AI Gateway Matters for Coding Agents

As AI coding tools become central to development workflows, the infrastructure layer beneath them becomes a critical dependency. Running Claude Code directly against a single provider's API works for individual developers experimenting locally. It doesn't work for engineering organizations that need reliability, cost visibility, and the flexibility to evolve their model strategy over time.

An [AI gateway](https://www.getmaxim.ai/articles/top-5-llm-gateways-in-2026-a-production-ready-comparison/) like Bifrost decouples the tool from the provider. Your developers get to keep using Claude Code's excellent agentic interface. Your infrastructure team gets centralized control over which models are used, how much they cost, and what happens when things break.

Bifrost adds just [11 microseconds of overhead](https://www.getmaxim.ai#performance) at 5,000 requests per second, so the gateway layer doesn't become a bottleneck even for the most demanding workloads.

## Getting Started

1. Install Bifrost: `npx -y @maximhq/bifrost`
2. Configure your preferred providers through the web UI
3. Set the two environment variables
4. Run `claude` as usual

For teams already invested in Claude Code, Bifrost offers the path of least resistance to multi-model flexibility. For those evaluating AI coding tools, it removes the single-provider constraint entirely.

Explore the full [Bifrost documentation](https://docs.getbifrost.ai/), check out the [GitHub repository](https://github.com/maximhq/bifrost), or [book a demo](https://www.getmaxim.ai/book-a-demo) to see how Bifrost fits into your AI infrastructure stack.

## Read next

[![Tokenmaxxing: What It Means and How to Govern AI Token Spend](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/tokenmaxxing-what-it-means-and-how-to-govern-ai-token-spend-bifrost-1920x1080.png) Tokenmaxxing is the practice of treating AI token consumption as a proxy for productivity. This guide explains where the term came from, why usage leaderboards backfired, what engineering leaders measure instead, and how to govern token spend with budgets, attribution, and routing.](https://www.getmaxim.ai/articles/tokenmaxxing/)

[![9 Best Self-Hosted AI Tools for Enterprise Teams](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/9-best-self-hosted-ai-tools-for-enterprise-teams-bifrost-1920x1080@2x.png) Self-hosted AI runs models, apps, and data services on infrastructure a team controls. This guide ranks nine tools by stack layer, including Bifrost, vLLM, Ollama, Open WebUI, and Qdrant, and shows how one gateway governs the whole stack.](https://www.getmaxim.ai/articles/self-hosted-ai-tools/)

[![7 Best Private AI Platforms for Regulated Enterprises](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/11/7-best-private-ai-platforms-for-regulated-enterprises-bifrost-1920x1080@2x.png) A private AI platform runs models and AI traffic inside infrastructure the organization controls. This guide ranks seven options, including Bifrost, NVIDIA AI Enterprise, Red Hat OpenShift AI, and Google Distributed Cloud air-gapped, on deployment, isolation, and governance.](https://www.getmaxim.ai/articles/private-ai-platforms/)

## More in AI Gateway

[![Top 5 Enterprise AI Gateways to Ensure AI Governance in Your AI Apps](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/07/top-5-enterprise-ai-gateways-to-ensure-ai-governance-in-your-bifrost-circuit.optimized.png) As enterprises scale LLM deployments across customer support, code assistants, and autonomous agents, the gap between "AI that works in a demo" and "AI that works at enterprise scale" becomes a serious operational risk. Uncontrolled model access, unpredictable costs, compliance blind spots, and zero visibility into](https://www.getmaxim.ai/articles/top-5-enterprise-ai-gateways-to-ensure-ai-governance-in-your-ai-apps/)

[![Tracking LLM Token Usage Across Providers, Teams, and Workloads](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/07/tracking-llm-token-usage-across-providers-teams-and-workload-bifrost-paper-waves.optimized.png) This guide outlines a practical framework for making LLM token usage traceable and governable, and explains how Bifrost solves this at the infrastructure layer so platform teams can understand where tokens go, who consumes them, and how to control it. Every interaction with a large language model costs money. Tokens](https://www.getmaxim.ai/articles/tracking-llm-token-usage-across-providers-teams-and-workloads/)

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "Maxim Articles",
        "url": "https://www.getmaxim.ai/articles/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w256h256/2025/08/thumbnail.png",
            "width": 60,
            "height": 60
        }
    },
    "author": {
        "@type": "Person",
        "name": "Kamya Shah",
        "image": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2025/09/WhatsApp-Image-2025-08-29-at-17.40.40-1.jpeg",
            "width": 1200,
            "height": 1600
        },
        "url": "https://www.getmaxim.ai/articles/author/kamya/",
        "sameAs": []
    },
    "headline": "Running Non-Anthropic Models in Claude Code via an Enterprise AI Gateway",
    "url": "https://www.getmaxim.ai/articles/running-non-anthropic-models-in-claude-code-via-an-enterprise-ai-gateway/",
    "datePublished": "2026-02-26T05:08:00.000Z",
    "dateModified": "2026-11-21T00:38:19.000Z",
    "image": {
        "@type": "ImageObject",
        "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/07/running-non-anthropic-models-in-claude-code-via-an-enterpris-bifrost-paper-waves.optimized.png",
        "width": 1200,
        "height": 630
    },
    "keywords": "AI Gateway",
    "description": "TL;DR: Claude Code is a powerful agentic coding tool, but it's locked to Anthropic's models by default. Bifrost, an open-source AI gateway by Maxim AI, lets you route Claude Code requests through any LLM provider, including OpenAI, Google Gemini, Mistral, and more.\n\n\nThe Claude Code Lock-In Problem\n\nClaude Code has quickly become one of the most capable agentic coding tools available. It brings Claude's reasoning abilities directly into the terminal, letting developers delegate complex coding ta",
    "mainEntityOfPage": "https://www.getmaxim.ai/articles/running-non-anthropic-models-in-claude-code-via-an-enterprise-ai-gateway/"
}
```
