Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer token authentication. Get your API key from the dashboard.

Body

application/json
model
string
required

ID of the model to use

Example:
messages
object[]
required

A list of messages comprising the conversation so far

Minimum array length: 1
max_tokens
integer

The maximum number of tokens to generate in the chat completion

Required range: x >= 1
Example:

300

stream
boolean
default:false

If set, partial message deltas will be sent as data-only server-sent events

tools
object[]

A list of tools the model may call

tool_choice
default:auto

Controls which (if any) tool is called by the model

Available options:
none,
auto
logprobs
boolean
default:false

Whether to return log probabilities of the output tokens

top_logprobs
integer

An integer between 0 and 20 specifying the number of most likely tokens to return at each token position

Required range: 0 <= x <= 20
modalities
enum<string>[]

Output types the model should generate for this request

Available options:
text,
audio
audio
object

Parameters for audio output. Required when modalities includes audio

Response

Successful response

id
string
required

A unique identifier for the chat completion

object
enum<string>
required
Available options:
chat.completion
created
integer
required

The Unix timestamp (in seconds) of when the chat completion was created

model
string
required

The model used for the chat completion

choices
object[]
required
usage
object
system_fingerprint
string

This fingerprint represents the backend configuration that the model runs with