From 21f9e5aaf6ae27f0235fddb3ffa30fe73337f59b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 02:31:27 +0000 Subject: [PATCH 1/7] docs(api): enhance method descriptions across audio, chat, realtime, skills, uploads, videos --- .stats.yml | 4 +- src/openai/resources/audio/speech.py | 4 ++ src/openai/resources/audio/transcriptions.py | 18 +++++++++ src/openai/resources/beta/chatkit/sessions.py | 12 ++++-- src/openai/resources/beta/chatkit/threads.py | 16 ++++---- .../resources/chat/completions/completions.py | 18 +++++++++ src/openai/resources/completions.py | 18 +++++++++ .../resources/realtime/client_secrets.py | 28 ++++++++++++++ .../resources/responses/input_tokens.py | 10 ++++- src/openai/resources/responses/responses.py | 20 ++++++++-- src/openai/resources/skills/content.py | 4 +- src/openai/resources/skills/skills.py | 20 +++++----- .../resources/skills/versions/content.py | 4 +- .../resources/skills/versions/versions.py | 16 ++++---- src/openai/resources/uploads/uploads.py | 16 +++++++- src/openai/resources/videos.py | 38 ++++++++++--------- 16 files changed, 184 insertions(+), 62 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1d0140eb64..0ab1454b8b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 148 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0db5326a0fb6a30ffad9242c72872c3388ef927e8a4549ddd20aec3420541209.yml -openapi_spec_hash: 9523fe30739802e15c88f4e7aac44e7f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-c20486f46004d6be2d280d7792c64d47fcea3e5b7fbbb50d3ffc6241aba653df.yml +openapi_spec_hash: bf1dbabc5a923d897309273183525c02 config_hash: 948733484caf41e71093c6582dbc319c diff --git a/src/openai/resources/audio/speech.py b/src/openai/resources/audio/speech.py index f2c8d635f3..96a32f9268 100644 --- a/src/openai/resources/audio/speech.py +++ b/src/openai/resources/audio/speech.py @@ -67,6 +67,8 @@ def create( """ Generates audio from the input text. + Returns the audio file content, or a stream of audio events. + Args: input: The text to generate audio for. The maximum length is 4096 characters. @@ -164,6 +166,8 @@ async def create( """ Generates audio from the input text. + Returns the audio file content, or a stream of audio events. + Args: input: The text to generate audio for. The maximum length is 4096 characters. diff --git a/src/openai/resources/audio/transcriptions.py b/src/openai/resources/audio/transcriptions.py index 599534855d..bc6e9f22de 100644 --- a/src/openai/resources/audio/transcriptions.py +++ b/src/openai/resources/audio/transcriptions.py @@ -85,6 +85,9 @@ def create( """ Transcribes audio into the input language. + Returns a transcription object in `json`, `diarized_json`, or `verbose_json` + format, or a stream of transcript events. + Args: file: The audio file object (not file name) to transcribe, in one of these formats: @@ -235,6 +238,9 @@ def create( """ Transcribes audio into the input language. + Returns a transcription object in `json`, `diarized_json`, or `verbose_json` + format, or a stream of transcript events. + Args: file: The audio file object (not file name) to transcribe, in one of these formats: @@ -343,6 +349,9 @@ def create( """ Transcribes audio into the input language. + Returns a transcription object in `json`, `diarized_json`, or `verbose_json` + format, or a stream of transcript events. + Args: file: The audio file object (not file name) to transcribe, in one of these formats: @@ -533,6 +542,9 @@ async def create( """ Transcribes audio into the input language. + Returns a transcription object in `json`, `diarized_json`, or `verbose_json` + format, or a stream of transcript events. + Args: file: The audio file object (not file name) to transcribe, in one of these formats: @@ -678,6 +690,9 @@ async def create( """ Transcribes audio into the input language. + Returns a transcription object in `json`, `diarized_json`, or `verbose_json` + format, or a stream of transcript events. + Args: file: The audio file object (not file name) to transcribe, in one of these formats: @@ -786,6 +801,9 @@ async def create( """ Transcribes audio into the input language. + Returns a transcription object in `json`, `diarized_json`, or `verbose_json` + format, or a stream of transcript events. + Args: file: The audio file object (not file name) to transcribe, in one of these formats: diff --git a/src/openai/resources/beta/chatkit/sessions.py b/src/openai/resources/beta/chatkit/sessions.py index a814f1058e..abfa496a56 100644 --- a/src/openai/resources/beta/chatkit/sessions.py +++ b/src/openai/resources/beta/chatkit/sessions.py @@ -63,7 +63,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ChatSession: """ - Create a ChatKit session + Create a ChatKit session. Args: user: A free-form string that identifies your end user; ensures this Session can @@ -117,7 +117,9 @@ def cancel( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ChatSession: """ - Cancel a ChatKit session + Cancel an active ChatKit session and return its most recent metadata. + + Cancelling prevents new requests from using the issued client secret. Args: extra_headers: Send extra headers @@ -176,7 +178,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ChatSession: """ - Create a ChatKit session + Create a ChatKit session. Args: user: A free-form string that identifies your end user; ensures this Session can @@ -230,7 +232,9 @@ async def cancel( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ChatSession: """ - Cancel a ChatKit session + Cancel an active ChatKit session and return its most recent metadata. + + Cancelling prevents new requests from using the issued client secret. Args: extra_headers: Send extra headers diff --git a/src/openai/resources/beta/chatkit/threads.py b/src/openai/resources/beta/chatkit/threads.py index 37cd57295a..7a2d4c4a30 100644 --- a/src/openai/resources/beta/chatkit/threads.py +++ b/src/openai/resources/beta/chatkit/threads.py @@ -55,7 +55,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ChatKitThread: """ - Retrieve a ChatKit thread + Retrieve a ChatKit thread by its identifier. Args: extra_headers: Send extra headers @@ -93,7 +93,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncConversationCursorPage[ChatKitThread]: """ - List ChatKit threads + List ChatKit threads with optional pagination and user filters. Args: after: List items created after this thread item ID. Defaults to null for the first @@ -152,7 +152,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreadDeleteResponse: """ - Delete a ChatKit thread + Delete a ChatKit thread along with its items and stored attachments. Args: extra_headers: Send extra headers @@ -190,7 +190,7 @@ def list_items( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncConversationCursorPage[Data]: """ - List ChatKit thread items + List items that belong to a ChatKit thread. Args: after: List items created after this thread item ID. Defaults to null for the first @@ -268,7 +268,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ChatKitThread: """ - Retrieve a ChatKit thread + Retrieve a ChatKit thread by its identifier. Args: extra_headers: Send extra headers @@ -306,7 +306,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ChatKitThread, AsyncConversationCursorPage[ChatKitThread]]: """ - List ChatKit threads + List ChatKit threads with optional pagination and user filters. Args: after: List items created after this thread item ID. Defaults to null for the first @@ -365,7 +365,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreadDeleteResponse: """ - Delete a ChatKit thread + Delete a ChatKit thread along with its items and stored attachments. Args: extra_headers: Send extra headers @@ -403,7 +403,7 @@ def list_items( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Data, AsyncConversationCursorPage[Data]]: """ - List ChatKit thread items + List items that belong to a ChatKit thread. Args: after: List items created after this thread item ID. Defaults to null for the first diff --git a/src/openai/resources/chat/completions/completions.py b/src/openai/resources/chat/completions/completions.py index fb1887a7d5..e1fc531fa9 100644 --- a/src/openai/resources/chat/completions/completions.py +++ b/src/openai/resources/chat/completions/completions.py @@ -301,6 +301,9 @@ def create( unsupported parameters in reasoning models, [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). + Returns a chat completion object, or a streamed sequence of chat completion + chunk objects if the request is streamed. + Args: messages: A list of messages comprising the conversation so far. Depending on the [model](https://platform.openai.com/docs/models) you use, different message @@ -603,6 +606,9 @@ def create( unsupported parameters in reasoning models, [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). + Returns a chat completion object, or a streamed sequence of chat completion + chunk objects if the request is streamed. + Args: messages: A list of messages comprising the conversation so far. Depending on the [model](https://platform.openai.com/docs/models) you use, different message @@ -905,6 +911,9 @@ def create( unsupported parameters in reasoning models, [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). + Returns a chat completion object, or a streamed sequence of chat completion + chunk objects if the request is streamed. + Args: messages: A list of messages comprising the conversation so far. Depending on the [model](https://platform.openai.com/docs/models) you use, different message @@ -1785,6 +1794,9 @@ async def create( unsupported parameters in reasoning models, [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). + Returns a chat completion object, or a streamed sequence of chat completion + chunk objects if the request is streamed. + Args: messages: A list of messages comprising the conversation so far. Depending on the [model](https://platform.openai.com/docs/models) you use, different message @@ -2087,6 +2099,9 @@ async def create( unsupported parameters in reasoning models, [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). + Returns a chat completion object, or a streamed sequence of chat completion + chunk objects if the request is streamed. + Args: messages: A list of messages comprising the conversation so far. Depending on the [model](https://platform.openai.com/docs/models) you use, different message @@ -2389,6 +2404,9 @@ async def create( unsupported parameters in reasoning models, [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). + Returns a chat completion object, or a streamed sequence of chat completion + chunk objects if the request is streamed. + Args: messages: A list of messages comprising the conversation so far. Depending on the [model](https://platform.openai.com/docs/models) you use, different message diff --git a/src/openai/resources/completions.py b/src/openai/resources/completions.py index 2f2284a622..4b6e29395b 100644 --- a/src/openai/resources/completions.py +++ b/src/openai/resources/completions.py @@ -76,6 +76,9 @@ def create( """ Creates a completion for the provided prompt and parameters. + Returns a completion object, or a sequence of completion objects if the request + is streamed. + Args: model: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to @@ -231,6 +234,9 @@ def create( """ Creates a completion for the provided prompt and parameters. + Returns a completion object, or a sequence of completion objects if the request + is streamed. + Args: model: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to @@ -386,6 +392,9 @@ def create( """ Creates a completion for the provided prompt and parameters. + Returns a completion object, or a sequence of completion objects if the request + is streamed. + Args: model: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to @@ -626,6 +635,9 @@ async def create( """ Creates a completion for the provided prompt and parameters. + Returns a completion object, or a sequence of completion objects if the request + is streamed. + Args: model: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to @@ -781,6 +793,9 @@ async def create( """ Creates a completion for the provided prompt and parameters. + Returns a completion object, or a sequence of completion objects if the request + is streamed. + Args: model: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to @@ -936,6 +951,9 @@ async def create( """ Creates a completion for the provided prompt and parameters. + Returns a completion object, or a sequence of completion objects if the request + is streamed. + Args: model: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to diff --git a/src/openai/resources/realtime/client_secrets.py b/src/openai/resources/realtime/client_secrets.py index 5ceba7bef1..d9947dd7e8 100644 --- a/src/openai/resources/realtime/client_secrets.py +++ b/src/openai/resources/realtime/client_secrets.py @@ -52,6 +52,20 @@ def create( """ Create a Realtime client secret with an associated session configuration. + Client secrets are short-lived tokens that can be passed to a client app, such + as a web frontend or mobile client, which grants access to the Realtime API + without leaking your main API key. You can configure a custom TTL for each + client secret. + + You can also attach session configuration options to the client secret, which + will be applied to any sessions created using that client secret, but these can + also be overridden by the client connection. + + [Learn more about authentication with client secrets over WebRTC](https://platform.openai.com/docs/guides/realtime-webrtc). + + Returns the created client secret and the effective session object. The client + secret is a string that looks like `ek_1234`. + Args: expires_after: Configuration for the client secret expiration. Expiration refers to the time after which a client secret will no longer be valid for creating sessions. The @@ -120,6 +134,20 @@ async def create( """ Create a Realtime client secret with an associated session configuration. + Client secrets are short-lived tokens that can be passed to a client app, such + as a web frontend or mobile client, which grants access to the Realtime API + without leaking your main API key. You can configure a custom TTL for each + client secret. + + You can also attach session configuration options to the client secret, which + will be applied to any sessions created using that client secret, but these can + also be overridden by the client connection. + + [Learn more about authentication with client secrets over WebRTC](https://platform.openai.com/docs/guides/realtime-webrtc). + + Returns the created client secret and the effective session object. The client + secret is a string that looks like `ek_1234`. + Args: expires_after: Configuration for the client secret expiration. Expiration refers to the time after which a client secret will no longer be valid for creating sessions. The diff --git a/src/openai/resources/responses/input_tokens.py b/src/openai/resources/responses/input_tokens.py index 8664164655..0056727fa0 100644 --- a/src/openai/resources/responses/input_tokens.py +++ b/src/openai/resources/responses/input_tokens.py @@ -65,7 +65,10 @@ def count( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InputTokenCountResponse: """ - Get input token counts + Returns input token counts of the request. + + Returns an object with `object` set to `response.input_tokens` and an + `input_tokens` count. Args: conversation: The conversation that this response belongs to. Items from this conversation are @@ -188,7 +191,10 @@ async def count( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InputTokenCountResponse: """ - Get input token counts + Returns input token counts of the request. + + Returns an object with `object` set to `response.input_tokens` and an + `input_tokens` count. Args: conversation: The conversation that this response belongs to. Items from this conversation are diff --git a/src/openai/resources/responses/responses.py b/src/openai/resources/responses/responses.py index 79034b7e18..4cb0e35cd3 100644 --- a/src/openai/resources/responses/responses.py +++ b/src/openai/resources/responses/responses.py @@ -1645,8 +1645,14 @@ def compact( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CompactedResponse: - """ - Compact conversation + """Compact a conversation. + + Returns a compacted response object. + + Learn when and how to compact long-running conversations in the + [conversation state guide](https://platform.openai.com/docs/guides/conversation-state#managing-the-context-window). + For ZDR-compatible compaction details, see + [Compaction (advanced)](https://platform.openai.com/docs/guides/conversation-state#compaction-advanced). Args: model: Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a @@ -3280,8 +3286,14 @@ async def compact( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CompactedResponse: - """ - Compact conversation + """Compact a conversation. + + Returns a compacted response object. + + Learn when and how to compact long-running conversations in the + [conversation state guide](https://platform.openai.com/docs/guides/conversation-state#managing-the-context-window). + For ZDR-compatible compaction details, see + [Compaction (advanced)](https://platform.openai.com/docs/guides/conversation-state#compaction-advanced). Args: model: Model ID used to generate the response, like `gpt-5` or `o3`. OpenAI offers a diff --git a/src/openai/resources/skills/content.py b/src/openai/resources/skills/content.py index 98c1531a94..c912fd3eb3 100644 --- a/src/openai/resources/skills/content.py +++ b/src/openai/resources/skills/content.py @@ -51,7 +51,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> _legacy_response.HttpxBinaryResponseContent: """ - Get Skill Content + Download a skill zip bundle by its ID. Args: extra_headers: Send extra headers @@ -106,7 +106,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> _legacy_response.HttpxBinaryResponseContent: """ - Get Skill Content + Download a skill zip bundle by its ID. Args: extra_headers: Send extra headers diff --git a/src/openai/resources/skills/skills.py b/src/openai/resources/skills/skills.py index b0e929bccf..77bed029df 100644 --- a/src/openai/resources/skills/skills.py +++ b/src/openai/resources/skills/skills.py @@ -88,7 +88,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Skill: """ - Create Skill + Create a new skill. Args: files: Skill files to upload (directory upload) or a single zip file. @@ -130,7 +130,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Skill: """ - Get Skill + Get a skill by its ID. Args: extra_headers: Send extra headers @@ -164,7 +164,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Skill: """ - Update Skill Default Version + Update the default version pointer for a skill. Args: default_version: The skill version number to set as default. @@ -202,7 +202,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursorPage[Skill]: """ - List Skills + List all skills for the current project. Args: after: Identifier for the last item from the previous pagination request @@ -252,7 +252,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeletedSkill: """ - Delete Skill + Delete a skill by its ID. Args: extra_headers: Send extra headers @@ -314,7 +314,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Skill: """ - Create Skill + Create a new skill. Args: files: Skill files to upload (directory upload) or a single zip file. @@ -356,7 +356,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Skill: """ - Get Skill + Get a skill by its ID. Args: extra_headers: Send extra headers @@ -390,7 +390,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Skill: """ - Update Skill Default Version + Update the default version pointer for a skill. Args: default_version: The skill version number to set as default. @@ -430,7 +430,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Skill, AsyncCursorPage[Skill]]: """ - List Skills + List all skills for the current project. Args: after: Identifier for the last item from the previous pagination request @@ -480,7 +480,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeletedSkill: """ - Delete Skill + Delete a skill by its ID. Args: extra_headers: Send extra headers diff --git a/src/openai/resources/skills/versions/content.py b/src/openai/resources/skills/versions/content.py index 4494ca0e2f..182a563dde 100644 --- a/src/openai/resources/skills/versions/content.py +++ b/src/openai/resources/skills/versions/content.py @@ -52,7 +52,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> _legacy_response.HttpxBinaryResponseContent: """ - Get Skill Version Content + Download a skill version zip bundle. Args: version: The skill version number. @@ -112,7 +112,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> _legacy_response.HttpxBinaryResponseContent: """ - Get Skill Version Content + Download a skill version zip bundle. Args: version: The skill version number. diff --git a/src/openai/resources/skills/versions/versions.py b/src/openai/resources/skills/versions/versions.py index 890a20774e..610a24240a 100644 --- a/src/openai/resources/skills/versions/versions.py +++ b/src/openai/resources/skills/versions/versions.py @@ -78,7 +78,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SkillVersion: """ - Create Skill Version + Create a new immutable skill version. Args: default: Whether to set this version as the default. @@ -130,7 +130,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SkillVersion: """ - Get Skill Version + Get a specific skill version. Args: version: The version number to retrieve. @@ -170,7 +170,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursorPage[SkillVersion]: """ - List Skill Versions + List skill versions for a skill. Args: after: The skill version ID to start after. @@ -222,7 +222,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeletedSkillVersion: """ - Delete Skill Version + Delete a skill version. Args: version: The skill version number. @@ -286,7 +286,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SkillVersion: """ - Create Skill Version + Create a new immutable skill version. Args: default: Whether to set this version as the default. @@ -338,7 +338,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SkillVersion: """ - Get Skill Version + Get a specific skill version. Args: version: The version number to retrieve. @@ -378,7 +378,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SkillVersion, AsyncCursorPage[SkillVersion]]: """ - List Skill Versions + List skill versions for a skill. Args: after: The skill version ID to start after. @@ -430,7 +430,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeletedSkillVersion: """ - Delete Skill Version + Delete a skill version. Args: version: The skill version number. diff --git a/src/openai/resources/uploads/uploads.py b/src/openai/resources/uploads/uploads.py index e8c047bd4f..2873b913ba 100644 --- a/src/openai/resources/uploads/uploads.py +++ b/src/openai/resources/uploads/uploads.py @@ -198,6 +198,8 @@ def create( the documentation on [creating a File](https://platform.openai.com/docs/api-reference/files/create). + Returns the Upload object with status `pending`. + Args: bytes: The number of bytes in the file you are uploading. @@ -257,6 +259,8 @@ def cancel( No Parts may be added after an Upload is cancelled. + Returns the Upload object with status `cancelled`. + Args: extra_headers: Send extra headers @@ -302,7 +306,9 @@ def complete( The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after - an Upload is completed. + an Upload is completed. Returns the Upload object with status `completed`, + including an additional `file` property containing the created usable File + object. Args: part_ids: The ordered list of Part IDs. @@ -505,6 +511,8 @@ async def create( the documentation on [creating a File](https://platform.openai.com/docs/api-reference/files/create). + Returns the Upload object with status `pending`. + Args: bytes: The number of bytes in the file you are uploading. @@ -564,6 +572,8 @@ async def cancel( No Parts may be added after an Upload is cancelled. + Returns the Upload object with status `cancelled`. + Args: extra_headers: Send extra headers @@ -609,7 +619,9 @@ async def complete( The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after - an Upload is completed. + an Upload is completed. Returns the Upload object with status `completed`, + including an additional `file` property containing the created usable File + object. Args: part_ids: The ordered list of Part IDs. diff --git a/src/openai/resources/videos.py b/src/openai/resources/videos.py index 9f74c942bc..85ea79f8bc 100644 --- a/src/openai/resources/videos.py +++ b/src/openai/resources/videos.py @@ -76,7 +76,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Video: """ - Create a video + Create a new video generation job from a prompt and optional reference assets. Args: prompt: Text prompt that describes the video to generate. @@ -209,7 +209,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Video: """ - Retrieve a video + Fetch the latest metadata for a generated video. Args: extra_headers: Send extra headers @@ -244,7 +244,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncConversationCursorPage[Video]: """ - List videos + List recently generated videos for the current project. Args: after: Identifier for the last item from the previous pagination request @@ -294,7 +294,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VideoDeleteResponse: """ - Delete a video + Permanently delete a completed or failed video and its stored assets. Args: extra_headers: Send extra headers @@ -327,12 +327,13 @@ def download_content( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> _legacy_response.HttpxBinaryResponseContent: - """Download video content + """ + Download the generated video bytes or a derived preview asset. - Args: - variant: Which downloadable asset to return. + Streams the rendered video content for the specified video job. - Defaults to the MP4 video. + Args: + variant: Which downloadable asset to return. Defaults to the MP4 video. extra_headers: Send extra headers @@ -370,7 +371,7 @@ def remix( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Video: """ - Create a video remix + Create a remix of a completed video using a refreshed prompt. Args: prompt: Updated text prompt that directs the remix generation. @@ -431,7 +432,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Video: """ - Create a video + Create a new video generation job from a prompt and optional reference assets. Args: prompt: Text prompt that describes the video to generate. @@ -564,7 +565,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Video: """ - Retrieve a video + Fetch the latest metadata for a generated video. Args: extra_headers: Send extra headers @@ -599,7 +600,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Video, AsyncConversationCursorPage[Video]]: """ - List videos + List recently generated videos for the current project. Args: after: Identifier for the last item from the previous pagination request @@ -649,7 +650,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VideoDeleteResponse: """ - Delete a video + Permanently delete a completed or failed video and its stored assets. Args: extra_headers: Send extra headers @@ -682,12 +683,13 @@ async def download_content( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> _legacy_response.HttpxBinaryResponseContent: - """Download video content + """ + Download the generated video bytes or a derived preview asset. - Args: - variant: Which downloadable asset to return. + Streams the rendered video content for the specified video job. - Defaults to the MP4 video. + Args: + variant: Which downloadable asset to return. Defaults to the MP4 video. extra_headers: Send extra headers @@ -727,7 +729,7 @@ async def remix( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Video: """ - Create a video remix + Create a remix of a completed video using a refreshed prompt. Args: prompt: Updated text prompt that directs the remix generation. From 643300075b7b3288a2d8316b7ecd5084c6b27b26 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 02:54:17 +0000 Subject: [PATCH 2/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0ab1454b8b..88bd7bd561 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 148 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-c20486f46004d6be2d280d7792c64d47fcea3e5b7fbbb50d3ffc6241aba653df.yml -openapi_spec_hash: bf1dbabc5a923d897309273183525c02 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a6dd5f8d7318fb1c5370d5ccb7148bacdfb3f3a665c4b85b7666e6188d9bd909.yml +openapi_spec_hash: c4824e385a81b9021428304ccc96538f config_hash: 948733484caf41e71093c6582dbc319c From 91f4da80ec3dba5d3566961560dfd6feb9c2feb0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:38:04 +0000 Subject: [PATCH 3/7] chore: update mock server docs --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c14e652328..3a1cf70bb8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh From d74bfff62c1c2b32d4dc88fd47ae7b1b2a962017 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 00:06:42 +0000 Subject: [PATCH 4/7] docs(api): update safety_identifier documentation in chat completions and responses --- .stats.yml | 4 +-- .../resources/chat/completions/completions.py | 30 +++++++++++-------- src/openai/resources/responses/responses.py | 30 +++++++++++-------- .../types/chat/completion_create_params.py | 5 ++-- src/openai/types/responses/response.py | 5 ++-- .../types/responses/response_create_params.py | 5 ++-- 6 files changed, 47 insertions(+), 32 deletions(-) diff --git a/.stats.yml b/.stats.yml index 88bd7bd561..af7cf829be 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 148 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a6dd5f8d7318fb1c5370d5ccb7148bacdfb3f3a665c4b85b7666e6188d9bd909.yml -openapi_spec_hash: c4824e385a81b9021428304ccc96538f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0d1a3d48d59d864f24002e6e58a4cf38cb80ba1f4b234f6f766789e2866820c8.yml +openapi_spec_hash: 65fce2adfac759c10dc8bd51e09fa3db config_hash: 948733484caf41e71093c6582dbc319c diff --git a/src/openai/resources/chat/completions/completions.py b/src/openai/resources/chat/completions/completions.py index e1fc531fa9..5d56d05d87 100644 --- a/src/openai/resources/chat/completions/completions.py +++ b/src/openai/resources/chat/completions/completions.py @@ -439,8 +439,9 @@ def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). seed: This feature is in Beta. If specified, our system will make a best effort to @@ -753,8 +754,9 @@ def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). seed: This feature is in Beta. If specified, our system will make a best effort to @@ -1058,8 +1060,9 @@ def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). seed: This feature is in Beta. If specified, our system will make a best effort to @@ -1932,8 +1935,9 @@ async def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). seed: This feature is in Beta. If specified, our system will make a best effort to @@ -2246,8 +2250,9 @@ async def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). seed: This feature is in Beta. If specified, our system will make a best effort to @@ -2551,8 +2556,9 @@ async def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). seed: This feature is in Beta. If specified, our system will make a best effort to diff --git a/src/openai/resources/responses/responses.py b/src/openai/resources/responses/responses.py index 4cb0e35cd3..3e1eb53d88 100644 --- a/src/openai/resources/responses/responses.py +++ b/src/openai/resources/responses/responses.py @@ -238,8 +238,9 @@ def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). service_tier: Specifies the processing type used for serving the request. @@ -493,8 +494,9 @@ def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). service_tier: Specifies the processing type used for serving the request. @@ -741,8 +743,9 @@ def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). service_tier: Specifies the processing type used for serving the request. @@ -1875,8 +1878,9 @@ async def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). service_tier: Specifies the processing type used for serving the request. @@ -2130,8 +2134,9 @@ async def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). service_tier: Specifies the processing type used for serving the request. @@ -2378,8 +2383,9 @@ async def create( safety_identifier: A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). service_tier: Specifies the processing type used for serving the request. diff --git a/src/openai/types/chat/completion_create_params.py b/src/openai/types/chat/completion_create_params.py index 49cefb95fc..8e71ccbe41 100644 --- a/src/openai/types/chat/completion_create_params.py +++ b/src/openai/types/chat/completion_create_params.py @@ -227,8 +227,9 @@ class CompletionCreateParamsBase(TypedDict, total=False): """ A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ diff --git a/src/openai/types/responses/response.py b/src/openai/types/responses/response.py index 6bac7d65de..ada0783bce 100644 --- a/src/openai/types/responses/response.py +++ b/src/openai/types/responses/response.py @@ -233,8 +233,9 @@ class Response(BaseModel): """ A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ diff --git a/src/openai/types/responses/response_create_params.py b/src/openai/types/responses/response_create_params.py index 97aaf9dc3a..0e78d1559b 100644 --- a/src/openai/types/responses/response_create_params.py +++ b/src/openai/types/responses/response_create_params.py @@ -171,8 +171,9 @@ class ResponseCreateParamsBase(TypedDict, total=False): """ A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely - identifies each user. We recommend hashing their username or email address, in - order to avoid sending us any identifying information. + identifies each user, with a maximum length of 64 characters. We recommend + hashing their username or email address, in order to avoid sending us any + identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). """ From 16ae76a20a47f94c91ee2ca0b2ada274633abab3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 22:06:51 +0000 Subject: [PATCH 5/7] docs(api): add batch size limit to file_batches parameter descriptions --- .stats.yml | 4 ++-- src/openai/resources/vector_stores/file_batches.py | 12 ++++++++---- .../types/vector_stores/file_batch_create_params.py | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index af7cf829be..3c69681b59 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 148 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0d1a3d48d59d864f24002e6e58a4cf38cb80ba1f4b234f6f766789e2866820c8.yml -openapi_spec_hash: 65fce2adfac759c10dc8bd51e09fa3db +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-46434d15307c0a84fad213c705ba29ab7342f27aa377e302d506a51cb784613b.yml +openapi_spec_hash: 4a64f88af6142d69d6e01dc9207f232a config_hash: 948733484caf41e71093c6582dbc319c diff --git a/src/openai/resources/vector_stores/file_batches.py b/src/openai/resources/vector_stores/file_batches.py index fca1ef89fa..13ffa66d1a 100644 --- a/src/openai/resources/vector_stores/file_batches.py +++ b/src/openai/resources/vector_stores/file_batches.py @@ -79,12 +79,14 @@ def create( file_ids: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied - to all files in the batch. Mutually exclusive with `files`. + to all files in the batch. The maximum batch size is 2000 files. Mutually + exclusive with `files`. files: A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must - be specified for each file. Mutually exclusive with `file_ids`. + be specified for each file. The maximum batch size is 2000 files. Mutually + exclusive with `file_ids`. extra_headers: Send extra headers @@ -438,12 +440,14 @@ async def create( file_ids: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied - to all files in the batch. Mutually exclusive with `files`. + to all files in the batch. The maximum batch size is 2000 files. Mutually + exclusive with `files`. files: A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must - be specified for each file. Mutually exclusive with `file_ids`. + be specified for each file. The maximum batch size is 2000 files. Mutually + exclusive with `file_ids`. extra_headers: Send extra headers diff --git a/src/openai/types/vector_stores/file_batch_create_params.py b/src/openai/types/vector_stores/file_batch_create_params.py index 2ab98a83ab..7ca0de81da 100644 --- a/src/openai/types/vector_stores/file_batch_create_params.py +++ b/src/openai/types/vector_stores/file_batch_create_params.py @@ -33,7 +33,8 @@ class FileBatchCreateParams(TypedDict, total=False): A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied - to all files in the batch. Mutually exclusive with `files`. + to all files in the batch. The maximum batch size is 2000 files. Mutually + exclusive with `files`. """ files: Iterable[File] @@ -41,7 +42,8 @@ class FileBatchCreateParams(TypedDict, total=False): A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must - be specified for each file. Mutually exclusive with `file_ids`. + be specified for each file. The maximum batch size is 2000 files. Mutually + exclusive with `file_ids`. """ From cdb4315ee29d5260bb373625d74cb523b4e3859c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 13:36:19 +0000 Subject: [PATCH 6/7] chore(internal): add request options to SSE classes --- src/openai/_legacy_response.py | 3 +++ src/openai/_response.py | 3 +++ src/openai/_streaming.py | 11 ++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/openai/_legacy_response.py b/src/openai/_legacy_response.py index cfabaa2fc2..1a58c2dfc3 100644 --- a/src/openai/_legacy_response.py +++ b/src/openai/_legacy_response.py @@ -221,6 +221,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -231,6 +232,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -244,6 +246,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/openai/_response.py b/src/openai/_response.py index 350da38dd4..f286d38e6c 100644 --- a/src/openai/_response.py +++ b/src/openai/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/openai/_streaming.py b/src/openai/_streaming.py index 61a742668a..86b81c324f 100644 --- a/src/openai/_streaming.py +++ b/src/openai/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -14,6 +14,7 @@ if TYPE_CHECKING: from ._client import OpenAI, AsyncOpenAI + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -23,7 +24,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -32,10 +33,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: OpenAI, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -125,7 +128,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -134,10 +137,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncOpenAI, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() From 78eae6b0e745cc67e3e255542e1dc3c7cd842099 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 13:36:57 +0000 Subject: [PATCH 7/7] release: 2.21.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ pyproject.toml | 2 +- src/openai/_version.py | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 49df20d2b8..637e6946c4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.21.0" + ".": "2.21.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f558b3626..10643bc1ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 2.21.1 (2026-02-23) + +Full Changelog: [v2.21.0...v2.21.1](https://github.com/openai/openai-python/compare/v2.21.0...v2.21.1) + +### Chores + +* **internal:** add request options to SSE classes ([cdb4315](https://github.com/openai/openai-python/commit/cdb4315ee29d5260bb373625d74cb523b4e3859c)) +* update mock server docs ([91f4da8](https://github.com/openai/openai-python/commit/91f4da80ec3dba5d3566961560dfd6feb9c2feb0)) + + +### Documentation + +* **api:** add batch size limit to file_batches parameter descriptions ([16ae76a](https://github.com/openai/openai-python/commit/16ae76a20a47f94c91ee2ca0b2ada274633abab3)) +* **api:** enhance method descriptions across audio, chat, realtime, skills, uploads, videos ([21f9e5a](https://github.com/openai/openai-python/commit/21f9e5aaf6ae27f0235fddb3ffa30fe73337f59b)) +* **api:** update safety_identifier documentation in chat completions and responses ([d74bfff](https://github.com/openai/openai-python/commit/d74bfff62c1c2b32d4dc88fd47ae7b1b2a962017)) + ## 2.21.0 (2026-02-13) Full Changelog: [v2.20.0...v2.21.0](https://github.com/openai/openai-python/compare/v2.20.0...v2.21.0) diff --git a/pyproject.toml b/pyproject.toml index fe2e394592..734adc11eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "2.21.0" +version = "2.21.1" 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 0d4ef7b71c..d66d09af75 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.21.0" # x-release-please-version +__version__ = "2.21.1" # x-release-please-version