Skip to main content
POST
/
v1
/
chat
/
completions
Error
A valid request URL is required to generate request examples
{
  "id": "<string>",
  "choices": [
    {
      "index": 123,
      "finish_reason": "<string>",
      "log_probs": {
        "content": [
          {
            "bytes": [
              123
            ],
            "logprob": 123,
            "token": "<string>",
            "top_logprobs": [
              {
                "bytes": [
                  123
                ],
                "logprob": 123,
                "token": "<string>"
              }
            ]
          }
        ],
        "refusal": [
          {
            "bytes": [
              123
            ],
            "logprob": 123,
            "token": "<string>"
          }
        ],
        "text_offset": [
          123
        ],
        "token_logprobs": [
          123
        ],
        "tokens": [
          "<string>"
        ],
        "top_logprobs": [
          {}
        ]
      },
      "text": "<string>",
      "message": {
        "role": "assistant",
        "name": "<string>",
        "content": "<string>",
        "tool_call_id": "<string>",
        "refusal": "<string>",
        "audio": {
          "id": "<string>",
          "data": "<string>",
          "expires_at": 123,
          "transcript": "<string>"
        },
        "reasoning": "<string>",
        "reasoning_details": [
          {
            "id": "<string>",
            "index": 123,
            "type": "reasoning.summary",
            "summary": "<string>",
            "text": "<string>",
            "signature": "<string>",
            "data": "<string>"
          }
        ],
        "annotations": [
          {
            "type": "<string>",
            "url_citation": {
              "start_index": 123,
              "end_index": 123,
              "title": "<string>",
              "url": "<string>",
              "sources": {},
              "type": "<string>"
            }
          }
        ],
        "tool_calls": [
          {
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            },
            "index": 123,
            "type": "<string>",
            "id": "<string>"
          }
        ]
      },
      "delta": {
        "role": "<string>",
        "content": "<string>",
        "refusal": "<string>",
        "audio": {
          "id": "<string>",
          "data": "<string>",
          "expires_at": 123,
          "transcript": "<string>"
        },
        "reasoning": "<string>",
        "reasoning_details": [
          {
            "id": "<string>",
            "index": 123,
            "type": "reasoning.summary",
            "summary": "<string>",
            "text": "<string>",
            "signature": "<string>",
            "data": "<string>"
          }
        ],
        "tool_calls": [
          {
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            },
            "index": 123,
            "type": "<string>",
            "id": "<string>"
          }
        ]
      }
    }
  ],
  "created": 123,
  "model": "<string>",
  "object": "<string>",
  "service_tier": "<string>",
  "system_fingerprint": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "prompt_tokens_details": {
      "text_tokens": 123,
      "audio_tokens": 123,
      "image_tokens": 123,
      "cached_read_tokens": 123,
      "cached_write_tokens": 123
    },
    "completion_tokens": 123,
    "completion_tokens_details": {
      "text_tokens": 123,
      "accepted_prediction_tokens": 123,
      "audio_tokens": 123,
      "citation_tokens": 123,
      "num_search_queries": 123,
      "reasoning_tokens": 123,
      "image_tokens": 123,
      "rejected_prediction_tokens": 123
    },
    "total_tokens": 123,
    "cost": {
      "input_tokens_cost": 123,
      "output_tokens_cost": 123,
      "reasoning_tokens_cost": 123,
      "citation_tokens_cost": 123,
      "search_queries_cost": 123,
      "request_cost": 123,
      "total_cost": 123
    }
  },
  "extra_fields": {
    "request_type": "<string>",
    "provider": "openai",
    "model_requested": "<string>",
    "model_deployment": "<string>",
    "latency": 123,
    "chunk_index": 123,
    "raw_request": {},
    "raw_response": {},
    "cache_debug": {
      "cache_hit": true,
      "cache_id": "<string>",
      "hit_type": "<string>",
      "requested_provider": "<string>",
      "requested_model": "<string>",
      "provider_used": "<string>",
      "model_used": "<string>",
      "input_tokens": 123,
      "threshold": 123,
      "similarity": 123
    }
  },
  "search_results": [
    {
      "title": "<string>",
      "url": "<string>",
      "date": "<string>",
      "last_updated": "<string>",
      "snippet": "<string>",
      "source": "<string>"
    }
  ],
  "videos": [
    {
      "url": "<string>",
      "thumbnail_url": "<string>",
      "thumbnail_width": 123,
      "thumbnail_height": 123,
      "duration": 123
    }
  ],
  "citations": [
    "<string>"
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.getbifrost.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your provider API key or Bifrost authentication token. Virtual keys (prefixed with sk-bf-) can also be passed here.

Body

application/json
model
string
required

Model in provider/model format (e.g., openai/gpt-4)

Example:

"openai/gpt-4"

messages
object[]
required

List of messages in the conversation

fallbacks
string[]

Fallback models in provider/model format

stream
boolean

Whether to stream the response

frequency_penalty
number
Required range: -2 <= x <= 2
logit_bias
object
logprobs
boolean
max_completion_tokens
integer
metadata
object
modalities
string[]
parallel_tool_calls
boolean
presence_penalty
number
Required range: -2 <= x <= 2
prompt_cache_key
string
reasoning
object
response_format
object

Format for the response

safety_identifier
string
service_tier
string
stream_options
object
store
boolean
temperature
number
Required range: 0 <= x <= 2
tool_choice
Available options:
none,
auto,
required
tools
object[]
seed
integer

Deterministic sampling seed

top_p
number

Nucleus sampling parameter

Required range: 0 <= x <= 1
top_logprobs
integer

Number of most likely tokens to return at each position

Required range: 0 <= x <= 20
stop

Up to 4 sequences where the API will stop generating tokens

prediction
object

Predicted output content for the model to reference (OpenAI only). Can reduce latency.

prompt_cache_retention
enum<string>

Prompt cache retention policy

Available options:
in-memory,
24h
web_search_options
object

Web search options for chat completions (OpenAI only)

truncation
string
user
string
verbosity
enum<string>
Available options:
low,
medium,
high

Response

Successful response

id
string
choices
object[]
created
integer
model
string
object
string
service_tier
string
system_fingerprint
string
usage
object

Token usage information

extra_fields
object

Additional fields included in responses

search_results
object[]
videos
object[]
citations
string[]