Skip to main content
POST
Create a chat conversation
This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at OpenAI Docs.

Authorizations

Authorization
string
header
required

Authentication is done using Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Body

application/json
model
string
required

model ID

messages
object[]
required

message list

temperature
number
default:1

What sampling temperature to use, between 0 and 2.

Required range: 0 <= x <= 2
top_p
number
default:1

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.

Required range: 0 <= x <= 1
n
integer
default:1

How many chat completion choices to generate for each input message.

Required range: x >= 1
stream
boolean
default:false

If set to true, the model response data will be streamed to the client as it is generated using server-sent events.

stream_options
object
stop

Up to 4 sequences where the API will stop generating further tokens.

max_tokens
integer

The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.

max_completion_tokens
integer

An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.

presence_penalty
number
default:0

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

Required range: -2 <= x <= 2
frequency_penalty
number
default:0

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

Required range: -2 <= x <= 2
logit_bias
object
user
string
tools
object[]
tool_choice
Available options:
none,
auto,
required
response_format
object
seed
integer
reasoning_effort
enum<string>
Available options:
low,
medium,
high
modalities
enum<string>[]
Available options:
text,
audio
audio
object

Response

Successfully created response

id
string
object
string
Example:

"chat.completion"

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