Skip to main content
POST
Error

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.

Headers

x-bf-async
enum<string>

Set to true to submit this request as an async job. Returns immediately with a job ID. Not compatible with streaming.

Available options:
true
x-bf-async-id
string

Poll for results of a previously submitted async job by providing the job ID returned from the initial async request.

x-bf-async-job-result-ttl
integer
default:3600

Override the default result TTL in seconds. Results expire after this duration from completion time.

Body

application/json
model
string
required

Model identifier (e.g., gpt-4, gpt-3.5-turbo)

Example:

"gpt-4"

messages
object[]
required

List of messages in the conversation

stream
boolean

Whether to stream the response

max_tokens
integer

Maximum tokens to generate (legacy, use max_completion_tokens)

max_completion_tokens
integer

Maximum tokens to generate

temperature
number
Required range: 0 <= x <= 2
top_p
number
frequency_penalty
number
Required range: -2 <= x <= 2
presence_penalty
number
Required range: -2 <= x <= 2
logit_bias
object
logprobs
boolean
top_logprobs
integer
n
integer
stop
seed
integer
user
string
tools
object[]
tool_choice
Available options:
none,
auto,
required
parallel_tool_calls
boolean
response_format
object

Format for the response

reasoning_effort
enum<string>

OpenAI reasoning effort level

Available options:
none,
minimal,
low,
medium,
high,
xhigh
service_tier
string
stream_options
object
fallbacks
string[]

Fallback models

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[]