Chat Completions
Generate chat completions based on a conversation history.
Headers
Authorization
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
This endpoint expects an object.
model
The chat model to use for generating completions.
messages
frequency_penalty
A value between -2.0 and 2.0, with positive values increasingly penalizing new tokens based on their frequency so far in order to decrease further occurrences.
logit_bias
Modifies the likelihood of specified tokens appearing in a response.
max_completion_tokens
The maximum number of tokens in the generated completion.
parallel_tool_calls
Whether to enable parallel function calling during tool use.
presence_penalty
A value between -2.0 and 2.0, with positive values causing a flat reduction of new tokens based on their existing presence so far in order to decrease further occurrences.
stop
stream
Whether to stream back the model response.
temperature
The temperature parameter for controlling randomness in completions.
tool_choice
tools
The content of the tool call.
top_p
The diversity of the generated text based on nucleus sampling.
top_k
The diversity of the generated text based on top-k sampling.
output
Options to affect the output of the response.
input
Options to affect the input of the request.
max_tokens
Deprecated. Please use max_completion_tokens.
Response
Successful response.
id
Unique ID for the chat completion.
object
Type of object (chat completion).
created
Timestamp of when the chat completion was created.
model
The chat model used for generating completions.
choices
The set of result choices.