Skip to main content

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


Provider/Model Usage Examples

Use multiple providers through the same OpenAI SDK format by prefixing model names with the provider:

Adding Custom Headers

Pass custom headers required by Bifrost plugins (like governance, telemetry, etc.):

Async Inference

Submit inference requests asynchronously and poll for results later using the x-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

Responses API

Async Headers


Decisions API

OpenAI’s Decisions API works through Bifrost with the same base_url, at /openai/v1/decisions (or /openai/decisions). Any decision model can answer, on any provider that serves one: OpenAI’s gpt-6-luna, TypeSafe’s jev models, Clef on Cloudflare, Perplexity’s deciders, and the others listed under Decisions. A chat model returns unsupported_operation unless convert_decision_to_responses is on, which emulates the answer through its Responses API (details). Answers come back in OpenAI’s response shape, with name: null for a question sent without a name, plus Bifrost’s extra_fields as on the other OpenAI routes; when raw responses are enabled and OpenAI served the request, OpenAI’s own response body is returned instead. The request is OpenAI’s: a top-level state and a field a question, choice, or level does not define, such as TypeSafe’s criteria, are rejected with a 400 rather than translated, while other top-level fields a newer SDK sends are forwarded unchanged. For TypeSafe-only features, use /v1/decisions. client.decisions.create requires an SDK with the Decisions resource: openai>=3.26.0 in Python or openai>=7.30.0 in Node.
An SDK version without the decisions resource can send the same body with its generic request method, for example client.post("/decisions", body={...}, cast_to=httpx.Response) in Python or client.post("/decisions", { body: {...} }) in Node. See Decisions for the request fields.

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