pub struct RequestBody {Show 38 fields
pub messages: Vec<ChatCompletionMessageParam>,
pub model: Model,
pub audio: Option<ChatCompletionAudioParam>,
pub frequency_penalty: Option<f64>,
pub function_call: Option<ChatCompletionFunctionCallOptionParam>,
pub functions: Option<Vec<ChatCompletionLegacyFunction>>,
pub logit_bias: Option<LogitBias>,
pub logprobs: Option<bool>,
pub max_completion_tokens: Option<u64>,
pub max_tokens: Option<u64>,
pub metadata: Option<Metadata>,
pub modalities: Option<Vec<ChatCompletionModality>>,
pub n: Option<u32>,
pub parallel_tool_calls: Option<bool>,
pub prediction: Option<ChatCompletionPredictionContent>,
pub presence_penalty: Option<f64>,
pub prompt_cache_key: Option<String>,
pub prompt_cache_retention: Option<ChatCompletionPromptCacheRetention>,
pub reasoning_effort: Option<ChatCompletionReasoningEffort>,
pub response_format: Option<ChatCompletionResponseFormat>,
pub safety_identifier: Option<String>,
pub seed: Option<i64>,
pub service_tier: Option<ChatCompletionServiceTier>,
pub stop: Option<ChatCompletionStop>,
pub store: Option<bool>,
pub stream: Option<bool>,
pub stream_options: Option<ChatCompletionStreamOptions>,
pub temperature: Option<f64>,
pub tool_choice: Option<ChatCompletionToolChoiceOption>,
pub tools: Option<Vec<ChatCompletionTool>>,
pub top_logprobs: Option<u32>,
pub top_p: Option<f64>,
pub user: Option<String>,
pub verbosity: Option<ChatCompletionVerbosity>,
pub thinking: Option<ChatCompletionClaudeThinkingConfig>,
pub thinking_config: Option<ChatCompletionGeminiExtraThinkingConfig>,
pub cached_content: Option<String>,
pub web_search_options: Option<ChatCompletionWebSearchOptions>,
}Expand description
Body payload for POST /chat/completions.
Fields§
§messages: Vec<ChatCompletionMessageParam>A list of messages comprising the conversation so far.
model: ModelModel identifier.
audio: Option<ChatCompletionAudioParam>Audio output configuration.
frequency_penalty: Option<f64>Frequency penalty in range [-2.0, 2.0].
function_call: Option<ChatCompletionFunctionCallOptionParam>Deprecated function-call control.
functions: Option<Vec<ChatCompletionLegacyFunction>>Deprecated function definitions.
logit_bias: Option<LogitBias>Token-level logit bias.
logprobs: Option<bool>Whether to return logprobs.
max_completion_tokens: Option<u64>Upper bound of generated tokens including reasoning tokens.
max_tokens: Option<u64>Deprecated maximum generated tokens.
metadata: Option<Metadata>Request metadata key-value map.
modalities: Option<Vec<ChatCompletionModality>>Output modalities.
n: Option<u32>Number of choices to generate.
parallel_tool_calls: Option<bool>Enable parallel tool calls.
prediction: Option<ChatCompletionPredictionContent>Predicted output content.
presence_penalty: Option<f64>Presence penalty in range [-2.0, 2.0].
prompt_cache_key: Option<String>Prompt cache bucketing key.
prompt_cache_retention: Option<ChatCompletionPromptCacheRetention>Prompt cache retention policy.
reasoning_effort: Option<ChatCompletionReasoningEffort>Reasoning effort level.
response_format: Option<ChatCompletionResponseFormat>Output format control.
safety_identifier: Option<String>Stable safety identifier.
seed: Option<i64>Best-effort deterministic seed.
service_tier: Option<ChatCompletionServiceTier>Requested processing tier.
stop: Option<ChatCompletionStop>Stop sequence(s).
store: Option<bool>Whether to store output.
stream: Option<bool>Whether to stream with SSE.
stream_options: Option<ChatCompletionStreamOptions>Streaming options.
temperature: Option<f64>Sampling temperature in range [0, 2].
tool_choice: Option<ChatCompletionToolChoiceOption>Tool selection policy.
tools: Option<Vec<ChatCompletionTool>>Available tools.
top_logprobs: Option<u32>Number of top candidate tokens in logprobs.
top_p: Option<f64>Nucleus sampling probability mass.
user: Option<String>Deprecated user identifier.
verbosity: Option<ChatCompletionVerbosity>Verbosity hint.
thinking: Option<ChatCompletionClaudeThinkingConfig>Provider-specific OpenAI-compatible extension payload (flattened). Claude-compatible extended thinking control.
thinking_config: Option<ChatCompletionGeminiExtraThinkingConfig>§cached_content: Option<String>§web_search_options: Option<ChatCompletionWebSearchOptions>Web-search tool options.
Trait Implementations§
Source§impl Clone for RequestBody
impl Clone for RequestBody
Source§fn clone(&self) -> RequestBody
fn clone(&self) -> RequestBody
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more