Skip to main content

Module request

Module request 

Source
Expand description

This module contains the request body and POST method for the chat completion API.

Structs§

AssistantAudio
Data about a previous audio response from the model, referenced in an assistant message for multi-turn audio conversations.
ChatCompletionAudioParam
Parameters for audio output of a chat completion.
ChatCompletionPredictionContentParam
ChatModerationParam
Configuration for running moderation on the request input and generated output.
ContentPartFile
A file input for a content part. At least one of file_data and file_id should be provided.
ContentPartImageUrl
Contains either an image URL or a data URL for a base64 encoded image.
ContentPartInputAudio
Base64 encoded audio input data.
JSONSchema
ModerationPolicyParam
The policy to apply to moderated response input and output.
ModerationPolicySideParam
The moderation policy for one side (input or output) of the response.
PromptCacheBreakpoint
Marks the exact end of a reusable prompt prefix.
PromptCacheOptions
Options for prompt caching.
RequestBody
Creates a model response for the given chat conversation.
StreamOptions
ToolCallCustom
ToolCallFunction
ToolChoiceAllowedTools
ToolChoiceCustom
ToolChoiceFunction
ToolCustom
ToolCustomFormatGrammarGrammar
ToolFunction
WebSearchOptions
WebSearchOptionsUserLocationApproximate

Enums§

AssistantToolCall
AudioFormat
The output audio format of a chat completion.
ChatCompletionContentPartTextParamType
ChatCompletionPredictionContentParamContent
ChatCompletionPredictionContentParamType
ContentPart
A content part of a multimodal user message.
ImageDetail
The detail level of an image input.
InputAudioFormat
The format of the encoded audio data.
LowMediumHighEnum
Message
MessageContent
The contents of a user message: either plain text, or an array of multimodal content parts.
Modality
ModerationPolicyMode
The moderation policy mode.
PromptCacheBreakpointMode
The breakpoint mode. Always explicit.
PromptCacheMode
The prompt cache breakpoint mode.
PromptCacheTtl
The prompt cache TTL. Currently only 30m is supported.
ReasoningEffort
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.
RequestTool
ResponseFormat
StopKeywords
ToolChoice
ToolChoiceAllowedToolsMode
The mode for allowed tools in tool choice.
ToolChoiceSpecific
ToolCustomFormat
ToolCustomFormatGrammarGrammarSyntax
Voice
The voice the model uses to respond with audio output.
WebSearchOptionsUserLocation