OpenAIChatCompletionRequest

constructor(model: String, messages: List<OpenAIMessageParam>, audio: OpenAIChatCompletionAudioParam? = null, frequencyPenalty: Double? = null, logitBias: Map<String, Int>? = null, logprobs: Boolean? = null, maxCompletionTokens: Int? = null, maxTokens: Int? = null, metadata: OpenAIMetadata? = null, modalities: List<OpenAIModality>? = listOfNotNull(OpenAIModality.Text, OpenAIModality.Audio.takeIf { audio != null }), n: Int? = null, parallelToolCalls: Boolean? = null, presencePenalty: Double? = null, responseFormat: OpenAIResponseFormat? = null, seed: Long? = null, serviceTier: OpenAIServiceTier? = null, stop: OpenAIStop? = null, store: Boolean? = null, streamOptions: OpenAIStreamOptions? = null, temperature: Double? = null, toolChoice: OpenAIToolChoice? = null, topLogprobs: Int? = null, topP: Double? = null, tools: List<OpenAiChatCompletionFunctionTool> = emptyList(), user: String? = null, safetyIdentifier: String? = null, verbosity: OpenAIVerbosity? = null, reasoningEffort: OpenAIReasoningEffort? = null, stream: Boolean = false)


constructor(model: String, messages: List<OpenAIMessageParam>, audio: OpenAIChatCompletionAudioParam? = null, frequencyPenalty: Double? = null, logitBias: Map<String, Int>? = null, logprobs: Boolean? = null, maxCompletionTokens: Int? = null, maxTokens: Int? = null, metadata: OpenAIMetadata? = null, modalities: List<OpenAIModality>? = listOfNotNull(OpenAIModality.Text, OpenAIModality.Audio.takeIf { audio != null }), choicesCount: Int? = null, parallelToolCalls: Boolean? = null, presencePenalty: Double? = null, responseFormat: OpenAIResponseFormat? = null, seed: Long? = null, serviceTier: OpenAIServiceTier? = null, stop: OpenAIStop? = null, store: Boolean? = null, streamOptions: OpenAIStreamOptions? = null, temperature: Double? = null, toolChoice: OpenAIToolChoice? = null, topLogprobs: Int? = null, topP: Double? = null, tools: List<OpenAiChatCompletionFunctionTool> = emptyList(), user: String? = null, safetyIdentifier: String? = null, verbosity: OpenAIVerbosity? = null, reasoningEffort: OpenAIReasoningEffort? = null)

Secondary constructor using choicesCount as an alias for n.

Parameters

model

The model identifier (e.g. "gpt-5.6-sol").

messages

The list of message parameters.

audio

Audio output parameters for audio generation. null disables audio output.

frequencyPenalty

Penalty for token frequency (-2.0 to 2.0).

logitBias

Modifies the likelihood of specified tokens appearing in the completion.

logprobs

Whether to return log probabilities of the output tokens.

maxCompletionTokens

Upper bound for tokens generated in a completion.

maxTokens

The maximum number of tokens that can be generated. Deprecated in favor of maxCompletionTokens.

metadata

Set of up to 16 key-value pairs attached to the request object.

modalities

Output modalities to generate (e.g. text, audio).

choicesCount

Number of chat completion choices to generate. Maps to n.

parallelToolCalls

Whether to enable parallel function calling during tool use.

presencePenalty

Penalty for token presence (-2.0 to 2.0).

responseFormat

An object specifying the format that the model must output.

seed

Beta. Best-effort deterministic sampling seed.

serviceTier

Specifies the processing type used for serving the request.

stop

Sequences where the API stops generating further tokens.

store

Whether to store the output of this request.

streamOptions

Options for streaming responses.

temperature

Sampling temperature (0.0–2.0).

toolChoice

Controls which (if any) tool is called by the model.

topLogprobs

Maximum number of most likely tokens to return at each position (0–20).

topP

Nucleus sampling parameter (0.0–1.0).

tools

Available tool definitions.

user

Deprecated. A stable identifier for end-users.

safetyIdentifier

A stable identifier for users of your application.

verbosity

Constrains the verbosity of the model's response.

reasoningEffort

Reasoning effort level. null uses provider default.