POST/v1/chat/completions
Chat Completions
Create a chat completion. Compatible with OpenAI API format.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID. Use "bifrost/auto" for automatic routing. |
| messages | array | Yes | Array of message objects with role and content. |
| stream | boolean | No | Enable streaming. Default: false. |
| temperature | number | No | Sampling temperature. Default: 0.7. |
| max_tokens | integer | No | Max tokens. Default: 4096. |
| tools | array | No | Tool definitions for function calling. |
Example
Response
Bifrost Decision
When using bifrost/auto, Bifrost selects the optimal model and provider automatically based on capability, cost, latency, and health.
Bifrost Decision
ModelClaude Sonnet 4
ProviderAnthropic
Route score94
Compression31%
CacheMISS
Latency842ms
Cost$0.018