Expand description
This module contains the request body and POST method for the chat completion API.
Structs§
- Assistant
Audio - Data about a previous audio response from the model, referenced in an assistant message for multi-turn audio conversations.
- Chat
Completion Audio Param - Parameters for audio output of a chat completion.
- Chat
Completion Prediction Content Param - Chat
Moderation Param - Configuration for running moderation on the request input and generated output.
- Content
Part File - A file input for a content part. At least one of
file_dataandfile_idshould be provided. - Content
Part Image Url - Contains either an image URL or a data URL for a base64 encoded image.
- Content
Part Input Audio - Base64 encoded audio input data.
- JSON
Schema - Moderation
Policy Param - The policy to apply to moderated response input and output.
- Moderation
Policy Side Param - The moderation policy for one side (input or output) of the response.
- Prompt
Cache Breakpoint - Marks the exact end of a reusable prompt prefix.
- Prompt
Cache Options - Options for prompt caching.
- Request
Body - Creates a model response for the given chat conversation.
- Stream
Options - Tool
Call Custom - Tool
Call Function - Tool
Choice Allowed Tools - Tool
Choice Custom - Tool
Choice Function - Tool
Custom - Tool
Custom Format Grammar Grammar - Tool
Function - WebSearch
Options - WebSearch
Options User Location Approximate
Enums§
- Assistant
Tool Call - Audio
Format - The output audio format of a chat completion.
- Chat
Completion Content Part Text Param Type - Chat
Completion Prediction Content Param Content - Chat
Completion Prediction Content Param Type - Content
Part - A content part of a multimodal user message.
- Image
Detail - The detail level of an image input.
- Input
Audio Format - The format of the encoded audio data.
- LowMedium
High Enum - Message
- Message
Content - The contents of a user message: either plain text, or an array of multimodal content parts.
- Modality
- Moderation
Policy Mode - The moderation policy mode.
- Prompt
Cache Breakpoint Mode - The breakpoint mode. Always
explicit. - Prompt
Cache Mode - The prompt cache breakpoint mode.
- Prompt
Cache Ttl - The prompt cache TTL. Currently only
30mis supported. - Reasoning
Effort - Constrains the effort on reasoning for reasoning models. This is an official OpenAI parameter; reasoning providers such as DeepSeek and Qwen accept a subset of these values and map the rest to their nearest effort level.
- Request
Tool - Response
Format - Stop
Keywords - Tool
Choice - Tool
Choice Allowed Tools Mode - The mode for allowed tools in tool choice.
- Tool
Choice Specific - Tool
Custom Format - Tool
Custom Format Grammar Grammar Syntax - Voice
- The voice the model uses to respond with audio output.
- WebSearch
Options User Location