BIFROST
Dashboard
POST/v1/chat/completions

Chat Completions

Create a chat completion. Compatible with OpenAI API format.

Request Body

ParameterTypeRequiredDescription
modelstringYesModel ID. Use "bifrost/auto" for automatic routing.
messagesarrayYesArray of message objects with role and content.
streambooleanNoEnable streaming. Default: false.
temperaturenumberNoSampling temperature. Default: 0.7.
max_tokensintegerNoMax tokens. Default: 4096.
toolsarrayNoTool definitions for function calling.

Example

Request
{
  "model": "bifrost/auto",
  "messages": [
    { "role": "user", "content": "Hello!" }
  ]
}

Response

Response — 200 OK
{
  "id": "bifrost_1234",
  "object": "chat.completion",
  "model": "claude-sonnet-4",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  }
}

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
← Previous
Authentication
Next →
Streaming