From 360a4265884862c76ed7c549a3d38a4d2f277398 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:42:34 +0000 Subject: [PATCH 1/5] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2d7e7248c7..3793c0f01b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 137 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fe8e67bdc351a518b113ab48e775750190e207807903d6b03ab22c438c38a588.yml openapi_spec_hash: 8af972190647ffb9dcec516e19d8761a -config_hash: 856bee50ee3617e85a9bc9274db01dbb +config_hash: d013f4fdd4dd59c6f376a9ca482b7f9e From e6d6fd5989d76358ea5d9abb5949aa87646cbef6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 19:18:24 +0000 Subject: [PATCH 2/5] chore(internal): add missing files argument to base client --- src/openai/_base_client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/openai/_base_client.py b/src/openai/_base_client.py index 58490e4430..c0cac43daa 100644 --- a/src/openai/_base_client.py +++ b/src/openai/_base_client.py @@ -1264,9 +1264,12 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1799,9 +1802,12 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return await self.request(cast_to, opts) async def put( From 237c91ee6738b6764b139fd7afa68294d3ee0153 Mon Sep 17 00:00:00 2001 From: cameron-stainless Date: Tue, 16 Dec 2025 10:28:21 -0500 Subject: [PATCH 3/5] chore(ci): add CI job to detect breaking changes with the Agents SDK (#1436) * chore: Add CI job to detect breaking changes with agents lib * chore: Make changes based on PR comments * chore: Add newline after each new step --------- Co-authored-by: Cameron McAteer --- .github/workflows/detect-breaking-changes.yml | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/.github/workflows/detect-breaking-changes.yml b/.github/workflows/detect-breaking-changes.yml index f10fdf3b19..6626d1c376 100644 --- a/.github/workflows/detect-breaking-changes.yml +++ b/.github/workflows/detect-breaking-changes.yml @@ -39,4 +39,52 @@ jobs: # Try to check out previous versions of the breaking change detection script. This ensures that # we still detect breaking changes when entire files and their tests are removed. git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true - ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }} \ No newline at end of file + ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }} + + agents_sdk: + runs-on: 'ubuntu-latest' + name: Detect Agents SDK regressions + if: github.repository == 'openai/openai-python' + steps: + # Setup this sdk + - uses: actions/checkout@v4 + with: + path: openai-python + + - name: Install Rye + working-directory: openai-python + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Install dependencies + working-directory: openai-python + run: | + rye sync --all-features + + # Setup the agents lib + - uses: actions/checkout@v4 + with: + repository: openai/openai-agents-python + path: openai-agents-python + + - name: Setup uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Link to local SDK + working-directory: openai-agents-python + run: uv add ../openai-python + + - name: Install dependencies + working-directory: openai-agents-python + run: make sync + + - name: Run integration type checks + working-directory: openai-agents-python + run: make mypy + From 1c88f03bb48aa67426744e5b74f6197f30f61c73 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 18:13:42 +0000 Subject: [PATCH 4/5] feat(api): gpt-image-1.5 --- .stats.yml | 4 +- src/openai/resources/images.py | 432 +++++++++--------- src/openai/types/image.py | 8 +- .../types/image_edit_completed_event.py | 9 +- src/openai/types/image_edit_params.py | 31 +- src/openai/types/image_gen_completed_event.py | 9 +- src/openai/types/image_generate_params.py | 40 +- src/openai/types/image_model.py | 2 +- src/openai/types/images_response.py | 15 +- src/openai/types/responses/tool.py | 4 +- src/openai/types/responses/tool_param.py | 4 +- 11 files changed, 298 insertions(+), 260 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3793c0f01b..d9366ce3b3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 137 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fe8e67bdc351a518b113ab48e775750190e207807903d6b03ab22c438c38a588.yml -openapi_spec_hash: 8af972190647ffb9dcec516e19d8761a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-cded37ac004364c2110ebdacf922ef611b3c51258790c72ca479dcfad4df66aa.yml +openapi_spec_hash: 6e615d34cf8c6bc76e0c6933fc8569af config_hash: d013f4fdd4dd59c6f376a9ca482b7f9e diff --git a/src/openai/resources/images.py b/src/openai/resources/images.py index 265be6f743..79505a8269 100644 --- a/src/openai/resources/images.py +++ b/src/openai/resources/images.py @@ -151,19 +151,20 @@ def edit( Args: image: The image(s) to edit. Must be a supported image file or an array of images. - For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and + `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. prompt: A text description of the desired image(s). The maximum length is 1000 - characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. + characters for `dall-e-2`, and 32000 characters for the GPT image models. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. @@ -178,18 +179,18 @@ def edit( the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - model: The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are - supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` - is used. + model: The model to use for image generation. Only `dall-e-2` and the GPT image models + are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT + image models is used. n: The number of images to generate. Must be between 1 and 10. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. The + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. partial_images: The number of partial images to generate. This parameter is used for streaming @@ -200,17 +201,17 @@ def edit( are generated if the full image is generated more quickly. quality: The quality of the image that will be generated. `high`, `medium` and `low` are - only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. - Defaults to `auto`. + only supported for the GPT image models. `dall-e-2` only supports `standard` + quality. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been - generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` - will always return base64-encoded images. + generated. This parameter is only supported for `dall-e-2`, as the GPT image + models always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. stream: Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) @@ -264,23 +265,24 @@ def edit( Args: image: The image(s) to edit. Must be a supported image file or an array of images. - For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and + `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. prompt: A text description of the desired image(s). The maximum length is 1000 - characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. + characters for `dall-e-2`, and 32000 characters for the GPT image models. stream: Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. @@ -295,18 +297,18 @@ def edit( the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - model: The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are - supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` - is used. + model: The model to use for image generation. Only `dall-e-2` and the GPT image models + are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT + image models is used. n: The number of images to generate. Must be between 1 and 10. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. The + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. partial_images: The number of partial images to generate. This parameter is used for streaming @@ -317,17 +319,17 @@ def edit( are generated if the full image is generated more quickly. quality: The quality of the image that will be generated. `high`, `medium` and `low` are - only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. - Defaults to `auto`. + only supported for the GPT image models. `dall-e-2` only supports `standard` + quality. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been - generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` - will always return base64-encoded images. + generated. This parameter is only supported for `dall-e-2`, as the GPT image + models always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. @@ -377,23 +379,24 @@ def edit( Args: image: The image(s) to edit. Must be a supported image file or an array of images. - For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and + `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. prompt: A text description of the desired image(s). The maximum length is 1000 - characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. + characters for `dall-e-2`, and 32000 characters for the GPT image models. stream: Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. @@ -408,18 +411,18 @@ def edit( the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - model: The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are - supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` - is used. + model: The model to use for image generation. Only `dall-e-2` and the GPT image models + are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT + image models is used. n: The number of images to generate. Must be between 1 and 10. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. The + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. partial_images: The number of partial images to generate. This parameter is used for streaming @@ -430,17 +433,17 @@ def edit( are generated if the full image is generated more quickly. quality: The quality of the image that will be generated. `high`, `medium` and `low` are - only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. - Defaults to `auto`. + only supported for the GPT image models. `dall-e-2` only supports `standard` + quality. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been - generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` - will always return base64-encoded images. + generated. This parameter is only supported for `dall-e-2`, as the GPT image + models always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. @@ -555,33 +558,34 @@ def generate( Args: prompt: A text description of the desired image(s). The maximum length is 32000 - characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters - for `dall-e-3`. + characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 + characters for `dall-e-3`. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. - model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or - `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to - `gpt-image-1` is used. + model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT + image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to + `dall-e-2` unless a parameter specific to the GPT image models is used. - moderation: Control the content-moderation level for images generated by `gpt-image-1`. Must - be either `low` for less restrictive filtering or `auto` (default value). + moderation: Control the content-moderation level for images generated by the GPT image + models. Must be either `low` for less restrictive filtering or `auto` (default + value). n: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. partial_images: The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to @@ -594,23 +598,23 @@ def generate( - `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for `gpt-image-1`. + - `high`, `medium` and `low` are supported for the GPT image models. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. response_format: The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes - after the image has been generated. This parameter isn't supported for - `gpt-image-1` which will always return base64-encoded images. + after the image has been generated. This parameter isn't supported for the GPT + image models, which always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and - one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of + `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. stream: Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) - for more information. This parameter is only supported for `gpt-image-1`. + for more information. This parameter is only supported for the GPT image models. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -665,37 +669,38 @@ def generate( Args: prompt: A text description of the desired image(s). The maximum length is 32000 - characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters - for `dall-e-3`. + characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 + characters for `dall-e-3`. stream: Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) - for more information. This parameter is only supported for `gpt-image-1`. + for more information. This parameter is only supported for the GPT image models. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. - model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or - `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to - `gpt-image-1` is used. + model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT + image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to + `dall-e-2` unless a parameter specific to the GPT image models is used. - moderation: Control the content-moderation level for images generated by `gpt-image-1`. Must - be either `low` for less restrictive filtering or `auto` (default value). + moderation: Control the content-moderation level for images generated by the GPT image + models. Must be either `low` for less restrictive filtering or `auto` (default + value). n: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. partial_images: The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to @@ -708,19 +713,19 @@ def generate( - `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for `gpt-image-1`. + - `high`, `medium` and `low` are supported for the GPT image models. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. response_format: The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes - after the image has been generated. This parameter isn't supported for - `gpt-image-1` which will always return base64-encoded images. + after the image has been generated. This parameter isn't supported for the GPT + image models, which always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and - one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of + `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -775,37 +780,38 @@ def generate( Args: prompt: A text description of the desired image(s). The maximum length is 32000 - characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters - for `dall-e-3`. + characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 + characters for `dall-e-3`. stream: Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) - for more information. This parameter is only supported for `gpt-image-1`. + for more information. This parameter is only supported for the GPT image models. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. - model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or - `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to - `gpt-image-1` is used. + model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT + image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to + `dall-e-2` unless a parameter specific to the GPT image models is used. - moderation: Control the content-moderation level for images generated by `gpt-image-1`. Must - be either `low` for less restrictive filtering or `auto` (default value). + moderation: Control the content-moderation level for images generated by the GPT image + models. Must be either `low` for less restrictive filtering or `auto` (default + value). n: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. partial_images: The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to @@ -818,19 +824,19 @@ def generate( - `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for `gpt-image-1`. + - `high`, `medium` and `low` are supported for the GPT image models. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. response_format: The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes - after the image has been generated. This parameter isn't supported for - `gpt-image-1` which will always return base64-encoded images. + after the image has been generated. This parameter isn't supported for the GPT + image models, which always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and - one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of + `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -1038,19 +1044,20 @@ async def edit( Args: image: The image(s) to edit. Must be a supported image file or an array of images. - For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and + `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. prompt: A text description of the desired image(s). The maximum length is 1000 - characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. + characters for `dall-e-2`, and 32000 characters for the GPT image models. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. @@ -1065,18 +1072,18 @@ async def edit( the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - model: The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are - supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` - is used. + model: The model to use for image generation. Only `dall-e-2` and the GPT image models + are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT + image models is used. n: The number of images to generate. Must be between 1 and 10. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. The + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. partial_images: The number of partial images to generate. This parameter is used for streaming @@ -1087,17 +1094,17 @@ async def edit( are generated if the full image is generated more quickly. quality: The quality of the image that will be generated. `high`, `medium` and `low` are - only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. - Defaults to `auto`. + only supported for the GPT image models. `dall-e-2` only supports `standard` + quality. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been - generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` - will always return base64-encoded images. + generated. This parameter is only supported for `dall-e-2`, as the GPT image + models always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. stream: Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) @@ -1151,23 +1158,24 @@ async def edit( Args: image: The image(s) to edit. Must be a supported image file or an array of images. - For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and + `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. prompt: A text description of the desired image(s). The maximum length is 1000 - characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. + characters for `dall-e-2`, and 32000 characters for the GPT image models. stream: Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. @@ -1182,18 +1190,18 @@ async def edit( the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - model: The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are - supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` - is used. + model: The model to use for image generation. Only `dall-e-2` and the GPT image models + are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT + image models is used. n: The number of images to generate. Must be between 1 and 10. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. The + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. partial_images: The number of partial images to generate. This parameter is used for streaming @@ -1204,17 +1212,17 @@ async def edit( are generated if the full image is generated more quickly. quality: The quality of the image that will be generated. `high`, `medium` and `low` are - only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. - Defaults to `auto`. + only supported for the GPT image models. `dall-e-2` only supports `standard` + quality. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been - generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` - will always return base64-encoded images. + generated. This parameter is only supported for `dall-e-2`, as the GPT image + models always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. @@ -1264,23 +1272,24 @@ async def edit( Args: image: The image(s) to edit. Must be a supported image file or an array of images. - For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and + `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For `dall-e-2`, you can only provide one image, and it should be a square `png` file less than 4MB. prompt: A text description of the desired image(s). The maximum length is 1000 - characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. + characters for `dall-e-2`, and 32000 characters for the GPT image models. stream: Edit the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. @@ -1295,18 +1304,18 @@ async def edit( the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. - model: The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are - supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` - is used. + model: The model to use for image generation. Only `dall-e-2` and the GPT image models + are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT + image models is used. n: The number of images to generate. Must be between 1 and 10. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. The + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. partial_images: The number of partial images to generate. This parameter is used for streaming @@ -1317,17 +1326,17 @@ async def edit( are generated if the full image is generated more quickly. quality: The quality of the image that will be generated. `high`, `medium` and `low` are - only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. - Defaults to `auto`. + only supported for the GPT image models. `dall-e-2` only supports `standard` + quality. Defaults to `auto`. response_format: The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been - generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` - will always return base64-encoded images. + generated. This parameter is only supported for `dall-e-2`, as the GPT image + models always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. user: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. @@ -1442,33 +1451,34 @@ async def generate( Args: prompt: A text description of the desired image(s). The maximum length is 32000 - characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters - for `dall-e-3`. + characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 + characters for `dall-e-3`. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. - model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or - `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to - `gpt-image-1` is used. + model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT + image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to + `dall-e-2` unless a parameter specific to the GPT image models is used. - moderation: Control the content-moderation level for images generated by `gpt-image-1`. Must - be either `low` for less restrictive filtering or `auto` (default value). + moderation: Control the content-moderation level for images generated by the GPT image + models. Must be either `low` for less restrictive filtering or `auto` (default + value). n: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. partial_images: The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to @@ -1481,23 +1491,23 @@ async def generate( - `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for `gpt-image-1`. + - `high`, `medium` and `low` are supported for the GPT image models. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. response_format: The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes - after the image has been generated. This parameter isn't supported for - `gpt-image-1` which will always return base64-encoded images. + after the image has been generated. This parameter isn't supported for the GPT + image models, which always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and - one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of + `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. stream: Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) - for more information. This parameter is only supported for `gpt-image-1`. + for more information. This parameter is only supported for the GPT image models. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -1552,37 +1562,38 @@ async def generate( Args: prompt: A text description of the desired image(s). The maximum length is 32000 - characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters - for `dall-e-3`. + characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 + characters for `dall-e-3`. stream: Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) - for more information. This parameter is only supported for `gpt-image-1`. + for more information. This parameter is only supported for the GPT image models. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. - model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or - `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to - `gpt-image-1` is used. + model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT + image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to + `dall-e-2` unless a parameter specific to the GPT image models is used. - moderation: Control the content-moderation level for images generated by `gpt-image-1`. Must - be either `low` for less restrictive filtering or `auto` (default value). + moderation: Control the content-moderation level for images generated by the GPT image + models. Must be either `low` for less restrictive filtering or `auto` (default + value). n: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. partial_images: The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to @@ -1595,19 +1606,19 @@ async def generate( - `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for `gpt-image-1`. + - `high`, `medium` and `low` are supported for the GPT image models. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. response_format: The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes - after the image has been generated. This parameter isn't supported for - `gpt-image-1` which will always return base64-encoded images. + after the image has been generated. This parameter isn't supported for the GPT + image models, which always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and - one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of + `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean @@ -1662,37 +1673,38 @@ async def generate( Args: prompt: A text description of the desired image(s). The maximum length is 32000 - characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters - for `dall-e-3`. + characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 + characters for `dall-e-3`. stream: Generate the image in streaming mode. Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) - for more information. This parameter is only supported for `gpt-image-1`. + for more information. This parameter is only supported for the GPT image models. background: Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. - model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or - `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to - `gpt-image-1` is used. + model: The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT + image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to + `dall-e-2` unless a parameter specific to the GPT image models is used. - moderation: Control the content-moderation level for images generated by `gpt-image-1`. Must - be either `low` for less restrictive filtering or `auto` (default value). + moderation: Control the content-moderation level for images generated by the GPT image + models. Must be either `low` for less restrictive filtering or `auto` (default + value). n: The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. output_compression: The compression level (0-100%) for the generated images. This parameter is only - supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and + supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100. output_format: The format in which the generated images are returned. This parameter is only - supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. partial_images: The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to @@ -1705,19 +1717,19 @@ async def generate( - `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for `gpt-image-1`. + - `high`, `medium` and `low` are supported for the GPT image models. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. response_format: The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes - after the image has been generated. This parameter isn't supported for - `gpt-image-1` which will always return base64-encoded images. + after the image has been generated. This parameter isn't supported for the GPT + image models, which always return base64-encoded images. size: The size of the generated images. Must be one of `1024x1024`, `1536x1024` - (landscape), `1024x1536` (portrait), or `auto` (default value) for - `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and - one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. + (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image + models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of + `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. style: The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean diff --git a/src/openai/types/image.py b/src/openai/types/image.py index 9e2a23fa40..dcbdb2aceb 100644 --- a/src/openai/types/image.py +++ b/src/openai/types/image.py @@ -13,8 +13,8 @@ class Image(BaseModel): b64_json: Optional[str] = None """The base64-encoded JSON of the generated image. - Default value for `gpt-image-1`, and only present if `response_format` is set to - `b64_json` for `dall-e-2` and `dall-e-3`. + Returned by default for the GPT image models, and only present if + `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`. """ revised_prompt: Optional[str] = None @@ -23,6 +23,6 @@ class Image(BaseModel): url: Optional[str] = None """ When using `dall-e-2` or `dall-e-3`, the URL of the generated image if - `response_format` is set to `url` (default value). Unsupported for - `gpt-image-1`. + `response_format` is set to `url` (default value). Unsupported for the GPT image + models. """ diff --git a/src/openai/types/image_edit_completed_event.py b/src/openai/types/image_edit_completed_event.py index 5bd2986d2a..e2e193413f 100644 --- a/src/openai/types/image_edit_completed_event.py +++ b/src/openai/types/image_edit_completed_event.py @@ -18,7 +18,9 @@ class UsageInputTokensDetails(BaseModel): class Usage(BaseModel): - """For `gpt-image-1` only, the token usage information for the image generation.""" + """ + For the GPT image models only, the token usage information for the image generation. + """ input_tokens: int """The number of tokens (images and text) in the input prompt.""" @@ -58,4 +60,7 @@ class ImageEditCompletedEvent(BaseModel): """The type of the event. Always `image_edit.completed`.""" usage: Usage - """For `gpt-image-1` only, the token usage information for the image generation.""" + """ + For the GPT image models only, the token usage information for the image + generation. + """ diff --git a/src/openai/types/image_edit_params.py b/src/openai/types/image_edit_params.py index 2a8fab0f20..0bd5f39fac 100644 --- a/src/openai/types/image_edit_params.py +++ b/src/openai/types/image_edit_params.py @@ -15,7 +15,8 @@ class ImageEditParamsBase(TypedDict, total=False): image: Required[Union[FileTypes, SequenceNotStr[FileTypes]]] """The image(s) to edit. Must be a supported image file or an array of images. - For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less than + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and + `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16 images. For `dall-e-2`, you can only provide one image, and it should be a square `png` @@ -26,15 +27,15 @@ class ImageEditParamsBase(TypedDict, total=False): """A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for - `gpt-image-1`. + the GPT image models. """ background: Optional[Literal["transparent", "opaque", "auto"]] """ Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. @@ -59,8 +60,8 @@ class ImageEditParamsBase(TypedDict, total=False): model: Union[str, ImageModel, None] """The model to use for image generation. - Only `dall-e-2` and `gpt-image-1` are supported. Defaults to `dall-e-2` unless a - parameter specific to `gpt-image-1` is used. + Only `dall-e-2` and the GPT image models are supported. Defaults to `dall-e-2` + unless a parameter specific to the GPT image models is used. """ n: Optional[int] @@ -69,14 +70,14 @@ class ImageEditParamsBase(TypedDict, total=False): output_compression: Optional[int] """The compression level (0-100%) for the generated images. - This parameter is only supported for `gpt-image-1` with the `webp` or `jpeg` - output formats, and defaults to 100. + This parameter is only supported for the GPT image models with the `webp` or + `jpeg` output formats, and defaults to 100. """ output_format: Optional[Literal["png", "jpeg", "webp"]] """The format in which the generated images are returned. - This parameter is only supported for `gpt-image-1`. Must be one of `png`, + This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. The default value is `png`. """ @@ -94,8 +95,8 @@ class ImageEditParamsBase(TypedDict, total=False): quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] """The quality of the image that will be generated. - `high`, `medium` and `low` are only supported for `gpt-image-1`. `dall-e-2` only - supports `standard` quality. Defaults to `auto`. + `high`, `medium` and `low` are only supported for the GPT image models. + `dall-e-2` only supports `standard` quality. Defaults to `auto`. """ response_format: Optional[Literal["url", "b64_json"]] @@ -103,15 +104,15 @@ class ImageEditParamsBase(TypedDict, total=False): Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2`, as - `gpt-image-1` will always return base64-encoded images. + the GPT image models always return base64-encoded images. """ size: Optional[Literal["256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto"]] """The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or - `auto` (default value) for `gpt-image-1`, and one of `256x256`, `512x512`, or - `1024x1024` for `dall-e-2`. + `auto` (default value) for the GPT image models, and one of `256x256`, + `512x512`, or `1024x1024` for `dall-e-2`. """ user: str diff --git a/src/openai/types/image_gen_completed_event.py b/src/openai/types/image_gen_completed_event.py index dc9ccb8cfc..813ed889d8 100644 --- a/src/openai/types/image_gen_completed_event.py +++ b/src/openai/types/image_gen_completed_event.py @@ -18,7 +18,9 @@ class UsageInputTokensDetails(BaseModel): class Usage(BaseModel): - """For `gpt-image-1` only, the token usage information for the image generation.""" + """ + For the GPT image models only, the token usage information for the image generation. + """ input_tokens: int """The number of tokens (images and text) in the input prompt.""" @@ -58,4 +60,7 @@ class ImageGenCompletedEvent(BaseModel): """The type of the event. Always `image_generation.completed`.""" usage: Usage - """For `gpt-image-1` only, the token usage information for the image generation.""" + """ + For the GPT image models only, the token usage information for the image + generation. + """ diff --git a/src/openai/types/image_generate_params.py b/src/openai/types/image_generate_params.py index 3270ca1d6e..7a95b3dd3d 100644 --- a/src/openai/types/image_generate_params.py +++ b/src/openai/types/image_generate_params.py @@ -14,16 +14,16 @@ class ImageGenerateParamsBase(TypedDict, total=False): prompt: Required[str] """A text description of the desired image(s). - The maximum length is 32000 characters for `gpt-image-1`, 1000 characters for - `dall-e-2` and 4000 characters for `dall-e-3`. + The maximum length is 32000 characters for the GPT image models, 1000 characters + for `dall-e-2` and 4000 characters for `dall-e-3`. """ background: Optional[Literal["transparent", "opaque", "auto"]] """ Allows to set transparency for the background of the generated image(s). This - parameter is only supported for `gpt-image-1`. Must be one of `transparent`, - `opaque` or `auto` (default value). When `auto` is used, the model will - automatically determine the best background for the image. + parameter is only supported for the GPT image models. Must be one of + `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + model will automatically determine the best background for the image. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`. @@ -32,14 +32,16 @@ class ImageGenerateParamsBase(TypedDict, total=False): model: Union[str, ImageModel, None] """The model to use for image generation. - One of `dall-e-2`, `dall-e-3`, or `gpt-image-1`. Defaults to `dall-e-2` unless a - parameter specific to `gpt-image-1` is used. + One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, + `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to `dall-e-2` unless a parameter + specific to the GPT image models is used. """ moderation: Optional[Literal["low", "auto"]] - """Control the content-moderation level for images generated by `gpt-image-1`. - - Must be either `low` for less restrictive filtering or `auto` (default value). + """ + Control the content-moderation level for images generated by the GPT image + models. Must be either `low` for less restrictive filtering or `auto` (default + value). """ n: Optional[int] @@ -51,14 +53,14 @@ class ImageGenerateParamsBase(TypedDict, total=False): output_compression: Optional[int] """The compression level (0-100%) for the generated images. - This parameter is only supported for `gpt-image-1` with the `webp` or `jpeg` - output formats, and defaults to 100. + This parameter is only supported for the GPT image models with the `webp` or + `jpeg` output formats, and defaults to 100. """ output_format: Optional[Literal["png", "jpeg", "webp"]] """The format in which the generated images are returned. - This parameter is only supported for `gpt-image-1`. Must be one of `png`, + This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`. """ @@ -78,7 +80,7 @@ class ImageGenerateParamsBase(TypedDict, total=False): - `auto` (default value) will automatically select the best quality for the given model. - - `high`, `medium` and `low` are supported for `gpt-image-1`. + - `high`, `medium` and `low` are supported for the GPT image models. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. """ @@ -88,8 +90,8 @@ class ImageGenerateParamsBase(TypedDict, total=False): returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the - image has been generated. This parameter isn't supported for `gpt-image-1` which - will always return base64-encoded images. + image has been generated. This parameter isn't supported for the GPT image + models, which always return base64-encoded images. """ size: Optional[ @@ -98,7 +100,7 @@ class ImageGenerateParamsBase(TypedDict, total=False): """The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or - `auto` (default value) for `gpt-image-1`, one of `256x256`, `512x512`, or + `auto` (default value) for the GPT image models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. """ @@ -126,7 +128,7 @@ class ImageGenerateParamsNonStreaming(ImageGenerateParamsBase, total=False): Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) - for more information. This parameter is only supported for `gpt-image-1`. + for more information. This parameter is only supported for the GPT image models. """ @@ -136,7 +138,7 @@ class ImageGenerateParamsStreaming(ImageGenerateParamsBase): Defaults to `false`. See the [Image generation guide](https://platform.openai.com/docs/guides/image-generation) - for more information. This parameter is only supported for `gpt-image-1`. + for more information. This parameter is only supported for the GPT image models. """ diff --git a/src/openai/types/image_model.py b/src/openai/types/image_model.py index 22b1281fa9..8ea486fbb6 100644 --- a/src/openai/types/image_model.py +++ b/src/openai/types/image_model.py @@ -4,4 +4,4 @@ __all__ = ["ImageModel"] -ImageModel: TypeAlias = Literal["dall-e-2", "dall-e-3", "gpt-image-1", "gpt-image-1-mini"] +ImageModel: TypeAlias = Literal["gpt-image-1.5", "dall-e-2", "dall-e-3", "gpt-image-1", "gpt-image-1-mini"] diff --git a/src/openai/types/images_response.py b/src/openai/types/images_response.py index 914017823e..3e832aadf2 100644 --- a/src/openai/types/images_response.py +++ b/src/openai/types/images_response.py @@ -6,7 +6,7 @@ from .image import Image from .._models import BaseModel -__all__ = ["ImagesResponse", "Usage", "UsageInputTokensDetails"] +__all__ = ["ImagesResponse", "Usage", "UsageInputTokensDetails", "UsageOutputTokensDetails"] class UsageInputTokensDetails(BaseModel): @@ -19,6 +19,16 @@ class UsageInputTokensDetails(BaseModel): """The number of text tokens in the input prompt.""" +class UsageOutputTokensDetails(BaseModel): + """The output token details for the image generation.""" + + image_tokens: int + """The number of image output tokens generated by the model.""" + + text_tokens: int + """The number of text output tokens generated by the model.""" + + class Usage(BaseModel): """For `gpt-image-1` only, the token usage information for the image generation.""" @@ -34,6 +44,9 @@ class Usage(BaseModel): total_tokens: int """The total number of tokens (images and text) used for the image generation.""" + output_tokens_details: Optional[UsageOutputTokensDetails] = None + """The output token details for the image generation.""" + class ImagesResponse(BaseModel): """The response from the image generation endpoint.""" diff --git a/src/openai/types/responses/tool.py b/src/openai/types/responses/tool.py index 1f1ef12358..20f50e4478 100644 --- a/src/openai/types/responses/tool.py +++ b/src/openai/types/responses/tool.py @@ -221,7 +221,7 @@ class ImageGenerationInputImageMask(BaseModel): class ImageGeneration(BaseModel): - """A tool that generates images using a model like `gpt-image-1`.""" + """A tool that generates images using the GPT image models.""" type: Literal["image_generation"] """The type of the image generation tool. Always `image_generation`.""" @@ -246,7 +246,7 @@ class ImageGeneration(BaseModel): Contains `image_url` (string, optional) and `file_id` (string, optional). """ - model: Optional[Literal["gpt-image-1", "gpt-image-1-mini"]] = None + model: Union[str, Literal["gpt-image-1", "gpt-image-1-mini"], None] = None """The image generation model to use. Default: `gpt-image-1`.""" moderation: Optional[Literal["auto", "low"]] = None diff --git a/src/openai/types/responses/tool_param.py b/src/openai/types/responses/tool_param.py index c6ffa39192..69c6162153 100644 --- a/src/openai/types/responses/tool_param.py +++ b/src/openai/types/responses/tool_param.py @@ -221,7 +221,7 @@ class ImageGenerationInputImageMask(TypedDict, total=False): class ImageGeneration(TypedDict, total=False): - """A tool that generates images using a model like `gpt-image-1`.""" + """A tool that generates images using the GPT image models.""" type: Required[Literal["image_generation"]] """The type of the image generation tool. Always `image_generation`.""" @@ -246,7 +246,7 @@ class ImageGeneration(TypedDict, total=False): Contains `image_url` (string, optional) and `file_id` (string, optional). """ - model: Literal["gpt-image-1", "gpt-image-1-mini"] + model: Union[str, Literal["gpt-image-1", "gpt-image-1-mini"]] """The image generation model to use. Default: `gpt-image-1`.""" moderation: Literal["auto", "low"] From a5c92af9adc01bba5918083733d4c3fed677c370 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 18:14:52 +0000 Subject: [PATCH 5/5] release: 2.13.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ pyproject.toml | 2 +- src/openai/_version.py | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0746cbe20a..e6eadb43e0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.12.0" + ".": "2.13.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ec61efaf79..745512f15d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 2.13.0 (2025-12-16) + +Full Changelog: [v2.12.0...v2.13.0](https://github.com/openai/openai-python/compare/v2.12.0...v2.13.0) + +### Features + +* **api:** gpt-image-1.5 ([1c88f03](https://github.com/openai/openai-python/commit/1c88f03bb48aa67426744e5b74f6197f30f61c73)) + + +### Chores + +* **ci:** add CI job to detect breaking changes with the Agents SDK ([#1436](https://github.com/openai/openai-python/issues/1436)) ([237c91e](https://github.com/openai/openai-python/commit/237c91ee6738b6764b139fd7afa68294d3ee0153)) +* **internal:** add missing files argument to base client ([e6d6fd5](https://github.com/openai/openai-python/commit/e6d6fd5989d76358ea5d9abb5949aa87646cbef6)) + ## 2.12.0 (2025-12-15) Full Changelog: [v2.11.0...v2.12.0](https://github.com/openai/openai-python/compare/v2.11.0...v2.12.0) diff --git a/pyproject.toml b/pyproject.toml index 7d6fec5c1a..f9dd23592a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "2.12.0" +version = "2.13.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 9d853d6512..dfda2f0522 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.12.0" # x-release-please-version +__version__ = "2.13.0" # x-release-please-version