CLI Coding Agents + Bifrost | Claude Code, Codex, Gemini, OpenCode

Run Claude Code, Codex CLI, Gemini CLI, and OpenCode through Bifrost for multi-provider routing, enterprise controls, cost tracking, and centralized observability.

Supported CLI Agents

Each CLI agent brings unique capabilities. Bifrost provides the enterprise controls, multi-provider access, and observability that all of them need at scale.

  • Provider: AnthropicClaude Code. Official CLI Agent for Anthropic Models.
  • Provider: OpenAICodex CLI. OpenAI's powerful code generation CLI.
  • Provider: GoogleGemini CLI. Google Gemini powered coding agent.
  • Provider: Multi-providerOpenCode. Open source coding agent framework.

Core Capabilities

  • 1000+ modelsMulti-provider model access. Every CLI agent gets access to 1000+ models through Bifrost. Switch between Anthropic, OpenAI, Google, AWS Bedrock, and more without reconfiguring your agent.
  • SOC 2 Type II readyEnterprise security & governance. All agent requests route through Bifrost, applying guardrails, PII redaction, content policies, and role-based access controls transparently.
  • Per-request costsUnified cost tracking. Track LLM spend across all CLI agents from a single dashboard. Virtual keys enforce per-team budgets. Export via the logs API or OTEL for custom cost analysis.
  • OTEL nativeCentralized observability. Every request from Claude Code, Codex CLI, Gemini CLI, and OpenCode is logged with full metadata. Export to any observability stack via OpenTelemetry.
  • 99.999% uptimeAutomatic failover & load balancing. When a provider hits rate limits or experiences an outage, Bifrost automatically routes agent requests to healthy providers. Adaptive load balancing keeps throughput stable.
  • Cost savingsSemantic caching. Repeat or near-identical queries across agents resolve instantly from cache, cutting costs and reducing latency for common coding operations.

Setup Steps

  1. 01Deploy Bifrost Gateway. Run Bifrost as a standalone service in your VPC or use managed hosting. Configure your LLM providers and optional guardrails through the dashboard.
    Deploy Bifrost Gateway
    # pull and start bifrost
    docker pull bifrost-gateway
    docker run -p 8080:8080 bifrost
  2. 02Point your CLI agent at Bifrost. Set the API base URL environment variable for your chosen agent. Each agent has slightly different configuration requirements.
    Point your CLI agent at Bifrost
    # Claude Code
    export ANTHROPIC_BASE_URL="http://localhost:8080"
    
    # Codex CLI (must end in /v1)
    export OPENAI_API_BASE="http://localhost:8080/openai/v1"
    
    # Gemini CLI
    export GEMINI_API_BASE="http://localhost:8080"
    
    # OpenCode
    export API_BASE_URL="http://localhost:8080"
  3. 03Start coding with enterprise controls. Launch your agent and start coding. All requests automatically route through Bifrost with full observability, cost tracking, and guardrails applied.
    Start coding with enterprise controls
    # Use Bifrost CLI for guided setup
    npx -y @maximhq/bifrost-cli
    
    # Or launch agents directly
    claude code
    codex generate
    gemini chat
    opencode

Comparison Data

FeatureStandaloneWith Bifrost
Multi-provider accessNo20+ providers
Automatic failoverNoAcross all providers
Cost trackingNoReal-time per request
Team budgetsNoVirtual keys + limits
Security guardrailsNoPII redaction + policies
Request observabilityNoFull logs + OTEL export
Semantic cachingNoReduce costs + latency
MCP tool integrationClaude Code onlyAll agents via gateway

Use Cases

  • Multi-agent development workflows. Teams use different CLI agents for different tasks: Claude Code for architecture, Codex for quick scripts, Gemini for code review, OpenCode for deployments. Bifrost provides unified governance.
  • Model performance comparison. Run the same coding task through Claude Code, Codex CLI, and Gemini CLI to compare quality, speed, and cost. Bifrost logs performance metrics for each provider.
  • Enterprise security compliance. Organizations route all CLI agent traffic through Bifrost to enforce PII redaction, content policies, and audit trails for SOC 2 Type II, HIPAA, and GDPR compliance.
  • Department-level cost management. Platform teams set budgets for each engineering department. Real-time dashboards show which teams, projects, and agents are driving LLM spend.
  • High-availability production coding. When Anthropic hits rate limits, Claude Code requests automatically route to Bedrock. When OpenAI hits rate limits or errors, Codex CLI switches to Azure OpenAI.
  • Centralized AI governance. Security teams enforce organization-wide policies across all CLI agents from a single control plane. No need to configure guardrails per agent.

