WorkflowsApr 8, 2026·3 min read

Bifrost CLI — Run Claude Code with Any AI Model

Enterprise AI gateway that lets Claude Code use any LLM provider. Bifrost routes requests to OpenAI, Gemini, Bedrock, Groq, and 20+ providers with automatic failover.

Agent ready

Safe staging for this asset

This asset is staged first. The copied prompt tells the agent to inspect the staged files and ask before activating scripts, MCP config, or global config.

Stage only · 17/100Policy: stage
Agent surface
Any MCP/CLI agent
Kind
CLI Tool
Install
Stage only
Trust
Trust: Established
Entrypoint
Bifrost CLI — Run Claude Code with Any AI Model
Safe staging command
npx -y tokrepo@latest install 7ce62a2f-42dd-477a-b23f-3d275f01aa6c --target codex

Stages files first; activation requires review of the staged README and plan.

TL;DR
Bifrost provides a unified API gateway that routes Claude Code requests to OpenAI, Gemini, Bedrock, Groq, and 20+ providers.
§01

What it is

Bifrost CLI is an enterprise AI gateway that provides a unified OpenAI-compatible API across 20+ AI providers and 1,000+ models. The CLI component lets developers run Claude Code, Codex CLI, Gemini CLI, and other coding agents with any model from any provider through a single endpoint.

Bifrost is designed for teams that want provider flexibility without rewriting integration code. It handles routing, failover, and load balancing across providers while exposing a standard API that coding agents already understand.

§02

How it saves time or tokens

Without Bifrost, switching between AI providers requires changing API endpoints, authentication, and request formats in your tooling configuration. Bifrost normalizes all providers behind one endpoint, so you switch models by changing a single parameter. Automatic failover means if one provider is down, requests route to the next available provider without manual intervention. This reduces both downtime and the operational overhead of managing multiple AI integrations.

§03

How to use

  1. Install Bifrost: npx -y @maximhq/bifrost.
  2. Connect to Claude Code: claude mcp add --transport http bifrost http://localhost:8080/mcp.
  3. Configure providers in the Bifrost settings (API keys, model preferences, failover rules).
  4. Use Claude Code as normal -- Bifrost routes requests to your chosen provider.
§04

Example

# Install and start Bifrost
npx -y @maximhq/bifrost

# Or run via Docker
docker run -p 8080:8080 maximhq/bifrost

# Connect Claude Code to Bifrost
claude mcp add --transport http bifrost http://localhost:8080/mcp

# Now Claude Code requests route through Bifrost
# to any configured provider (OpenAI, Gemini, Groq, etc.)
§05

Related on TokRepo

§06

Common pitfalls

  • Not all models support the same features. Switching from Claude to a smaller model may lose tool-use or long-context capabilities. Verify model capabilities before routing production traffic.
  • Bifrost adds a network hop between your agent and the provider. For latency-sensitive applications, measure the overhead.
  • API key management across 20+ providers requires careful secrets handling. Use environment variables or a secrets manager rather than hardcoding keys in configuration.

Frequently Asked Questions

What providers does Bifrost support?+

Bifrost supports 20+ providers including OpenAI, Google Gemini, AWS Bedrock, Groq, Anthropic, Azure OpenAI, Together AI, Fireworks, and more. New providers are added regularly. Each provider is accessed through the same unified API endpoint.

Does Bifrost work with Claude Code?+

Yes. Bifrost integrates with Claude Code via MCP (Model Context Protocol). After connecting, Claude Code sends requests through Bifrost which routes them to your chosen provider. This lets Claude Code use models from any supported provider.

Is Bifrost free?+

Bifrost CLI is available for local development use. Enterprise features like team management, analytics, and SLA-backed failover may have separate pricing. Check the official documentation for current pricing details.

How does failover work in Bifrost?+

When a provider returns an error or times out, Bifrost automatically retries the request with the next provider in your configured failover chain. This happens transparently -- your application code does not need to handle provider-specific errors.

Can I use Bifrost with other coding agents besides Claude Code?+

Yes. Bifrost exposes an OpenAI-compatible API, so any tool that works with the OpenAI API format can connect to Bifrost. This includes Codex CLI, Gemini CLI, Cursor, and custom applications using the OpenAI SDK.

Citations (3)
🙏

Source & Thanks

Created by Maxim. Licensed under Apache 2.0.

maximhq/bifrost — 3.6k+ stars

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets