Skip to main content

Overview

Bifrost provides 100% OpenAI API compatibility with enhanced features:
  • Zero code changes - Works with existing OpenAI SDK applications
  • Same request/response formats - Exact OpenAI API specification
  • Enhanced capabilities - Multi-provider fallbacks, MCP tools, monitoring
  • All endpoints supported - Chat completions, text completions, function calling
  • Any provider under the hood - Use any configured provider (OpenAI, Anthropic, etc.)
Endpoint: POST /openai/v1/chat/completions
Provider Flexibility: While using OpenAI SDK format, you can specify any model like "anthropic/claude-3-sonnet-20240229" or "openai/gpt-4o-mini" - Bifrost will route to the appropriate provider automatically.

Quick Migration

Python (OpenAI SDK)

JavaScript (OpenAI SDK)


Supported Features

Fully Supported

Enhanced Features


Request Examples

Basic Chat Completion

Response:

Function Calling

Response with Tool Call:

Vision/Multimodal


Advanced Usage

Streaming Responses

Custom Headers

Error Handling


Enhanced Features

Automatic MCP Tool Integration

MCP tools are automatically available in OpenAI-compatible requests:

Load Balancing

Multiple API keys automatically load balanced:

Testing & Validation

Compatibility Testing

Test your existing OpenAI code with Bifrost:

Performance Comparison


Multi-Provider Support

Use multiple providers with OpenAI SDK format by prefixing model names:

Configuration

Bifrost Config for OpenAI

Environment Variables


Common Issues & Solutions

Issue: “Invalid API Key”

Problem: API key not being passed correctly Solution:

Issue: “Model not found”

Problem: Model not configured in Bifrost Solution: Add model to config.json:

Issue: “Connection refused”

Problem: Bifrost not running or wrong port Solution:

Issue: “Timeout errors”

Problem: Network timeout too low Solution: Increase timeout in config.json:
Architecture: For OpenAI integration implementation details, see Architecture Documentation.