Unless you live under a rock, vibe coding has been the talk of the town in software development for a while now since AI coding tools became a thing.
And one of the most popular and capable AI coding tool developers can use today is Claude Code by Anthropic.
Claude Code can read your repository, run commands, modify files, and help implement features directly from the terminal using only Anthropic’s own AI models.
But what if you want to use Claude Code with different LLM providers instead of being tied to a single one?
Maybe you want to:
Switch between Anthropic, OpenAI, or Gemini
Use a cheaper model for simple tasks
Fall back to another provider during outages
Route requests for performance or cost optimization
This is where an LLM gateway becomes incredibly useful.
In this guide, you will learn how to connect Claude Code to any LLM using the Bifrost LLM gateway.
Before we jump in, here is what we will cover:
Why Bifrost LLM gateway?
Setting up and configuring LLM providers with Bifrost LLM gateway
Integrating Claude Code with Bifrost LLM gateway
Running Claude Code with any AI model.
Enabling built-in observability and monitoring
Integrating MCP tools
Let’s dive in.
Why Bifrost LLM gateway?
Bifrost is an open-source LLM gateway built by Maxim AI to route, manage, and optimize requests between your AI application and multiple large language model providers.
The LLM gateway is built using Go (Golang) for performance and below is what makes it stand out:
Blazing fast overhead: At 5,000 requests per second, Bifrost adds less than 15 microseconds of internal overhead per request which is very important at production scale.
Zero-config startup: You can launch Bifrost with a single
npxcommand and configure everything through a web UI.Built-in fallbacks and load balancing: If a provider fails or rate-limits you, Bifrost automatically routes to a backup. Traffic can be distributed across multiple keys or providers using weighted rules.
Semantic caching: Repeated or similar queries can be served from cache, which helps in cutting costs and reducing latency.
**Observability: **Bifrost offers Prometheus metrics, request tracing, and a built-in web dashboard out of the box.
Bifrost supports 15+ providers including OpenAI, Anthropic, Google Gemini (via Vertex or GenAI), AWS Bedrock, Azure, Mistral, Cohere, Groq, and more.
You can learn more about Bifrost LLM gateway
Prerequisites
Before we start, make sure you have the following:
Node.js 18+ (for running Bifrost via npx) or Docker (for containerized deployment)
API keys for the providers you want to use:
- OpenAI:
- Google (Gemini):
Finally, navigate to the gateway dashboard at
Integrating Claude Code with Bifrost LLM gateway
In this section, you will learn how to integrate Claude Code with Bifrost LLM gateway in order to use it with any AI model.
Let’s get started.
Step 1: Install Claude Code
To install Claude Code, run the command below in the command line:
CODEnpm install -g @anthropic-ai/claude-code
Step 2: Point Claude Code at Bifrost
Once you have installed Claude Code, point it at Bifrost LLM gateway by setting the environment variables below in the terminal where
ANTHROPIC_BASE_URLtells Claude Code to send its API requests to Bifrost instead of Anthropic's servers:
CODEexport ANTHROPIC_BASE_URL="http://localhost:8080/anthropic"
export ANTHROPIC_API_KEY="dummy-key"
Step 3: Run Claude Code with Any Model
After pointing Claude Code at Bifrost, start and run Claude Code with with any model such OpenAI GPT 5.2-codex model using the command below.
CODEclaude --model openai/gpt-5.2-codex
Then you should see Claude Code running, as shown below:
Integrating MCP tools
In this section, you will learn how to integrate MCP tools with Bifrost to allow Claude Code to connect directly and access the tools.
Let’s get started!
Step 1: Connect Bifrost to MCP server
To connect Bifrost to MCP server for let’s say filesystem, update the config.json file with the code below:
CODE{
"$schema": "https://www.getbifrost.ai/schema",
"client": {
"enable_logging": true,
"disable_content_logging": true,
"drop_excess_requests": false,
"initial_pool_size": 300,
"allow_direct_keys": false
},
// ...
"mcp": {
"client_configs": [
{
"name": "filesystem",
"connection_type": "stdio",
"stdio_config": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
},
"tools_to_execute": ["*"],
"tools_to_auto_execute": [
"read_file",
"list_directory",
"create_file",
"delete_file"
]
}
],
"tool_manager_config": {
"max_agent_depth": 10,
"tool_execution_timeout": 300000000000,
"code_mode_binding_level": "server"
}
}
}
Then restart Bifrost server and navigate to the MCP catalog page in the web UI. You should see the filesystem MCP server connected, as shown below:
Built-in observability and monitoring
Bifrost provides built-in observability and monitoring by logging all traffic passing through the gateway.
The web interface at
You can also monitor LLM logs with requests, latency, tokens and cost, a shown below:
📦 GitHub:
↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.- OpenAI:
SOCIAL SHARE CARD GENERATOR