💬 Chat Official Documentation

â‹™ Create Chat Completion

Creates a model response for the given chat conversation. Full documentation.

msg.payload Properties

messages array
A list of messages comprising the conversation so far.
model string
ID of the model to use.
store boolean | null
Whether to store the output of this chat completion request.
reasoning_effort string
Constrains effort on reasoning for reasoning models.
metadata object or null
Developer-defined tags and values used for filtering completions in the dashboard.
frequency_penalty number
Number between -2.0 and 2.0.
logit_bias object
Modify the likelihood of specified tokens appearing in the completion.
logprobs boolean
Whether to return log probabilities of the output tokens or not.
top_logprobs integer
An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested. Set logprobs to true when using this field.
max_tokens [Deprecated] integer
The maximum number of tokens that can be generated in the chat completion. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.
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.
n integer
How many chat completion choices to generate for each input message.
modalities array or null
Output types that you would like the model to generate for this request.
prediction object
Configuration for a Predicted Output.
prompt_cache_retention string | null
Prompt cache retention policy. Set 24h for extended prompt caching. For gpt-5.5, gpt-5.5-pro, and future models, only 24h is supported. For older models that support both in_memory and 24h, the default depends on the organization's data retention policy: organizations without ZDR enabled default to 24h, and organizations with ZDR enabled default to in_memory when prompt_cache_retention is not specified.
audio object or null
Parameters for audio output.
presence_penalty number
Number between -2.0 and 2.0.
response_format object
An object specifying the format that the model must output.
seed integer
This feature is in Beta. If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
service_tier string or null
Specifies the latency tier to use for processing the request.
stop string | array
Up to 4 sequences where the API will stop generating further tokens.
stream boolean
If set, partial message deltas will be sent, like in ChatGPT.
stream_options object
Options for streaming response. Only set this when you set ```stream: true```.
temperature number
What sampling temperature to use, between 0 and 2.
top_p number
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
tools array
A list of tools the model may call.
tool_choice string | object
Whether to enable parallel function calling during tool use.
parallel_tool_calls string | object
Whether to enable parallel function calling during tool use.
user string
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

â‹™ Get Chat Completion

Get a stored chat completion. Full documentation.

msg.payload Properties

completion_id string
The ID of the chat completion to retrieve.

â‹™ Get Chat Messages

Get the messages in a stored chat completion. Full documentation.

msg.payload Properties

completion_id string
The ID of the chat completion to retrieve messages from.
after string
Identifier for the last message from the previous pagination request.
limit integer
Number of messages to retrieve.
order string
Sort order for messages by timestamp.

â‹™ List Chat Completions

List stored chat completions. Full documentation.

msg.payload Properties

model string
The model used to generate the chat completions.
metadata object
A list of metadata keys to filter the chat completions by.
after string
Identifier for the last chat completion from the previous pagination request.
limit integer
Number of chat completions to retrieve.
order string
Sort order for chat completions by timestamp.

â‹™ Update Chat Completion

Modify a stored chat completion. Full documentation.

msg.payload Properties

completion_id string
The ID of the chat completion to update.
metadata object
Set of 16 key-value pairs that can be attached to an object.

â‹™ Delete Chat Completion

Delete a stored chat completion. Full documentation.

msg.payload Properties

completion_id string
The ID of the chat completion to delete.