Overview
Bifrost provides complete OpenAI API compatibility through protocol adaptation. The integration handles request transformation, response normalization, and error mapping between OpenAI’s API specification and Bifrost’s internal processing pipeline. This integration enables you to utilize Bifrost’s features like governance, load balancing, semantic caching, multi-provider support, and more, all while preserving your existing OpenAI SDK-based architecture. Endpoint:/openai
Setup
- Python
- JavaScript
Provider/Model Usage Examples
Use multiple providers through the same OpenAI SDK format by prefixing model names with the provider:- Python
- JavaScript
Adding Custom Headers
Pass custom headers required by Bifrost plugins (like governance, telemetry, etc.):- Python
- JavaScript
Using Direct Keys
Pass API keys directly in requests to bypass Bifrost’s load balancing. You can pass any provider’s API key (OpenAI, Anthropic, Mistral, etc.) since Bifrost only looks forAuthorization or x-api-key headers. This requires the Allow Direct API keys option to be enabled in Bifrost configuration.
Learn more: See Key Management for enabling direct API key usage.
- Python
- JavaScript
x-bf-azure-endpoint header is required to specify your Azure resource endpoint.
- Python
- JavaScript
Async Inference
Submit inference requests asynchronously and poll for results later using thex-bf-async header. This is useful for long-running requests where you don’t want to hold a connection open. See Async Inference for full details.
Async inference requires a Logs Store to be configured and is not compatible with streaming.
Chat Completions
- Python
- JavaScript
Responses API
- Python
- JavaScript
Async Headers
| Header | Description |
|---|---|
x-bf-async: true | Submit the request as an async job. Returns immediately with a job ID. |
x-bf-async-id: <job-id> | Poll for results of a previously submitted async job. |
x-bf-async-job-result-ttl: <seconds> | Override the default result TTL (default: 3600s). |
Supported Features
The OpenAI integration supports all features that are available in both the OpenAI SDK and Bifrost core functionality. If the OpenAI SDK supports a feature and Bifrost supports it, the integration will work seamlessly.Next Steps
- Files and Batch API - File uploads and batch processing
- Anthropic SDK - Claude integration patterns
- Google GenAI SDK - Gemini integration patterns
- Configuration - Bifrost setup and configuration
- Core Features - Advanced Bifrost capabilities

