Chat
ChatCompletions
Given a list of messages comprising a conversation, the model will return a response.
ModelsExpand Collapse
chat_completion_audio: object { id, data, expires_at, transcript } If the audio output modality is requested, this object contains data
about the audio response from the model. Learn more.
If the audio output modality is requested, this object contains data about the audio response from the model. Learn more.
chat_completion_audio_param: object { format, voice } Parameters for audio output. Required when audio output is requested with
modalities: ["audio"]. Learn more.
Parameters for audio output. Required when audio output is requested with
modalities: ["audio"]. Learn more.
chat_completion_chunk: object { id, choices, created, 7 more } Represents a streamed chunk of a chat completion response returned
by the model, based on the provided input.
Learn more.
Represents a streamed chunk of a chat completion response returned by the model, based on the provided input. Learn more.
chat_completion_content_part: ChatCompletionContentPartText { text, type, prompt_cache_breakpoint } or ChatCompletionContentPartImage { image_url, type, prompt_cache_breakpoint } or ChatCompletionContentPartInputAudio { input_audio, type, prompt_cache_breakpoint } or object { file, type, prompt_cache_breakpoint } Learn about text inputs.
Learn about text inputs.
chat_completion_content_part_image: object { image_url, type, prompt_cache_breakpoint } Learn about image inputs.
Learn about image inputs.
chat_completion_content_part_input_audio: object { input_audio, type, prompt_cache_breakpoint } Learn about audio inputs.
Learn about audio inputs.
chat_completion_content_part_text: object { text, type, prompt_cache_breakpoint } Learn about text inputs.
Learn about text inputs.
chat_completion_message_param: ChatCompletionDeveloperMessageParam { content, role, name } or ChatCompletionSystemMessageParam { content, role, name } or ChatCompletionUserMessageParam { content, role, name } or 3 moreDeveloper-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.
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.
chat_completion_message_tool_call: ChatCompletionMessageFunctionToolCall { id, function, type } or ChatCompletionMessageCustomToolCall { id, custom, type } A call to a function tool created by the model.
A call to a function tool created by the model.
chat_completion_tool: ChatCompletionFunctionTool { function, type } or ChatCompletionCustomTool { custom, type } A function tool that can be used to generate a response.
A function tool that can be used to generate a response.
chat_completion_tool_choice_option: "none" or "auto" or "required" or ChatCompletionAllowedToolChoice { allowed_tools, type } or ChatCompletionNamedToolChoice { function, type } or ChatCompletionNamedToolChoiceCustom { custom, type } Controls which (if any) tool is called by the model.
none means the model will not call any tool and instead generates a message.
auto means the model can pick between generating a message or calling one or more tools.
required means the model must call one or more tools.
Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
none is the default when no tools are present. auto is the default if tools are present.
Controls which (if any) tool is called by the model.
none means the model will not call any tool and instead generates a message.
auto means the model can pick between generating a message or calling one or more tools.
required means the model must call one or more tools.
Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
none is the default when no tools are present. auto is the default if tools are present.
ChatCompletionsMessages
Given a list of messages comprising a conversation, the model will return a response.