ChatRequestBody
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ChatRequestBody.type
Members list
Type members
Classlikes
Value parameters
- format
-
Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
- voice
-
The voice the model uses to respond. Supported voices are ash, ballad, coral, sage, and verse (also supported but not recommended are alloy, echo, and shimmer; these voices are less expressive).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Value parameters
- audio
-
Parameters for audio output. Required when audio output is requested with modalities: ["audio"].
- frequencyPenalty
-
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
- logitBias
-
Modify the likelihood of specified tokens appearing in the completion.
- logprobs
-
Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
- maxCompletionTokens
-
An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
- maxTokens
-
The maximum number of tokens to generate in the chat completion.
- messages
-
A list of messages describing the conversation so far.
- metadata
-
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
- modalities
-
Output types that you would like the model to generate for this request. Most models are capable of generating text, which is the default: ["text"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: ["text", "audio"].
- model
-
ID of the model to use.
- n
-
How many chat completion choices to generate for each input message.
- parallelToolCalls
-
Whether to enable parallel function calling during tool use.
- prediction
-
Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time. This is most common when you are regenerating a file with only minor changes to most of the content.
- presencePenalty
-
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- reasoningEffort
-
Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
- responseFormat
-
An object specifying the format that the model must output. Setting to {"type": "json_object"} enables JSON mode, which guarantees the message the model generates is valid JSON.
- seed
-
This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.
- serviceTier
-
Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service:
- If set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted.
- If set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarantee.
- If set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarantee.
- When not set, the default behavior is 'auto'.
- stop
-
Up to 4 sequences where the API will stop generating further tokens.
- store
-
Whether or not to store the output of this chat completion request for use in our model distillation or evals products.
- streamOptions
-
Options for streaming response. Only set this when you set stream: true.
- temperature
-
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
- toolChoice
-
Controls which (if any) function is called by the model.
- tools
-
A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.
- topLogprobs
-
An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.
- topP
-
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- user
-
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object GPT35Turboobject GPT35Turbo0301object GPT4object GPT40314object GPT432kobject GPT432k0314object GPT4Turboobject GPT4oobject GPT4oMiniShow all
Attributes
- Companion
- class
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ChatCompletionModel.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class MultipartContentclass SingleContent
An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs.
An array of content parts with a defined type. Supported options differ based on the model being used to generate the response. Can contain text inputs.
Value parameters
- `type`
-
The type of the content part.
- text
-
The text content.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ContentPart.type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Contentclass Objecttrait Matchableclass AnyShow all
Value parameters
- `type`
-
The type of the predicted content you want to provide. This type is currently always content.
- content
-
The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Prediction.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- class
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ReasoningEffort.type
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ResponseFormat.type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Contentclass Objecttrait Matchableclass AnyShow all
Value parameters
- includeUsage
-
If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
StreamOptions.type
Value parameters
- metadata
-
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type