From 28edb6e1b7eb30dbb7be49979cee7882e8889264 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:51:12 +0000 Subject: [PATCH 1/2] feat(api): support for images in batch api --- .stats.yml | 4 ++-- src/openai/resources/batches.py | 28 ++++++++++++++++++------- src/openai/types/batch_create_params.py | 17 +++++++++++---- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index e91271a6c8..6c725eaa30 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-7debfce2217c66ea87bfddaa244b57de4062dd7fd766fa9a28e869614205c040.yml -openapi_spec_hash: e910fc478b8449134e2af1dc15fd33f7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-47ef7e0aaa2f2052404041650c9b4d7d8c9c51c45ef2cb081548f329c3f81a6a.yml +openapi_spec_hash: 0207b30cf74121a12c1647e25463cee9 config_hash: 8dca0f2dc2706c07cf2f8d0ed4dc062e diff --git a/src/openai/resources/batches.py b/src/openai/resources/batches.py index 80400839e4..bc856bf5aa 100644 --- a/src/openai/resources/batches.py +++ b/src/openai/resources/batches.py @@ -47,7 +47,13 @@ def create( *, completion_window: Literal["24h"], endpoint: Literal[ - "/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions", "/v1/moderations" + "/v1/responses", + "/v1/chat/completions", + "/v1/embeddings", + "/v1/completions", + "/v1/moderations", + "/v1/images/generations", + "/v1/images/edits", ], input_file_id: str, metadata: Optional[Metadata] | Omit = omit, @@ -68,9 +74,9 @@ def create( endpoint: The endpoint to be used for all requests in the batch. Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/completions`, - and `/v1/moderations` are supported. Note that `/v1/embeddings` batches are also - restricted to a maximum of 50,000 embedding inputs across all requests in the - batch. + `/v1/moderations`, `/v1/images/generations`, and `/v1/images/edits` are + supported. Note that `/v1/embeddings` batches are also restricted to a maximum + of 50,000 embedding inputs across all requests in the batch. input_file_id: The ID of an uploaded file that contains requests for the new batch. @@ -265,7 +271,13 @@ async def create( *, completion_window: Literal["24h"], endpoint: Literal[ - "/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions", "/v1/moderations" + "/v1/responses", + "/v1/chat/completions", + "/v1/embeddings", + "/v1/completions", + "/v1/moderations", + "/v1/images/generations", + "/v1/images/edits", ], input_file_id: str, metadata: Optional[Metadata] | Omit = omit, @@ -286,9 +298,9 @@ async def create( endpoint: The endpoint to be used for all requests in the batch. Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/completions`, - and `/v1/moderations` are supported. Note that `/v1/embeddings` batches are also - restricted to a maximum of 50,000 embedding inputs across all requests in the - batch. + `/v1/moderations`, `/v1/images/generations`, and `/v1/images/edits` are + supported. Note that `/v1/embeddings` batches are also restricted to a maximum + of 50,000 embedding inputs across all requests in the batch. input_file_id: The ID of an uploaded file that contains requests for the new batch. diff --git a/src/openai/types/batch_create_params.py b/src/openai/types/batch_create_params.py index 1088aab380..1bcd48aace 100644 --- a/src/openai/types/batch_create_params.py +++ b/src/openai/types/batch_create_params.py @@ -18,14 +18,23 @@ class BatchCreateParams(TypedDict, total=False): """ endpoint: Required[ - Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions", "/v1/moderations"] + Literal[ + "/v1/responses", + "/v1/chat/completions", + "/v1/embeddings", + "/v1/completions", + "/v1/moderations", + "/v1/images/generations", + "/v1/images/edits", + ] ] """The endpoint to be used for all requests in the batch. Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, - `/v1/completions`, and `/v1/moderations` are supported. Note that - `/v1/embeddings` batches are also restricted to a maximum of 50,000 embedding - inputs across all requests in the batch. + `/v1/completions`, `/v1/moderations`, `/v1/images/generations`, and + `/v1/images/edits` are supported. Note that `/v1/embeddings` batches are also + restricted to a maximum of 50,000 embedding inputs across all requests in the + batch. """ input_file_id: Required[str] From 7790930cdee2a18dab219860a85209c4b8b9075a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 18:51:50 +0000 Subject: [PATCH 2/2] release: 2.20.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/openai/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 60b44f4d33..26b25a25e8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.19.0" + ".": "2.20.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index be67fc97c9..39ed325e8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.20.0 (2026-02-10) + +Full Changelog: [v2.19.0...v2.20.0](https://github.com/openai/openai-python/compare/v2.19.0...v2.20.0) + +### Features + +* **api:** support for images in batch api ([28edb6e](https://github.com/openai/openai-python/commit/28edb6e1b7eb30dbb7be49979cee7882e8889264)) + ## 2.19.0 (2026-02-10) Full Changelog: [v2.18.0...v2.19.0](https://github.com/openai/openai-python/compare/v2.18.0...v2.19.0) diff --git a/pyproject.toml b/pyproject.toml index c7821a9df4..326c715f08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "2.19.0" +version = "2.20.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 a0c43abd1d..4987d1ca18 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.19.0" # x-release-please-version +__version__ = "2.20.0" # x-release-please-version