Update to the latest OpenAI OpenAPI Specification #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces significant updates to the
ChatCompletionRequest
specifications, enhancing the API's capabilities and providing more flexible options for developers.Key Changes
New Models
o1-preview
ando1-preview-2024-09-12
gpt-4o-realtime-preview
gpt-4o-audio-preview
chatgpt-4o-latest
New Parameters
Store Parameter
store
(boolean) to optionally store model responsesfalse
Metadata Support
metadata
parameterEnhanced Token Management
max_tokens
max_completion_tokens
for more precise output token controlModalities
modalities
parameterPrediction and Audio
prediction
parameter for advanced response predictionsaudio
parameter to handle audio input/outputResponse Format Improvements
response_format
to support:JsonObject
JsonSchema
Service Tier
service_tier
to"auto"
Benefits
Specifications Comparison
ChatCompletionRequest
model
gpt-4o
,gpt-4o-2024-05-13
,gpt-4o-mini
,gpt-4o-mini-2024-07-18
,gpt-4-turbo
,gpt-4-turbo-2024-04-09
,gpt-4-0125-preview
,gpt-4-turbo-preview
,gpt-4-1106-preview
,gpt-4-vision-preview
,gpt-4
,gpt-4-0314
,gpt-4-0613
,gpt-4-32k
,gpt-4-32k-0314
,gpt-4-32k-0613
,gpt-3.5-turbo
,gpt-3.5-turbo-16k
,gpt-3.5-turbo-0301
,gpt-3.5-turbo-0613
,gpt-3.5-turbo-1106
,gpt-3.5-turbo-0125
,gpt-3.5-turbo-16k-0613
o1-preview
,o1-preview-2024-09-12
,o1-mini
,o1-mini-2024-09-12
,gpt-4o
,gpt-4o-2024-11-20
,gpt-4o-2024-08-06
,gpt-4o-2024-05-13
,gpt-4o-realtime-preview
,gpt-4o-realtime-preview-2024-10-01
,gpt-4o-audio-preview
,gpt-4o-audio-preview-2024-10-01
,chatgpt-4o-latest
,gpt-4o-mini
,gpt-4o-mini-2024-07-18
,gpt-4-turbo
,gpt-4-turbo-2024-04-09
,gpt-4-0125-preview
,gpt-4-turbo-preview
,gpt-4-1106-preview
,gpt-4-vision-preview
,gpt-4
,gpt-4-0314
,gpt-4-0613
,gpt-4-32k
,gpt-4-32k-0314
,gpt-4-32k-0613
,gpt-3.5-turbo
,gpt-3.5-turbo-16k
,gpt-3.5-turbo-0301
,gpt-3.5-turbo-0613
,gpt-3.5-turbo-1106
,gpt-3.5-turbo-0125
,gpt-3.5-turbo-16k-0613
"o1-preview"
,"o1-preview-2024-09-12"
,"gpt-4o-realtime-preview"
,"gpt-4o-audio-preview"
,"chatgpt-4o-latest"
.store
boolean? store = false;
false
.metadata
record { string...; }? metadata?;
max_tokens
int? max_tokens?;
@deprecated int? max_tokens?;
max_tokens
is replaced withmax_completion_tokens
in the new version to provide more flexibility.max_completion_tokens
int? max_completion_tokens?;
max_tokens
.modalities
ChatCompletionModalities? modalities?;
prediction
PredictionContent? prediction?;
audio
CreateChatCompletionRequest_audio? audio?;
response_format
CreateChatCompletionRequest_response_format response_format?;
ResponseFormatText ResponseFormatJsonObject ResponseFormatJsonSchema response_format?;
JsonObject
,JsonSchema
) for structured data handling.service_tier
"auto" "default"? service_tier?;
"auto" "default"? service_tier = "auto";
"auto"
Resources and References
Official Documentation