Enterprise Features

  • Virtual keys per team. Create separate credentials for each team with independent rate limits and budgets.
  • Content filtering. Detect and redact PII, sensitive data, and API keys before requests reach models.
  • Audit trails. Complete tamper-evident logs of every request for compliance and security.
  • SSO integration. Authenticate via Google, GitHub, Okta, or any SAML/OIDC provider.
  • Adaptive routing. Traffic distributes intelligently based on real-time health and performance.
  • In-VPC deployment. Deploy entirely within your network perimeter for maximum security.

Open Source & Enterprise

OSS Features

  • 01Model Catalog. Access 8+ providers and 1000+ AI models through a unified interface. Also supports custom deployed models.
  • 02Budgeting. Set spending limits and track costs across teams, projects, and models.
  • 03Provider Fallback. Automatic failover between providers ensures 99.99% uptime for your applications.
  • 04MCP Gateway. Centralize all MCP tool connections, governance, security, and auth. Your AI can safely use MCP tools with centralized policy enforcement. [MCP Gateway resource]
  • 05Virtual Key Management. Create different virtual keys for different use cases with independent budgets and access control.
  • 06Unified Interface. One consistent API for all providers. Switch models without changing code.
  • 07Drop-in Replacement. Replace your existing SDK with just one line change. Compatible with OpenAI, Anthropic, LiteLLM, Google GenAI, LangChain, and more. [Drop-in replacement docs]
  • 08Built-in Observability. Out-of-the-box OpenTelemetry support. Built-in dashboard for quick visibility without complex setup.
  • 09Community Support. Active Discord community with responsive support and regular updates.

Enterprise Features

  • 01Governance. SAML support for SSO and role-based access control with policy enforcement for team collaboration. [Governance resource]
  • 02Adaptive Load Balancing. Automatically optimizes traffic distribution across provider keys and models based on real-time performance metrics.
  • 03Cluster Mode. High availability deployment with automatic failover and load balancing. Peer-to-peer clustering where every instance is equal.
  • 04Alerts. Real-time notifications for budget limits, failures, and performance issues on Email, Slack, PagerDuty, Teams, Webhook, and more.
  • 05Log Exports. Export and analyze request logs, traces, and telemetry data from Bifrost with enterprise-grade data export for compliance, monitoring, and analytics.
  • 06Audit Logs. Comprehensive logging and audit trails for compliance and debugging.
  • 07Vault Support. Secure API key management with HashiCorp Vault, AWS Secrets Manager, Google Secret Manager, and Azure Key Vault integration.
  • 08VPC Deployment. Deploy Bifrost within your private cloud infrastructure with VPC isolation, custom networking, and enhanced security controls. [Enterprise deployment resource]
  • 09Guardrails. Automatically detect and block unsafe model outputs with real-time policy enforcement and content moderation across all agents. [Guardrails resource]

FAQ

Can I use multiple CLI agents with the same Bifrost gateway?

Yes. Bifrost provides compatible endpoints for OpenAI, Anthropic, and Gemini-style APIs, allowing you to route Claude Code, Codex CLI, Gemini CLI, and OpenCode through the same gateway simultaneously. Each agent gets access to configured providers. Read more about Bifrost CLI. [Read more about Bifrost CLI]

How do I switch models or providers for a specific CLI agent?

You can configure model routing through Bifrost virtual keys, which specify which models each key can access. Alternatively, use Bifrost CLI (npx @maximhq/bifrost-cli) for guided setup that lets you select models before launching agents. The gateway handles provider routing automatically.

Does routing CLI agents through Bifrost add latency?

Bifrost adds approximately 11µs of gateway overhead per request at 5,000 RPS in the published t3.xlarge benchmark. Read the benchmark page for test conditions. [Bifrost benchmarks]

Can I use MCP tools with all CLI agents through Bifrost?

Claude Code has native MCP support that integrates directly with Bifrost MCP endpoints. Other agents can access MCP-connected tools through Bifrost's gateway, though the integration may vary by agent. The Bifrost CLI automatically registers MCP servers for Claude Code.

How are costs tracked across different CLI agents?

Bifrost logs every request with model, provider, token counts, and cost. Use virtual keys to tag requests by agent, team, or environment. Export via the logs API or OTEL to build cost breakdowns in your BI tool of choice.

What happens if one provider goes down while using CLI agents?

Bifrost automatically fails over to configured healthy providers. If the primary provider for an agent hits rate limits or errors, requests can route to fallback providers according to your gateway policy.