Skip to main content
POST
Create Chat Completion

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Corresponds to args to OpenAI client.chat.completions.create(...)

messages
(ChatCompletionDeveloperMessageParam · object | ChatCompletionSystemMessageParam · object | ChatCompletionUserMessageParam · object | ChatCompletionAssistantMessageParam · object | ChatCompletionToolMessageParam · object | ChatCompletionFunctionMessageParam · object)[]
required

Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, developer messages replace the previous system messages.

model
required
audio
ChatCompletionAudioParam · object | null

Parameters for audio output.

Required when audio output is requested with modalities: ["audio"]. Learn more.

frequency_penalty
number | null
function_call
Available options:
none,
auto
functions
Function · object[] | null
logit_bias
Logit Bias · object | null
logprobs
boolean | null
max_completion_tokens
integer | null
max_tokens
integer | null
metadata
Metadata · object | null
modalities
enum<string>[] | null
Available options:
text,
audio
n
integer | null
parallel_tool_calls
boolean | null
prediction
ChatCompletionPredictionContentParam · object | null

Static predicted output content, such as the content of a text file that is being regenerated.

presence_penalty
number | null
reasoning_effort
enum<string> | null
Available options:
none,
minimal,
low,
medium,
high,
xhigh
response_format
ResponseFormatText · object

Default response format. Used to generate text responses.

seed
integer | null
service_tier
enum<string> | null
Available options:
auto,
default,
flex,
scale,
priority
stop
store
boolean | null
stream
boolean | null
stream_options
ChatCompletionStreamOptionsParam · object | null

Options for streaming response. Only set this when you set stream: true.

temperature
number | null
tool_choice
Available options:
none,
auto,
required
tools
ChatCompletionFunctionToolParam · object[] | null
top_logprobs
integer | null
top_p
number | null
user
string | null
web_search_options
WebSearchOptions · object | null

This tool searches the web for relevant results to use in a response. Learn more about the web search tool.

Response

Successful Response