█

AI/TLDR

Buy me a coffee
Buy me a coffee

Bifrost

One OpenAI-compatible API for 23+ LLM providers, with failover and caching

Gateways & RoutingOpen source
Language
Go
IN SHORT

What is Bifrost?

Bifrost is an open-source AI gateway written in Go that puts a single, OpenAI-compatible API in front of more than 23 model providers, including OpenAI, Anthropic, AWS Bedrock, Google Vertex, Azure, Mistral, Ollama, and Groq. It sits in the Gateways & Routing category of the Evaluation & Production Ops tools and is open-source, written in Go.

Overview

Bifrost is an open-source AI gateway written in Go that puts a single, OpenAI-compatible API in front of more than 23 model providers, including OpenAI, Anthropic, AWS Bedrock, Google Vertex, Azure, Mistral, Ollama, and Groq. Your application talks to one endpoint, and Bifrost routes each request to the provider you name in the model string.

It is aimed at teams who call several LLM providers and want one place to handle keys, failover, and routing instead of wiring each SDK separately. Because the API matches the OpenAI format, it can act as a drop-in replacement for existing OpenAI or Anthropic client code with little change.

As an LLM gateway, Bifrost sits between your app and the providers. It adds automatic fallbacks, load balancing across keys and providers, semantic caching, and observability, and ships with a built-in web UI for visual configuration and monitoring.

What it does

  • Single OpenAI-compatible API in front of 23+ providers (OpenAI, Anthropic, AWS Bedrock, Google Vertex, Azure, Cohere, Mistral, Ollama, Groq, and more)
  • Automatic fallbacks between providers and models, plus load balancing across multiple API keys
  • Semantic caching that reuses responses for similar requests to cut cost and latency
  • Built-in web UI for provider configuration, real-time monitoring, and analytics
  • Model Context Protocol (MCP) support so models can call external tools like filesystem and web search
  • Observability with native Prometheus metrics, distributed tracing, and request logging

Getting started

Bifrost runs as an HTTP gateway you can start with npx or Docker, then call with any OpenAI-compatible client.

Start the gateway

Run Bifrost locally with npx, or use the Docker image. Both serve the gateway and the web UI on port 8080.

bashbash
# Install and run locally
npx -y @maximhq/bifrost

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

Configure via the web UI

Open the built-in web interface to add providers and API keys.

bashbash
# Open the built-in web interface
open http://localhost:8080

Make your first API call

Send a chat completion to the gateway. Set the model as provider/model, for example openai/gpt-4o-mini.

bashbash
curl -X POST http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello, Bifrost!"}]
  }'

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Call several LLM providers through one OpenAI-compatible endpoint instead of integrating each SDK separately
  • Add automatic failover so requests keep working when one provider or model is down
  • Reduce cost and latency by serving repeated or similar prompts from the semantic cache
  • Track usage and route traffic across multiple API keys with budgets and rate limits

How Bifrost compares

Bifrost alongside other open-source gateways & routing tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
OmniRoute★ 91.4kA local-first AI gateway that fronts hundreds of model providers with one OpenAI-compatible endpoint, quota-aware auto-fallback, many routing strategies and prompt compression.
Free Claude Code★ 74.7kA local proxy that points Claude Code, Codex, Pi, OpenCode, Cline and other agent CLIs at 50 free, paid, subscription or local model providers, with automatic failover and an admin UI.
LiteLLM★ 64.2kA Python SDK and proxy server that gives one OpenAI-compatible API to 100+ LLM providers, with cost tracking, budgets, fallbacks, rate limiting, and an admin UI.
Kong Gateway★ 44.4kA Lua/NGINX API gateway whose AI Gateway plugins put one universal endpoint in front of OpenAI, Anthropic, Gemini, Bedrock and other providers, with semantic routing, caching and MCP traffic governance.
magpie★ 43.7kMenu bar app and local gateway that lets Claude Code, Codex, Gemini CLI and dozens of other coding agents run on any provider's model, with routing groups that fail over across accounts when a quota runs out.
9Router★ 33kLocal OpenAI-compatible router for coding CLIs that tracks per-provider quota, falls back from subscription to cheap to free models, and compresses tool results to cut tokens.
Experiential★ 20.1kAn open-source gateway that puts hosted, BYOK, local and custom models behind one OpenAI-compatible API, with per-identity model and spend limits and routers fitted from your own traces.
Bifrost★ 10.1kOne OpenAI-compatible API for 23+ LLM providers, with failover and caching