diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 11ee7212d7..318899b64d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.50.0" + ".": "2.51.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index f0a6394000..5d31020c16 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 278 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-9152683f2fa71f5555cbbb53123ec013b7c83ee6fed4333e76c22a6f48a05f1c.yml -openapi_spec_hash: c58a8c1bb1f5bb7245323db9437bd67f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-44d4add500460ed21ac9ae1d6dd4047a32a79d3b4c3a9d9754f6ecf8cbdb9eec.yml +openapi_spec_hash: 8a34ba094583f56e975067493574fa69 config_hash: ca12d10f1dbe101a81cd0376f868c674 diff --git a/CHANGELOG.md b/CHANGELOG.md index 906170359d..48e1f8cc72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 2.51.0 (2026-07-30) + +Full Changelog: [v2.50.0...v2.51.0](https://github.com/openai/openai-python/compare/v2.50.0...v2.51.0) + +### Features + +* **api:** fast tier ([8808ed2](https://github.com/openai/openai-python/commit/8808ed27952dae13fb8761f045376af5b3e5bec2)) + + +### Bug Fixes + +* **api:** add fast tier to helper methods ([6064126](https://github.com/openai/openai-python/commit/60641266ff4b296044a81fe1717c17a70ceadbf1)) + ## 2.50.0 (2026-07-28) Full Changelog: [v2.49.0...v2.50.0](https://github.com/openai/openai-python/compare/v2.49.0...v2.50.0) diff --git a/pyproject.toml b/pyproject.toml index 4cc151efcd..b5afe38113 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "2.50.0" +version = "2.51.0" description = "The official Python library for the openai API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openai/_version.py b/src/openai/_version.py index 8836067b9e..8438cbcc19 100644 --- a/src/openai/_version.py +++ b/src/openai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openai" -__version__ = "2.50.0" # x-release-please-version +__version__ = "2.51.0" # x-release-please-version diff --git a/src/openai/resources/beta/responses/responses.py b/src/openai/resources/beta/responses/responses.py index ed244635d1..d926d4bd97 100644 --- a/src/openai/resources/beta/responses/responses.py +++ b/src/openai/resources/beta/responses/responses.py @@ -227,7 +227,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[response_create_params.Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -394,9 +394,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -609,7 +613,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[response_create_params.Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -782,9 +786,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -990,7 +998,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[response_create_params.Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -1163,9 +1171,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -1369,7 +1381,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[response_create_params.Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -2109,7 +2121,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[response_create_params.Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -2276,9 +2288,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -2491,7 +2507,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[response_create_params.Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -2664,9 +2680,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -2872,7 +2892,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[response_create_params.Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -3045,9 +3065,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -3251,7 +3275,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[response_create_params.Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -4995,7 +5019,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[beta_responses_client_event_param.ResponseCreateReasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[bool] | Omit = omit, stream_options: Optional[beta_responses_client_event_param.ResponseCreateStreamOptions] | Omit = omit, @@ -5198,7 +5222,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[beta_responses_client_event_param.ResponseCreateReasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[bool] | Omit = omit, stream_options: Optional[beta_responses_client_event_param.ResponseCreateStreamOptions] | Omit = omit, diff --git a/src/openai/resources/chat/completions/completions.py b/src/openai/resources/chat/completions/completions.py index 8d75855e3a..2375410600 100644 --- a/src/openai/resources/chat/completions/completions.py +++ b/src/openai/resources/chat/completions/completions.py @@ -115,7 +115,7 @@ def parse( reasoning_effort: Optional[ReasoningEffort] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit, @@ -276,7 +276,7 @@ def create( response_format: completion_create_params.ResponseFormat | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, @@ -489,9 +489,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -605,7 +609,7 @@ def create( response_format: completion_create_params.ResponseFormat | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit, @@ -826,9 +830,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -933,7 +941,7 @@ def create( response_format: completion_create_params.ResponseFormat | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit, @@ -1154,9 +1162,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -1260,7 +1272,7 @@ def create( response_format: completion_create_params.ResponseFormat | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, @@ -1559,7 +1571,7 @@ def stream( reasoning_effort: Optional[ReasoningEffort] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit, @@ -1714,7 +1726,7 @@ async def parse( reasoning_effort: Optional[ReasoningEffort] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit, @@ -1875,7 +1887,7 @@ async def create( response_format: completion_create_params.ResponseFormat | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, @@ -2088,9 +2100,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -2204,7 +2220,7 @@ async def create( response_format: completion_create_params.ResponseFormat | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit, @@ -2425,9 +2441,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -2532,7 +2552,7 @@ async def create( response_format: completion_create_params.ResponseFormat | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit, @@ -2753,9 +2773,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -2859,7 +2883,7 @@ async def create( response_format: completion_create_params.ResponseFormat | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, @@ -3158,7 +3182,7 @@ def stream( reasoning_effort: Optional[ReasoningEffort] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, seed: Optional[int] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[ChatCompletionStreamOptionsParam] | Omit = omit, diff --git a/src/openai/resources/responses/responses.py b/src/openai/resources/responses/responses.py index 54ce5ee26c..d0e0bed257 100644 --- a/src/openai/resources/responses/responses.py +++ b/src/openai/resources/responses/responses.py @@ -152,7 +152,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -316,9 +316,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -430,7 +434,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -600,9 +604,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -707,7 +715,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -877,9 +885,13 @@ def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -982,7 +994,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -1093,7 +1105,7 @@ def stream( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -1136,7 +1148,7 @@ def stream( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -1298,7 +1310,7 @@ def parse( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -1975,7 +1987,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -2139,9 +2151,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -2253,7 +2269,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -2423,9 +2439,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -2530,7 +2550,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -2700,9 +2720,13 @@ async def create( will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the @@ -2805,7 +2829,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -2916,7 +2940,7 @@ def stream( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -2959,7 +2983,7 @@ def stream( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -3120,7 +3144,7 @@ async def parse( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, @@ -4836,7 +4860,7 @@ def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[bool] | Omit = omit, stream_options: Optional[responses_client_event_param.StreamOptions] | Omit = omit, @@ -4920,7 +4944,7 @@ async def create( prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit, reasoning: Optional[Reasoning] | Omit = omit, safety_identifier: Optional[str] | Omit = omit, - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit, + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] | Omit = omit, store: Optional[bool] | Omit = omit, stream: Optional[bool] | Omit = omit, stream_options: Optional[responses_client_event_param.StreamOptions] | Omit = omit, diff --git a/src/openai/types/beta/beta_response.py b/src/openai/types/beta/beta_response.py index f9bea6200b..6633b293ba 100644 --- a/src/openai/types/beta/beta_response.py +++ b/src/openai/types/beta/beta_response.py @@ -551,7 +551,7 @@ class BetaResponse(BaseModel): [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = None + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] = None """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -559,9 +559,13 @@ class BetaResponse(BaseModel): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/beta/beta_responses_client_event.py b/src/openai/types/beta/beta_responses_client_event.py index a83f7038b2..af95baf3b7 100644 --- a/src/openai/types/beta/beta_responses_client_event.py +++ b/src/openai/types/beta/beta_responses_client_event.py @@ -499,7 +499,7 @@ class ResponseCreate(BaseModel): [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = None + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] = None """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -507,9 +507,13 @@ class ResponseCreate(BaseModel): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/beta/beta_responses_client_event_param.py b/src/openai/types/beta/beta_responses_client_event_param.py index e5d84f2b4e..64ef2d5837 100644 --- a/src/openai/types/beta/beta_responses_client_event_param.py +++ b/src/openai/types/beta/beta_responses_client_event_param.py @@ -498,7 +498,7 @@ class ResponseCreate(TypedDict, total=False): [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -506,9 +506,13 @@ class ResponseCreate(TypedDict, total=False): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/beta/response_create_params.py b/src/openai/types/beta/response_create_params.py index c86103cded..a92fbfa276 100644 --- a/src/openai/types/beta/response_create_params.py +++ b/src/openai/types/beta/response_create_params.py @@ -314,7 +314,7 @@ class ResponseCreateParamsBase(TypedDict, total=False): [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -322,9 +322,13 @@ class ResponseCreateParamsBase(TypedDict, total=False): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/chat/chat_completion.py b/src/openai/types/chat/chat_completion.py index 2c4a78cd35..633d89e26c 100644 --- a/src/openai/types/chat/chat_completion.py +++ b/src/openai/types/chat/chat_completion.py @@ -217,7 +217,7 @@ class ChatCompletion(BaseModel): completions were requested. """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = None + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] = None """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -225,9 +225,13 @@ class ChatCompletion(BaseModel): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/chat/chat_completion_chunk.py b/src/openai/types/chat/chat_completion_chunk.py index d983336fab..41fa4bc5c2 100644 --- a/src/openai/types/chat/chat_completion_chunk.py +++ b/src/openai/types/chat/chat_completion_chunk.py @@ -291,7 +291,7 @@ class ChatCompletionChunk(BaseModel): Present on the moderation chunk when moderated completions are requested. """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = None + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] = None """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -299,9 +299,13 @@ class ChatCompletionChunk(BaseModel): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/chat/completion_create_params.py b/src/openai/types/chat/completion_create_params.py index ce027e067a..7e06d84f04 100644 --- a/src/openai/types/chat/completion_create_params.py +++ b/src/openai/types/chat/completion_create_params.py @@ -270,7 +270,7 @@ class CompletionCreateParamsBase(TypedDict, total=False): in the backend. """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -278,9 +278,13 @@ class CompletionCreateParamsBase(TypedDict, total=False): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/responses/response.py b/src/openai/types/responses/response.py index e94ad18b34..6503d679b0 100644 --- a/src/openai/types/responses/response.py +++ b/src/openai/types/responses/response.py @@ -401,7 +401,7 @@ class Response(BaseModel): [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = None + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] = None """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -409,9 +409,13 @@ class Response(BaseModel): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/responses/response_create_params.py b/src/openai/types/responses/response_create_params.py index 76d3b5fde6..b7282e5e6e 100644 --- a/src/openai/types/responses/response_create_params.py +++ b/src/openai/types/responses/response_create_params.py @@ -212,7 +212,7 @@ class ResponseCreateParamsBase(TypedDict, total=False): [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -220,9 +220,13 @@ class ResponseCreateParamsBase(TypedDict, total=False): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/responses/responses_client_event.py b/src/openai/types/responses/responses_client_event.py index 44606d8201..673c2cc9cc 100644 --- a/src/openai/types/responses/responses_client_event.py +++ b/src/openai/types/responses/responses_client_event.py @@ -315,7 +315,7 @@ class ResponsesClientEvent(BaseModel): [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] = None + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] = None """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -323,9 +323,13 @@ class ResponsesClientEvent(BaseModel): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the diff --git a/src/openai/types/responses/responses_client_event_param.py b/src/openai/types/responses/responses_client_event_param.py index 4d7981d2df..32829669fc 100644 --- a/src/openai/types/responses/responses_client_event_param.py +++ b/src/openai/types/responses/responses_client_event_param.py @@ -316,7 +316,7 @@ class ResponsesClientEventParam(TypedDict, total=False): [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ - service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] + service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority", "fast"]] """Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier @@ -324,9 +324,13 @@ class ResponsesClientEventParam(TypedDict, total=False): will use 'default'. - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or - '[priority](https://openai.com/api-priority-processing/)', then the request - will be processed with the corresponding service tier. + - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)', + then the request will be processed with the Flex Processing service tier. + - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, + include the `service_tier=fast` or `service_tier=priority` parameter for + Responses or Chat Completions. The response will show `service_tier=priority` + regardless of if you specify `service_tier=fast` or `priority` in your + request. - When not set, the default behavior is 'auto'. When the `service_tier` parameter is set, the response body will include the