From 41aaea25fa28dccad2aa70417e1789d9499ec7a7 Mon Sep 17 00:00:00 2001 From: marcuswood-oai <323319819+marcuswood-oai@users.noreply.github.com> Date: Tue, 8 Sep 2026 15:41:50 -0700 Subject: [PATCH] feat(api): add GPT Image 2.5 models and image options Castiron-Internal-PR: https://github.com/openai/openai-ruby-internal/pull/79 Castiron-Source-SHA: 8c1a240bc67a5bdf143d774f738f2d1169b702f0 Castiron-Public-Base-SHA: 4d05097f10408452aaf0efa48c499bada62846bb --- .castiron.stats.yml | 14 +- api_reference/openapi.transformed.yml | 322 ++++++++++++------ .../models/beta/beta_response_input_item.rb | 85 ++++- lib/openai/models/beta/beta_response_item.rb | 73 +++- .../models/beta/beta_response_output_item.rb | 85 ++++- .../beta/beta_responses_client_event.rb | 3 + lib/openai/models/beta/beta_tool.rb | 106 ++++-- .../models/beta/response_create_params.rb | 3 + .../models/conversations/conversation_item.rb | 83 ++++- .../models/image_edit_completed_event.rb | 42 ++- lib/openai/models/image_edit_params.rb | 108 +++--- .../models/image_edit_partial_image_event.rb | 42 ++- .../models/image_gen_completed_event.rb | 42 ++- .../models/image_gen_partial_image_event.rb | 42 ++- lib/openai/models/image_generate_params.rb | 86 +++-- lib/openai/models/image_model.rb | 4 + lib/openai/models/images_response.rb | 50 ++- .../responses/response_create_params.rb | 3 + .../models/responses/response_input_item.rb | 85 ++++- lib/openai/models/responses/response_item.rb | 73 +++- .../models/responses/response_output_item.rb | 85 ++++- .../responses/responses_client_event.rb | 3 + lib/openai/models/responses/tool.rb | 106 ++++-- .../live_call_incoming_webhook_event.rb | 6 +- .../realtime_call_incoming_webhook_event.rb | 8 +- lib/openai/resources/images.rb | 26 +- .../models/beta/beta_response_input_item.rbi | 87 ++++- rbi/openai/models/beta/beta_response_item.rbi | 79 ++++- .../models/beta/beta_response_output_item.rbi | 85 ++++- .../beta/beta_responses_client_event.rbi | 6 + rbi/openai/models/beta/beta_tool.rbi | 141 +++++--- .../models/beta/response_create_params.rbi | 6 + .../conversations/conversation_item.rbi | 89 ++++- .../models/image_edit_completed_event.rbi | 29 +- rbi/openai/models/image_edit_params.rbi | 149 ++++---- .../models/image_edit_partial_image_event.rbi | 29 +- .../models/image_gen_completed_event.rbi | 29 +- .../models/image_gen_partial_image_event.rbi | 29 +- rbi/openai/models/image_generate_params.rbi | 119 ++++--- rbi/openai/models/image_model.rbi | 4 + rbi/openai/models/images_response.rbi | 43 ++- .../responses/response_create_params.rbi | 6 + .../models/responses/response_input_item.rbi | 89 ++++- rbi/openai/models/responses/response_item.rbi | 81 ++++- .../models/responses/response_output_item.rbi | 85 ++++- .../responses/responses_client_event.rbi | 6 + rbi/openai/models/responses/tool.rbi | 141 +++++--- .../live_call_incoming_webhook_event.rbi | 8 +- .../realtime_call_incoming_webhook_event.rbi | 12 +- rbi/openai/resources/beta/responses.rbi | 8 +- rbi/openai/resources/images.rbi | 182 +++++----- rbi/openai/resources/responses.rbi | 6 + .../models/beta/beta_response_input_item.rbs | 41 ++- sig/openai/models/beta/beta_response_item.rbs | 41 ++- .../models/beta/beta_response_output_item.rbs | 41 ++- sig/openai/models/beta/beta_tool.rbs | 12 +- .../conversations/conversation_item.rbs | 41 ++- .../models/image_edit_completed_event.rbs | 15 +- sig/openai/models/image_edit_params.rbs | 4 +- .../models/image_edit_partial_image_event.rbs | 15 +- .../models/image_gen_completed_event.rbs | 15 +- .../models/image_gen_partial_image_event.rbs | 15 +- sig/openai/models/image_generate_params.rbs | 5 +- sig/openai/models/image_model.rbs | 8 + sig/openai/models/images_response.rbs | 14 +- .../models/responses/response_input_item.rbs | 41 ++- sig/openai/models/responses/response_item.rbs | 41 ++- .../models/responses/response_output_item.rbs | 41 ++- sig/openai/models/responses/tool.rbs | 12 +- test/openai/image_size_compatibility_test.rb | 73 ++++ .../beta/responses/input_items_test.rb | 4 +- .../resources/conversations/items_test.rb | 8 +- .../resources/responses/input_items_test.rb | 4 +- 73 files changed, 2894 insertions(+), 730 deletions(-) create mode 100644 test/openai/image_size_compatibility_test.rb diff --git a/.castiron.stats.yml b/.castiron.stats.yml index d4dd8c529..085e6cbc1 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,8 +1,8 @@ schema_version: 1 -generation_id: 6bb9e6c1-649a-4064-96b6-31ddb719a74b -openapi_spec_hash: a2e1a14d94531a640817968365170f62 -openapi_transformed_spec_hash: 64d5a44b8c772a86a5c1824c7d7d6ddd -config_hash: dfe8a20c64cc5d852e69c441cbd28ae7 -codegen_sha: 8aef429ad0e34051f0e6fc1ce4f99462cc817168 -codegen_hash: 7f483327c3394f7c93be5cae1abb8c6db77ebd44923cfe7cd8e8857de9386138 -public_codegen_sha: 4e571cbcb8e83ab27007a10e50acbba9c1565be7 +generation_id: 7f5b669b-5cfb-49a0-a069-b34e47bd12e9 +openapi_spec_hash: 0ac5ea4ab2546a188a36a0d370367637 +openapi_transformed_spec_hash: 6be6c39576ec27111cab26c251d2ab65 +config_hash: d92ec885ac2a08b6a4c1ff90420f0327 +codegen_sha: 23ba3d180f14bc59feb714e1ab25d5d341f5c213 +codegen_hash: 1e48d0bf25ef090cada933936c2c23c5843d9fc1504a36983ab2970b4a51971d +public_codegen_sha: 0e6ccf8a94ca9c81a24ae4309a74e49d91639708 diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index 01873d81b..1cc46fbb4 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -7792,7 +7792,7 @@ paths: tags: - Images summary: Create image edit - description: Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + description: Creates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models and `dall-e-2`. requestBody: required: true content: @@ -33170,13 +33170,15 @@ components: description: | The image(s) to edit. Must be a supported image file or an array of images. - For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, - `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, and - `chatgpt-image-latest`), each image should be a `png`, `webp`, or - `jpg` file less than 50MB. You can provide up to 16 images. + For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, + `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), 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. + For `dall-e-2`, you can only provide one image, and it should be a square + `png` file less than 4MB. x-oaiMeta: exampleFilePath: otter.png prompt: @@ -33199,15 +33201,16 @@ components: example: transparent nullable: true description: | - Allows to set transparency for the background of the generated image(s). - 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. + Allows to set transparency for the background of the generated image(s). 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. - Transparent backgrounds are available for supported GPT Image models. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in - preview. When using `transparent`, set the output format to `png` or - `webp`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. + Transparent backgrounds are available for supported GPT Image models. For + `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When + using `transparent`, set the output format to `png` or `webp`. model: anyOf: - type: string @@ -33217,12 +33220,16 @@ components: - gpt-image-1-mini - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1.5 - chatgpt-image-latest - dall-e-2 x-stainless-const: true x-oaiTypeLabel: string - description: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. + description: The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. nullable: true example: gpt-image-2 n: @@ -33244,7 +33251,7 @@ components: - 1536x1024 - 1024x1536 - auto - description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. nullable: true response_format: type: string @@ -33303,12 +33310,14 @@ components: - low - medium - high + - xhigh + - max - auto default: auto example: high nullable: true description: | - The quality of the image that will be generated for GPT image models. Defaults to `auto`. + The quality of the image that will be generated for GPT image models. The GPT image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support `xhigh` and `max`. Defaults to `auto`. required: - prompt - image @@ -33328,13 +33337,17 @@ components: - gpt-image-1-mini - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1.5 - chatgpt-image-latest - dall-e-2 - dall-e-3 x-stainless-nominal: false x-oaiTypeLabel: string - description: 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`, `gpt-image-2`, or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. + description: 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`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. nullable: true example: gpt-image-2 n: @@ -33353,6 +33366,8 @@ components: - low - medium - high + - xhigh + - max - auto default: auto example: medium @@ -33360,8 +33375,11 @@ components: description: | The quality of the image that will be generated. - - `auto` (default value) will automatically select the best quality for the given model. + - `auto` (default value) will automatically select the best quality for the given + model. - `high`, `medium` and `low` are supported for the GPT image models. + - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + snapshots, also support `xhigh` and `max`. - `hd` and `standard` are supported for `dall-e-3`. - `standard` is the only option for `dall-e-2`. response_format: @@ -33413,7 +33431,7 @@ components: - 512x512 - 1792x1024 - 1024x1792 - description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. nullable: true moderation: type: string @@ -33434,15 +33452,16 @@ components: example: transparent nullable: true description: | - Allows to set transparency for the background of the generated image(s). - 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. + Allows to set transparency for the background of the generated image(s). 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. - Transparent backgrounds are available for supported GPT Image models. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in - preview. When using `transparent`, set the output format to `png` or - `webp`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. + Transparent backgrounds are available for supported GPT Image models. For + `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When + using `transparent`, set the output format to `png` or `webp`. style: type: string enum: @@ -34049,6 +34068,8 @@ components: description: | Whether to store the generated model response for later retrieval via API. + Defaults to true when omitted. + If set to true, response data will be stored for at least 30 days, subject to the [data retention exceptions](/api/docs/guides/your-data#v1responses). default: true - type: 'null' instructions: @@ -35527,6 +35548,10 @@ components: - gpt-image-1.5 - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1 - gpt-image-1-mini - chatgpt-image-latest @@ -35534,7 +35559,7 @@ components: x-oaiTypeLabel: string default: gpt-image-1.5 example: gpt-image-1.5 - description: The GPT image model to use for image editing, including `gpt-image-2` and its dated snapshot `gpt-image-2-2026-04-21`. + description: The GPT image model to use for image editing, including `gpt-image-2`, its dated snapshot `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`. images: type: array minItems: 1 @@ -35568,12 +35593,16 @@ components: - low - medium - high + - xhigh + - max - auto - type: 'null' default: auto example: high description: | - Output quality for GPT image models. + Output quality for GPT image models. The GPT image models support `low`, `medium`, + and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, also support `xhigh` and `max`. Defaults to `auto`. input_fidelity: anyOf: - type: string @@ -35584,6 +35613,7 @@ components: description: Controls fidelity to the original input image(s). This parameter is supported for GPT image models that support input fidelity. `gpt-image-2` and `gpt-image-2-2026-04-21` ignore this parameter. size: anyOf: + - type: string - type: string enum: - auto @@ -35593,7 +35623,7 @@ components: - type: 'null' default: auto example: 1024x1024 - description: Requested output image size. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. user: type: string example: user-1234 @@ -35639,7 +35669,7 @@ components: - type: 'null' default: auto example: transparent - description: Set the background of the generated image output. Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the output format to `png` or `webp`. + description: Set the background of the generated image output. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. Transparent backgrounds are available for supported GPT Image models. For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, set the output format to `png` or `webp`. stream: anyOf: - type: boolean @@ -38910,14 +38940,15 @@ components: description: | The Unix timestamp when the event was created. size: - type: string - description: | - The size of the edited image. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: | @@ -38926,6 +38957,8 @@ components: - low - medium - high + - xhigh + - max - auto background: type: string @@ -38998,14 +39031,15 @@ components: description: | The Unix timestamp when the event was created. size: - type: string - description: | - The size of the requested edited image. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: | @@ -39014,6 +39048,8 @@ components: - low - medium - high + - xhigh + - max - auto background: type: string @@ -39086,14 +39122,15 @@ components: description: | The Unix timestamp when the event was created. size: - type: string - description: | - The size of the generated image. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: | @@ -39102,6 +39139,8 @@ components: - low - medium - high + - xhigh + - max - auto background: type: string @@ -39174,14 +39213,15 @@ components: description: | The Unix timestamp when the event was created. size: - type: string - description: | - The size of the requested image. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string description: | @@ -39190,6 +39230,8 @@ components: - low - medium - high + - xhigh + - max - auto background: type: string @@ -39262,12 +39304,18 @@ components: - gpt-image-1-mini - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1.5 - chatgpt-image-latest description: | The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default: + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: `gpt-image-1`. default: gpt-image-1 quality: @@ -39276,10 +39324,14 @@ components: - low - medium - high + - xhigh + - max - auto description: | - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + The quality of the generated image. The GPT image models support `low`, + `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + including their `2026-09-08` snapshots, also support `xhigh` and `max`. + Default: `auto`. default: auto size: anyOf: @@ -39290,7 +39342,7 @@ components: - 1024x1536 - 1536x1024 - auto - description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. default: auto output_format: type: string @@ -39324,15 +39376,16 @@ components: - opaque - auto description: | - Allows to set transparency for the background of the generated image(s). - 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. + Allows to set transparency for the background of the generated image(s). 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. - Transparent backgrounds are available for supported GPT Image models. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in - preview. When using `transparent`, set the output format to `png` or - `webp`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. + Transparent backgrounds are available for supported GPT Image models. For + `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When + using `transparent`, set the output format to `png` or `webp`. default: auto input_fidelity: anyOf: @@ -39400,6 +39453,28 @@ components: description: | The generated image encoded in base64. - type: 'null' + size: + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - type: 'null' + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + quality: + anyOf: + - type: string + enum: + - low + - medium + - high + - xhigh + - max + - auto + - type: 'null' + description: The quality of the image generated by the image generation tool call. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. required: - type - id @@ -39459,19 +39534,23 @@ components: - webp - jpeg size: - type: string - description: The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`. - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. quality: type: string - description: The quality of the image generated. Either `low`, `medium`, or `high`. + description: The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or `max`. enum: - low - medium - high + - xhigh + - max usage: $ref: '#/components/schemas/ImageGenUsage' required: @@ -61677,8 +61756,8 @@ components: session_id: type: string description: | - The Transceiver `rtc_...` ID of the pending SIP session. The same - value appears as `call_id` in `realtime.call.incoming`. + The `live_...` ID of the pending SIP session. Forward this value + unchanged when accepting or rejecting the call through the Live API. sip_headers: type: array description: | @@ -61722,7 +61801,7 @@ components: "type": "live.call.incoming", "created_at": 1719168000, "data": { - "session_id": "rtc_479a275623b54bdb9b6fbae2f7cbd408", + "session_id": "live_u0_479a275623b54bdb9b6fbae2f7cbd408", "sip_headers": [ {"name": "Max-Forwards", "value": "63"}, {"name": "CSeq", "value": "851287 INVITE"}, @@ -61763,8 +61842,10 @@ components: call_id: type: string description: | - The Transceiver `rtc_...` ID of the pending SIP session. The same - value appears as `session_id` in `live.call.incoming`. + The Transceiver `rtc_...` ID of the pending SIP session. The paired + `live.call.incoming` event derives its `session_id` by replacing the + `rtc_` prefix with `live_`. Use the ID returned by the event with the + corresponding Realtime or Live API. sip_headers: type: array description: | @@ -66894,6 +66975,7 @@ components: - items: $ref: '#/components/schemas/InputItem' type: array + maxItems: 131072 description: A list of one or many input items to the model, containing different content types. - type: 'null' previous_response_id: @@ -66993,6 +67075,7 @@ components: - items: $ref: '#/components/schemas/InputItem' type: array + maxItems: 131072 description: A list of one or many input items to the model, containing different content types. - type: 'null' previous_response_id: @@ -68494,6 +68577,7 @@ components: - items: $ref: '#/components/schemas/BetaInputItem' type: array + maxItems: 131072 description: A list of one or many input items to the model, containing different content types. - type: 'null' previous_response_id: @@ -69611,12 +69695,18 @@ components: - gpt-image-1-mini - gpt-image-2 - gpt-image-2-2026-04-21 + - gpt-image-2.5-sunburst + - gpt-image-2.5-sunburst-2026-09-08 + - gpt-image-2.5-flare + - gpt-image-2.5-flare-2026-09-08 - gpt-image-1.5 - chatgpt-image-latest description: | The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`. Default: + `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`. Default: `gpt-image-1`. default: gpt-image-1 quality: @@ -69625,10 +69715,14 @@ components: - low - medium - high + - xhigh + - max - auto description: | - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + The quality of the generated image. The GPT image models support `low`, + `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + including their `2026-09-08` snapshots, also support `xhigh` and `max`. + Default: `auto`. default: auto size: anyOf: @@ -69639,7 +69733,7 @@ components: - 1024x1536 - 1536x1024 - auto - description: The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. + description: The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and the maximum supported resolution is `3840x2160`. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or `1024x1792`. default: auto output_format: type: string @@ -69673,15 +69767,16 @@ components: - opaque - auto description: | - Allows to set transparency for the background of the generated image(s). - 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. + Allows to set transparency for the background of the generated image(s). 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. - Transparent backgrounds are available for supported GPT Image models. - For `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in - preview. When using `transparent`, set the output format to `png` or - `webp`. + `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + `2026-09-08` snapshots, support `opaque` and `transparent` backgrounds. + Transparent backgrounds are available for supported GPT Image models. For + `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When + using `transparent`, set the output format to `png` or `webp`. default: auto input_fidelity: anyOf: @@ -71689,6 +71784,28 @@ components: description: | The generated image encoded in base64. - type: 'null' + size: + anyOf: + - type: string + - type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - type: 'null' + description: The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + quality: + anyOf: + - type: string + enum: + - low + - medium + - high + - xhigh + - max + - auto + - type: 'null' + description: The quality of the image generated by the image generation tool call. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. required: - type - id @@ -73575,6 +73692,7 @@ components: - items: $ref: '#/components/schemas/BetaInputItem' type: array + maxItems: 131072 description: A list of one or many input items to the model, containing different content types. - type: 'null' previous_response_id: @@ -80472,6 +80590,8 @@ components: description: | Whether to store the generated model response for later retrieval via API. + Defaults to true when omitted. + If set to true, response data will be stored for at least 30 days, subject to the [data retention exceptions](/api/docs/guides/your-data#v1responses). default: true - type: 'null' instructions: diff --git a/lib/openai/models/beta/beta_response_input_item.rb b/lib/openai/models/beta/beta_response_input_item.rb index b5f2d697f..bbe02bc4a 100644 --- a/lib/openai/models/beta/beta_response_input_item.rb +++ b/lib/openai/models/beta/beta_response_input_item.rb @@ -1224,7 +1224,30 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # @return [OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Agent, nil] optional :agent, -> { OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent }, nil?: true - # @!method initialize(id:, result:, status:, agent: nil, type: :image_generation_call) + # @!attribute quality + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @return [Symbol, OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Quality, nil] + optional( + :quality, + enum: -> { OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality }, + nil?: true + ) + + # @!attribute size + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @return [String, Symbol, OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Size, nil] + optional( + :size, + union: -> { + OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size + }, + nil?: true + ) + + # @!method initialize(id:, result:, status:, agent: nil, quality: nil, size: nil, type: :image_generation_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall} for more # details. @@ -1239,6 +1262,10 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # # @param agent [OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Agent, nil] The agent that produced this item. # + # @param quality [Symbol, OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo + # + # @param size [String, Symbol, OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`. # The status of the image generation call. @@ -1269,6 +1296,62 @@ class Agent < OpenAI::Internal::Type::BaseModel # # @param agent_name [String] The canonical name of the agent that produced this item. end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @see OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall#quality + module Quality + extend OpenAI::Internal::Type::Enum + + LOW = :low + MEDIUM = :medium + HIGH = :high + XHIGH = :xhigh + MAX = :max + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @see OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall#size + module Size + extend OpenAI::Internal::Type::Union + + variant String + + variant( + const: -> { OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Size::SIZE_1024X1024 } + ) + + variant( + const: -> { OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Size::SIZE_1024X1536 } + ) + + variant( + const: -> { OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::Size::SIZE_1536X1024 } + ) + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { + T.any(String, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::TaggedSymbol) + } + end + + # @!group + + SIZE_1024X1024 = :"1024x1024" + SIZE_1024X1536 = :"1024x1536" + SIZE_1536X1024 = :"1536x1024" + + # @!endgroup + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/beta/beta_response_item.rb b/lib/openai/models/beta/beta_response_item.rb index dcf34080f..eba815f27 100644 --- a/lib/openai/models/beta/beta_response_item.rb +++ b/lib/openai/models/beta/beta_response_item.rb @@ -803,7 +803,26 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # @return [OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Agent, nil] optional :agent, -> { OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent }, nil?: true - # @!method initialize(id:, result:, status:, agent: nil, type: :image_generation_call) + # @!attribute quality + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @return [Symbol, OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Quality, nil] + optional( + :quality, + enum: -> { + OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality + }, + nil?: true + ) + + # @!attribute size + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @return [String, Symbol, OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Size, nil] + optional :size, union: -> { OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size }, nil?: true + + # @!method initialize(id:, result:, status:, agent: nil, quality: nil, size: nil, type: :image_generation_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall} for more details. # @@ -817,6 +836,10 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # # @param agent [OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Agent, nil] The agent that produced this item. # + # @param quality [Symbol, OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo + # + # @param size [String, Symbol, OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`. # The status of the image generation call. @@ -847,6 +870,54 @@ class Agent < OpenAI::Internal::Type::BaseModel # # @param agent_name [String] The canonical name of the agent that produced this item. end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @see OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall#quality + module Quality + extend OpenAI::Internal::Type::Enum + + LOW = :low + MEDIUM = :medium + HIGH = :high + XHIGH = :xhigh + MAX = :max + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @see OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall#size + module Size + extend OpenAI::Internal::Type::Union + + variant String + + variant const: -> { OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Size::SIZE_1024X1024 } + + variant const: -> { OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Size::SIZE_1024X1536 } + + variant const: -> { OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::Size::SIZE_1536X1024 } + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol) } + end + + # @!group + + SIZE_1024X1024 = :"1024x1024" + SIZE_1024X1536 = :"1024x1536" + SIZE_1536X1024 = :"1536x1024" + + # @!endgroup + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/beta/beta_response_output_item.rb b/lib/openai/models/beta/beta_response_output_item.rb index b05bc07c9..44c3d7c07 100644 --- a/lib/openai/models/beta/beta_response_output_item.rb +++ b/lib/openai/models/beta/beta_response_output_item.rb @@ -802,7 +802,30 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # @return [OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent, nil] optional :agent, -> { OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent }, nil?: true - # @!method initialize(id:, result:, status:, agent: nil, type: :image_generation_call) + # @!attribute quality + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @return [Symbol, OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality, nil] + optional( + :quality, + enum: -> { OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality }, + nil?: true + ) + + # @!attribute size + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @return [String, Symbol, OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Size, nil] + optional( + :size, + union: -> { + OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size + }, + nil?: true + ) + + # @!method initialize(id:, result:, status:, agent: nil, quality: nil, size: nil, type: :image_generation_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall} for more # details. @@ -817,6 +840,10 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # # @param agent [OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent, nil] The agent that produced this item. # + # @param quality [Symbol, OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo + # + # @param size [String, Symbol, OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`. # The status of the image generation call. @@ -847,6 +874,62 @@ class Agent < OpenAI::Internal::Type::BaseModel # # @param agent_name [String] The canonical name of the agent that produced this item. end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @see OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall#quality + module Quality + extend OpenAI::Internal::Type::Enum + + LOW = :low + MEDIUM = :medium + HIGH = :high + XHIGH = :xhigh + MAX = :max + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @see OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall#size + module Size + extend OpenAI::Internal::Type::Union + + variant String + + variant( + const: -> { OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::SIZE_1024X1024 } + ) + + variant( + const: -> { OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::SIZE_1024X1536 } + ) + + variant( + const: -> { OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::SIZE_1536X1024 } + ) + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { + T.any(String, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol) + } + end + + # @!group + + SIZE_1024X1024 = :"1024x1024" + SIZE_1024X1536 = :"1024x1536" + SIZE_1536X1024 = :"1536x1024" + + # @!endgroup + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/beta/beta_responses_client_event.rb b/lib/openai/models/beta/beta_responses_client_event.rb index 8c1c9e59a..c140bf310 100644 --- a/lib/openai/models/beta/beta_responses_client_event.rb +++ b/lib/openai/models/beta/beta_responses_client_event.rb @@ -336,6 +336,9 @@ class ResponseCreate < OpenAI::Internal::Type::BaseModel # @!attribute store # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). # # @return [Boolean, nil] optional :store, OpenAI::Internal::Type::Boolean, nil?: true diff --git a/lib/openai/models/beta/beta_tool.rb b/lib/openai/models/beta/beta_tool.rb index 46732282c..d6026af70 100644 --- a/lib/openai/models/beta/beta_tool.rb +++ b/lib/openai/models/beta/beta_tool.rb @@ -571,9 +571,11 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. # # @return [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Background, nil] optional :background, enum: -> { OpenAI::Beta::BetaTool::ImageGeneration::Background } @@ -602,7 +604,9 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # @!attribute model # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. # # @return [String, Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Model, nil] @@ -635,24 +639,27 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel optional :partial_images, Integer # @!attribute quality - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. # # @return [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Quality, nil] optional :quality, enum: -> { OpenAI::Beta::BetaTool::ImageGeneration::Quality } # @!attribute size - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. # # @return [String, Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Size, nil] optional :size, union: -> { OpenAI::Beta::BetaTool::ImageGeneration::Size } @@ -665,7 +672,7 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # # @param action [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Action] Whether to generate a new image or edit an existing image. Default: `auto`. # - # @param background [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Background] Allows to set transparency for the background of the generated image(s). + # @param background [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Background] Allows to set transparency for the background of the generated image(s). Must # # @param input_fidelity [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::InputFidelity, nil] Control how much effort the model will exert to match the style and features, es # @@ -681,9 +688,9 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # # @param partial_images [Integer] Number of partial images to generate in streaming mode, from 0 (default value) t # - # @param quality [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Quality] The quality of the generated image. One of `low`, `medium`, `high`, + # @param quality [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Quality] The quality of the generated image. The GPT image models support `low`, # - # @param size [String, Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Size] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21` + # @param size [String, Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Size] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, ` # # @param type [Symbol, :image_generation] The type of the image generation tool. Always `image_generation`. @@ -705,9 +712,11 @@ module Action # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. # # @see OpenAI::Models::Beta::BetaTool::ImageGeneration#background module Background @@ -765,7 +774,9 @@ class InputImageMask < OpenAI::Internal::Type::BaseModel end # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. # # @see OpenAI::Models::Beta::BetaTool::ImageGeneration#model @@ -782,6 +793,18 @@ module Model variant const: -> { OpenAI::Models::Beta::BetaTool::ImageGeneration::Model::GPT_IMAGE_2_2026_04_21 } + variant const: -> { OpenAI::Models::Beta::BetaTool::ImageGeneration::Model::GPT_IMAGE_2_5_SUNBURST } + + variant( + const: -> { OpenAI::Models::Beta::BetaTool::ImageGeneration::Model::GPT_IMAGE_2_5_SUNBURST_2026_09_08 } + ) + + variant const: -> { OpenAI::Models::Beta::BetaTool::ImageGeneration::Model::GPT_IMAGE_2_5_FLARE } + + variant( + const: -> { OpenAI::Models::Beta::BetaTool::ImageGeneration::Model::GPT_IMAGE_2_5_FLARE_2026_09_08 } + ) + variant const: -> { OpenAI::Models::Beta::BetaTool::ImageGeneration::Model::GPT_IMAGE_1_5 } variant const: -> { OpenAI::Models::Beta::BetaTool::ImageGeneration::Model::CHATGPT_IMAGE_LATEST } @@ -799,6 +822,10 @@ module Model GPT_IMAGE_1_MINI = :"gpt-image-1-mini" GPT_IMAGE_2 = :"gpt-image-2" GPT_IMAGE_2_2026_04_21 = :"gpt-image-2-2026-04-21" + GPT_IMAGE_2_5_SUNBURST = :"gpt-image-2.5-sunburst" + GPT_IMAGE_2_5_SUNBURST_2026_09_08 = :"gpt-image-2.5-sunburst-2026-09-08" + GPT_IMAGE_2_5_FLARE = :"gpt-image-2.5-flare" + GPT_IMAGE_2_5_FLARE_2026_09_08 = :"gpt-image-2.5-flare-2026-09-08" GPT_IMAGE_1_5 = :"gpt-image-1.5" CHATGPT_IMAGE_LATEST = :"chatgpt-image-latest" @@ -833,8 +860,10 @@ module OutputFormat # @return [Array] end - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. # # @see OpenAI::Models::Beta::BetaTool::ImageGeneration#quality module Quality @@ -843,23 +872,26 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max AUTO = :auto # @!method self.values # @return [Array] end - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. # # @see OpenAI::Models::Beta::BetaTool::ImageGeneration#size module Size diff --git a/lib/openai/models/beta/response_create_params.rb b/lib/openai/models/beta/response_create_params.rb index ddac0cad3..12d252e58 100644 --- a/lib/openai/models/beta/response_create_params.rb +++ b/lib/openai/models/beta/response_create_params.rb @@ -260,6 +260,9 @@ class ResponseCreateParams < OpenAI::Internal::Type::BaseModel # @!attribute store # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). # # @return [Boolean, nil] optional :store, OpenAI::Internal::Type::Boolean, nil?: true diff --git a/lib/openai/models/conversations/conversation_item.rb b/lib/openai/models/conversations/conversation_item.rb index 5e06be769..160d2273e 100644 --- a/lib/openai/models/conversations/conversation_item.rb +++ b/lib/openai/models/conversations/conversation_item.rb @@ -126,7 +126,28 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # @return [Symbol, :image_generation_call] required :type, const: :image_generation_call - # @!method initialize(id:, result:, status:, type: :image_generation_call) + # @!attribute quality + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @return [Symbol, OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::Quality, nil] + optional( + :quality, + enum: -> { OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality }, + nil?: true + ) + + # @!attribute size + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @return [String, Symbol, OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::Size, nil] + optional( + :size, + union: -> { OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size }, + nil?: true + ) + + # @!method initialize(id:, result:, status:, quality: nil, size: nil, type: :image_generation_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall} for more # details. @@ -139,6 +160,10 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # # @param status [Symbol, OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::Status] The status of the image generation call. # + # @param quality [Symbol, OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo + # + # @param size [String, Symbol, OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`. # The status of the image generation call. @@ -155,6 +180,62 @@ module Status # @!method self.values # @return [Array] end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @see OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall#quality + module Quality + extend OpenAI::Internal::Type::Enum + + LOW = :low + MEDIUM = :medium + HIGH = :high + XHIGH = :xhigh + MAX = :max + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @see OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall#size + module Size + extend OpenAI::Internal::Type::Union + + variant String + + variant( + const: -> { OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::Size::SIZE_1024X1024 } + ) + + variant( + const: -> { OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::Size::SIZE_1024X1536 } + ) + + variant( + const: -> { OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::Size::SIZE_1536X1024 } + ) + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { + T.any(String, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol) + } + end + + # @!group + + SIZE_1024X1024 = :"1024x1024" + SIZE_1024X1536 = :"1024x1536" + SIZE_1536X1024 = :"1536x1024" + + # @!endgroup + end end class AdditionalTools < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/image_edit_completed_event.rb b/lib/openai/models/image_edit_completed_event.rb index e1fe4c964..edf450700 100644 --- a/lib/openai/models/image_edit_completed_event.rb +++ b/lib/openai/models/image_edit_completed_event.rb @@ -34,10 +34,10 @@ class ImageEditCompletedEvent < OpenAI::Internal::Type::BaseModel required :quality, enum: -> { OpenAI::ImageEditCompletedEvent::Quality } # @!attribute size - # The size of the edited image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # - # @return [Symbol, OpenAI::Models::ImageEditCompletedEvent::Size] - required :size, enum: -> { OpenAI::ImageEditCompletedEvent::Size } + # @return [String, Symbol, OpenAI::Models::ImageEditCompletedEvent::Size] + required :size, union: -> { OpenAI::ImageEditCompletedEvent::Size } # @!attribute type # The type of the event. Always `image_edit.completed`. @@ -68,7 +68,7 @@ class ImageEditCompletedEvent < OpenAI::Internal::Type::BaseModel # # @param quality [Symbol, OpenAI::Models::ImageEditCompletedEvent::Quality] The quality setting for the edited image. # - # @param size [Symbol, OpenAI::Models::ImageEditCompletedEvent::Size] The size of the edited image. + # @param size [String, Symbol, OpenAI::Models::ImageEditCompletedEvent::Size] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @param usage [OpenAI::Models::ImageEditCompletedEvent::Usage] For the GPT image models only, the token usage information for the image generat # @@ -111,25 +111,51 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max AUTO = :auto # @!method self.values # @return [Array] end - # The size of the edited image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @see OpenAI::Models::ImageEditCompletedEvent#size module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + variant const: -> { OpenAI::Models::ImageEditCompletedEvent::Size::SIZE_1024X1024 } + + variant const: -> { OpenAI::Models::ImageEditCompletedEvent::Size::SIZE_1024X1536 } + + variant const: -> { OpenAI::Models::ImageEditCompletedEvent::Size::SIZE_1536X1024 } + + variant const: -> { OpenAI::Models::ImageEditCompletedEvent::Size::AUTO } + + # Keep known dimensions as symbols when reading existing API responses. + variant String + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol) } + end + + # @!group SIZE_1024X1024 = :"1024x1024" SIZE_1024X1536 = :"1024x1536" SIZE_1536X1024 = :"1536x1024" AUTO = :auto - # @!method self.values - # @return [Array] + # @!endgroup + + # Preserve the enum helper available before custom dimensions were supported. + # + # @return [Array] + def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024, AUTO] end # @see OpenAI::Models::ImageEditCompletedEvent#usage diff --git a/lib/openai/models/image_edit_params.rb b/lib/openai/models/image_edit_params.rb index 5aba46d21..2b6bbc9bb 100644 --- a/lib/openai/models/image_edit_params.rb +++ b/lib/openai/models/image_edit_params.rb @@ -13,9 +13,11 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # The image(s) to edit. Must be a supported image file or an array of images. # # For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - # `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - # should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - # 16 images. + # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), 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. @@ -39,9 +41,11 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. # # @return [Symbol, OpenAI::Models::ImageEditParams::Background, nil] optional :background, enum: -> { OpenAI::ImageEditParams::Background }, nil?: true @@ -71,7 +75,9 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # @!attribute model # The model to use for image generation. One of `dall-e-2` or a GPT image model # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - # `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to # `gpt-image-1.5`. # # @return [String, Symbol, OpenAI::Models::ImageModel, nil] @@ -111,8 +117,10 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel optional :partial_images, Integer, nil?: true # @!attribute quality - # The quality of the image that will be generated for GPT image models. Defaults - # to `auto`. + # The quality of the image that will be generated for GPT image models. The GPT + # image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + # `xhigh` and `max`. Defaults to `auto`. # # @return [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] optional :quality, enum: -> { OpenAI::ImageEditParams::Quality }, nil?: true @@ -127,17 +135,18 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel optional :response_format, enum: -> { OpenAI::ImageEditParams::ResponseFormat }, nil?: true # @!attribute size - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. # # @return [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil] optional :size, union: -> { OpenAI::ImageEditParams::Size }, nil?: true @@ -158,7 +167,7 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # # @param prompt [String] A text description of the desired image(s). The maximum length is 1000 character # - # @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil] Allows to set transparency for the background of the generated image(s). + # @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil] Allows to set transparency for the background of the generated image(s). Must # # @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil] Control how much effort the model will exert to match the style and features, es # @@ -174,11 +183,11 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # # @param partial_images [Integer, nil] The number of partial images to generate. This parameter is used for # - # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] The quality of the image that will be generated for GPT image models. Defaults t + # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] The quality of the image that will be generated for GPT image models. The GPT im # # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] The format in which the generated images are returned. Must be one of `url` or ` # - # @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21` + # @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, ` # # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor # @@ -187,9 +196,11 @@ class ImageEditParams < OpenAI::Internal::Type::BaseModel # The image(s) to edit. Must be a supported image file or an array of images. # # For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - # `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - # should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - # 16 images. + # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), 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. @@ -211,9 +222,11 @@ module Image # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. module Background extend OpenAI::Internal::Type::Enum @@ -241,14 +254,16 @@ module InputFidelity # The model to use for image generation. One of `dall-e-2` or a GPT image model # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - # `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to # `gpt-image-1.5`. module Model extend OpenAI::Internal::Type::Union variant String - # The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. + # The model to use for image generation. One of `dall-e-2` or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to `gpt-image-1.5`. variant enum: -> { OpenAI::ImageModel } # @!method self.variants @@ -269,8 +284,10 @@ module OutputFormat # @return [Array] end - # The quality of the image that will be generated for GPT image models. Defaults - # to `auto`. + # The quality of the image that will be generated for GPT image models. The GPT + # image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + # `xhigh` and `max`. Defaults to `auto`. module Quality extend OpenAI::Internal::Type::Enum @@ -278,6 +295,8 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max AUTO = :auto # @!method self.values @@ -298,17 +317,18 @@ module ResponseFormat # @return [Array] end - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. module Size extend OpenAI::Internal::Type::Union diff --git a/lib/openai/models/image_edit_partial_image_event.rb b/lib/openai/models/image_edit_partial_image_event.rb index 95d5bd96b..eee42be53 100644 --- a/lib/openai/models/image_edit_partial_image_event.rb +++ b/lib/openai/models/image_edit_partial_image_event.rb @@ -40,10 +40,10 @@ class ImageEditPartialImageEvent < OpenAI::Internal::Type::BaseModel required :quality, enum: -> { OpenAI::ImageEditPartialImageEvent::Quality } # @!attribute size - # The size of the requested edited image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # - # @return [Symbol, OpenAI::Models::ImageEditPartialImageEvent::Size] - required :size, enum: -> { OpenAI::ImageEditPartialImageEvent::Size } + # @return [String, Symbol, OpenAI::Models::ImageEditPartialImageEvent::Size] + required :size, union: -> { OpenAI::ImageEditPartialImageEvent::Size } # @!attribute type # The type of the event. Always `image_edit.partial_image`. @@ -69,7 +69,7 @@ class ImageEditPartialImageEvent < OpenAI::Internal::Type::BaseModel # # @param quality [Symbol, OpenAI::Models::ImageEditPartialImageEvent::Quality] The quality setting for the requested edited image. # - # @param size [Symbol, OpenAI::Models::ImageEditPartialImageEvent::Size] The size of the requested edited image. + # @param size [String, Symbol, OpenAI::Models::ImageEditPartialImageEvent::Size] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @param type [Symbol, :"image_edit.partial_image"] The type of the event. Always `image_edit.partial_image`. @@ -110,25 +110,51 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max AUTO = :auto # @!method self.values # @return [Array] end - # The size of the requested edited image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @see OpenAI::Models::ImageEditPartialImageEvent#size module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + variant const: -> { OpenAI::Models::ImageEditPartialImageEvent::Size::SIZE_1024X1024 } + + variant const: -> { OpenAI::Models::ImageEditPartialImageEvent::Size::SIZE_1024X1536 } + + variant const: -> { OpenAI::Models::ImageEditPartialImageEvent::Size::SIZE_1536X1024 } + + variant const: -> { OpenAI::Models::ImageEditPartialImageEvent::Size::AUTO } + + # Keep known dimensions as symbols when reading existing API responses. + variant String + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol) } + end + + # @!group SIZE_1024X1024 = :"1024x1024" SIZE_1024X1536 = :"1024x1536" SIZE_1536X1024 = :"1536x1024" AUTO = :auto - # @!method self.values - # @return [Array] + # @!endgroup + + # Preserve the enum helper available before custom dimensions were supported. + # + # @return [Array] + def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024, AUTO] end end end diff --git a/lib/openai/models/image_gen_completed_event.rb b/lib/openai/models/image_gen_completed_event.rb index 5f983f76d..133954d7c 100644 --- a/lib/openai/models/image_gen_completed_event.rb +++ b/lib/openai/models/image_gen_completed_event.rb @@ -34,10 +34,10 @@ class ImageGenCompletedEvent < OpenAI::Internal::Type::BaseModel required :quality, enum: -> { OpenAI::ImageGenCompletedEvent::Quality } # @!attribute size - # The size of the generated image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # - # @return [Symbol, OpenAI::Models::ImageGenCompletedEvent::Size] - required :size, enum: -> { OpenAI::ImageGenCompletedEvent::Size } + # @return [String, Symbol, OpenAI::Models::ImageGenCompletedEvent::Size] + required :size, union: -> { OpenAI::ImageGenCompletedEvent::Size } # @!attribute type # The type of the event. Always `image_generation.completed`. @@ -68,7 +68,7 @@ class ImageGenCompletedEvent < OpenAI::Internal::Type::BaseModel # # @param quality [Symbol, OpenAI::Models::ImageGenCompletedEvent::Quality] The quality setting for the generated image. # - # @param size [Symbol, OpenAI::Models::ImageGenCompletedEvent::Size] The size of the generated image. + # @param size [String, Symbol, OpenAI::Models::ImageGenCompletedEvent::Size] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @param usage [OpenAI::Models::ImageGenCompletedEvent::Usage] For the GPT image models only, the token usage information for the image generat # @@ -111,25 +111,51 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max AUTO = :auto # @!method self.values # @return [Array] end - # The size of the generated image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @see OpenAI::Models::ImageGenCompletedEvent#size module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + variant const: -> { OpenAI::Models::ImageGenCompletedEvent::Size::SIZE_1024X1024 } + + variant const: -> { OpenAI::Models::ImageGenCompletedEvent::Size::SIZE_1024X1536 } + + variant const: -> { OpenAI::Models::ImageGenCompletedEvent::Size::SIZE_1536X1024 } + + variant const: -> { OpenAI::Models::ImageGenCompletedEvent::Size::AUTO } + + # Keep known dimensions as symbols when reading existing API responses. + variant String + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol) } + end + + # @!group SIZE_1024X1024 = :"1024x1024" SIZE_1024X1536 = :"1024x1536" SIZE_1536X1024 = :"1536x1024" AUTO = :auto - # @!method self.values - # @return [Array] + # @!endgroup + + # Preserve the enum helper available before custom dimensions were supported. + # + # @return [Array] + def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024, AUTO] end # @see OpenAI::Models::ImageGenCompletedEvent#usage diff --git a/lib/openai/models/image_gen_partial_image_event.rb b/lib/openai/models/image_gen_partial_image_event.rb index 33601e7c9..4834ef4ab 100644 --- a/lib/openai/models/image_gen_partial_image_event.rb +++ b/lib/openai/models/image_gen_partial_image_event.rb @@ -40,10 +40,10 @@ class ImageGenPartialImageEvent < OpenAI::Internal::Type::BaseModel required :quality, enum: -> { OpenAI::ImageGenPartialImageEvent::Quality } # @!attribute size - # The size of the requested image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # - # @return [Symbol, OpenAI::Models::ImageGenPartialImageEvent::Size] - required :size, enum: -> { OpenAI::ImageGenPartialImageEvent::Size } + # @return [String, Symbol, OpenAI::Models::ImageGenPartialImageEvent::Size] + required :size, union: -> { OpenAI::ImageGenPartialImageEvent::Size } # @!attribute type # The type of the event. Always `image_generation.partial_image`. @@ -69,7 +69,7 @@ class ImageGenPartialImageEvent < OpenAI::Internal::Type::BaseModel # # @param quality [Symbol, OpenAI::Models::ImageGenPartialImageEvent::Quality] The quality setting for the requested image. # - # @param size [Symbol, OpenAI::Models::ImageGenPartialImageEvent::Size] The size of the requested image. + # @param size [String, Symbol, OpenAI::Models::ImageGenPartialImageEvent::Size] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @param type [Symbol, :"image_generation.partial_image"] The type of the event. Always `image_generation.partial_image`. @@ -110,25 +110,51 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max AUTO = :auto # @!method self.values # @return [Array] end - # The size of the requested image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @see OpenAI::Models::ImageGenPartialImageEvent#size module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + variant const: -> { OpenAI::Models::ImageGenPartialImageEvent::Size::SIZE_1024X1024 } + + variant const: -> { OpenAI::Models::ImageGenPartialImageEvent::Size::SIZE_1024X1536 } + + variant const: -> { OpenAI::Models::ImageGenPartialImageEvent::Size::SIZE_1536X1024 } + + variant const: -> { OpenAI::Models::ImageGenPartialImageEvent::Size::AUTO } + + # Keep known dimensions as symbols when reading existing API responses. + variant String + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol) } + end + + # @!group SIZE_1024X1024 = :"1024x1024" SIZE_1024X1536 = :"1024x1536" SIZE_1536X1024 = :"1536x1024" AUTO = :auto - # @!method self.values - # @return [Array] + # @!endgroup + + # Preserve the enum helper available before custom dimensions were supported. + # + # @return [Array] + def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024, AUTO] end end end diff --git a/lib/openai/models/image_generate_params.rb b/lib/openai/models/image_generate_params.rb index c4187fb02..cafe97f5c 100644 --- a/lib/openai/models/image_generate_params.rb +++ b/lib/openai/models/image_generate_params.rb @@ -22,9 +22,11 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. # # @return [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] optional :background, enum: -> { OpenAI::ImageGenerateParams::Background }, nil?: true @@ -32,8 +34,10 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel # @!attribute 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`, `gpt-image-2`, - # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - # to the GPT image models is used. + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + # specific to the GPT image models is used. # # @return [String, Symbol, OpenAI::Models::ImageModel, nil] optional :model, union: -> { OpenAI::ImageGenerateParams::Model }, nil?: true @@ -85,6 +89,8 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel # - `auto` (default value) will automatically select the best quality for the # given model. # - `high`, `medium` and `low` are supported for the GPT image models. + # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + # `2026-09-08` snapshots, also support `xhigh` and `max`. # - `hd` and `standard` are supported for `dall-e-3`. # - `standard` is the only option for `dall-e-2`. # @@ -101,17 +107,18 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel optional :response_format, enum: -> { OpenAI::ImageGenerateParams::ResponseFormat }, nil?: true # @!attribute size - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. # # @return [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] optional :size, union: -> { OpenAI::ImageGenerateParams::Size }, nil?: true @@ -139,7 +146,7 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel # # @param prompt [String] A text description of the desired image(s). The maximum length is 32000 characte # - # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] Allows to set transparency for the background of the generated image(s). + # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] Allows to set transparency for the background of the generated image(s). Must # # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT i # @@ -157,7 +164,7 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel # # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] The format in which generated images with `dall-e-2` and `dall-e-3` are returned # - # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21` + # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, ` # # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] The style of the generated images. This parameter is only supported for `dall-e- # @@ -169,9 +176,11 @@ class ImageGenerateParams < OpenAI::Internal::Type::BaseModel # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. module Background extend OpenAI::Internal::Type::Enum @@ -185,14 +194,16 @@ module Background # 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`, `gpt-image-2`, - # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - # to the GPT image models is used. + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + # specific to the GPT image models is used. module Model extend OpenAI::Internal::Type::Union variant String - # 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`, `gpt-image-2`, or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. + # 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`, `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used. variant enum: -> { OpenAI::ImageModel } # @!method self.variants @@ -230,6 +241,8 @@ module OutputFormat # - `auto` (default value) will automatically select the best quality for the # given model. # - `high`, `medium` and `low` are supported for the GPT image models. + # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + # `2026-09-08` snapshots, also support `xhigh` and `max`. # - `hd` and `standard` are supported for `dall-e-3`. # - `standard` is the only option for `dall-e-2`. module Quality @@ -240,6 +253,8 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max AUTO = :auto # @!method self.values @@ -260,17 +275,18 @@ module ResponseFormat # @return [Array] end - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. module Size extend OpenAI::Internal::Type::Union diff --git a/lib/openai/models/image_model.rb b/lib/openai/models/image_model.rb index 6cf428b82..488b2529b 100644 --- a/lib/openai/models/image_model.rb +++ b/lib/openai/models/image_model.rb @@ -9,6 +9,10 @@ module ImageModel GPT_IMAGE_1_MINI = :"gpt-image-1-mini" GPT_IMAGE_2 = :"gpt-image-2" GPT_IMAGE_2_2026_04_21 = :"gpt-image-2-2026-04-21" + GPT_IMAGE_2_5_SUNBURST = :"gpt-image-2.5-sunburst" + GPT_IMAGE_2_5_SUNBURST_2026_09_08 = :"gpt-image-2.5-sunburst-2026-09-08" + GPT_IMAGE_2_5_FLARE = :"gpt-image-2.5-flare" + GPT_IMAGE_2_5_FLARE_2026_09_08 = :"gpt-image-2.5-flare-2026-09-08" GPT_IMAGE_1_5 = :"gpt-image-1.5" CHATGPT_IMAGE_LATEST = :"chatgpt-image-latest" DALL_E_2 = :"dall-e-2" diff --git a/lib/openai/models/images_response.rb b/lib/openai/models/images_response.rb index e8aec8862..b7e4bc2fa 100644 --- a/lib/openai/models/images_response.rb +++ b/lib/openai/models/images_response.rb @@ -30,17 +30,17 @@ class ImagesResponse < OpenAI::Internal::Type::BaseModel optional :output_format, enum: -> { OpenAI::ImagesResponse::OutputFormat } # @!attribute quality - # The quality of the image generated. Either `low`, `medium`, or `high`. + # The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or + # `max`. # # @return [Symbol, OpenAI::Models::ImagesResponse::Quality, nil] optional :quality, enum: -> { OpenAI::ImagesResponse::Quality } # @!attribute size - # The size of the image generated. Either `1024x1024`, `1024x1536`, or - # `1536x1024`. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # - # @return [Symbol, OpenAI::Models::ImagesResponse::Size, nil] - optional :size, enum: -> { OpenAI::ImagesResponse::Size } + # @return [String, Symbol, OpenAI::Models::ImagesResponse::Size, nil] + optional :size, union: -> { OpenAI::ImagesResponse::Size } # @!attribute usage # For `gpt-image-1` only, the token usage information for the image generation. @@ -62,9 +62,9 @@ class ImagesResponse < OpenAI::Internal::Type::BaseModel # # @param output_format [Symbol, OpenAI::Models::ImagesResponse::OutputFormat] The output format of the image generation. Either `png`, `webp`, or `jpeg`. # - # @param quality [Symbol, OpenAI::Models::ImagesResponse::Quality] The quality of the image generated. Either `low`, `medium`, or `high`. + # @param quality [Symbol, OpenAI::Models::ImagesResponse::Quality] The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or # - # @param size [Symbol, OpenAI::Models::ImagesResponse::Size] The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024` + # @param size [String, Symbol, OpenAI::Models::ImagesResponse::Size] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @param usage [OpenAI::Models::ImagesResponse::Usage] For `gpt-image-1` only, the token usage information for the image generation. @@ -96,7 +96,8 @@ module OutputFormat # @return [Array] end - # The quality of the image generated. Either `low`, `medium`, or `high`. + # The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or + # `max`. # # @see OpenAI::Models::ImagesResponse#quality module Quality @@ -105,24 +106,47 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max # @!method self.values # @return [Array] end - # The size of the image generated. Either `1024x1024`, `1024x1536`, or - # `1536x1024`. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. # # @see OpenAI::Models::ImagesResponse#size module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + variant const: -> { OpenAI::Models::ImagesResponse::Size::SIZE_1024X1024 } + + variant const: -> { OpenAI::Models::ImagesResponse::Size::SIZE_1024X1536 } + + variant const: -> { OpenAI::Models::ImagesResponse::Size::SIZE_1536X1024 } + + # Keep known dimensions as symbols when reading existing API responses. + variant String + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, OpenAI::ImagesResponse::Size::TaggedSymbol) } + end + + # @!group SIZE_1024X1024 = :"1024x1024" SIZE_1024X1536 = :"1024x1536" SIZE_1536X1024 = :"1536x1024" - # @!method self.values - # @return [Array] + # @!endgroup + + # Preserve the enum helper available before custom dimensions were supported. + # + # @return [Array] + def self.values = [SIZE_1024X1024, SIZE_1024X1536, SIZE_1536X1024] end # @see OpenAI::Models::ImagesResponse#usage diff --git a/lib/openai/models/responses/response_create_params.rb b/lib/openai/models/responses/response_create_params.rb index 6ac55dffd..d3f373ba1 100644 --- a/lib/openai/models/responses/response_create_params.rb +++ b/lib/openai/models/responses/response_create_params.rb @@ -260,6 +260,9 @@ class ResponseCreateParams < OpenAI::Internal::Type::BaseModel # @!attribute store # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). # # @return [Boolean, nil] optional :store, OpenAI::Internal::Type::Boolean, nil?: true diff --git a/lib/openai/models/responses/response_input_item.rb b/lib/openai/models/responses/response_input_item.rb index 7f023d948..19f3df219 100644 --- a/lib/openai/models/responses/response_input_item.rb +++ b/lib/openai/models/responses/response_input_item.rb @@ -627,7 +627,30 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # @return [Symbol, :image_generation_call] required :type, const: :image_generation_call - # @!method initialize(id:, result:, status:, type: :image_generation_call) + # @!attribute quality + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @return [Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Quality, nil] + optional( + :quality, + enum: -> { OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality }, + nil?: true + ) + + # @!attribute size + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @return [String, Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size, nil] + optional( + :size, + union: -> { + OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size + }, + nil?: true + ) + + # @!method initialize(id:, result:, status:, quality: nil, size: nil, type: :image_generation_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall} for more # details. @@ -640,6 +663,10 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Status] The status of the image generation call. # + # @param quality [Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo + # + # @param size [String, Symbol, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`. # The status of the image generation call. @@ -656,6 +683,62 @@ module Status # @!method self.values # @return [Array] end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @see OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall#quality + module Quality + extend OpenAI::Internal::Type::Enum + + LOW = :low + MEDIUM = :medium + HIGH = :high + XHIGH = :xhigh + MAX = :max + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @see OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall#size + module Size + extend OpenAI::Internal::Type::Union + + variant String + + variant( + const: -> { OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size::SIZE_1024X1024 } + ) + + variant( + const: -> { OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size::SIZE_1024X1536 } + ) + + variant( + const: -> { OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::Size::SIZE_1536X1024 } + ) + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { + T.any(String, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::TaggedSymbol) + } + end + + # @!group + + SIZE_1024X1024 = :"1024x1024" + SIZE_1024X1536 = :"1024x1536" + SIZE_1536X1024 = :"1536x1024" + + # @!endgroup + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/responses/response_item.rb b/lib/openai/models/responses/response_item.rb index 44bc4b7d6..7599bd8f4 100644 --- a/lib/openai/models/responses/response_item.rb +++ b/lib/openai/models/responses/response_item.rb @@ -277,7 +277,26 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # @return [Symbol, :image_generation_call] required :type, const: :image_generation_call - # @!method initialize(id:, result:, status:, type: :image_generation_call) + # @!attribute quality + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @return [Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Quality, nil] + optional( + :quality, + enum: -> { + OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality + }, + nil?: true + ) + + # @!attribute size + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @return [String, Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size, nil] + optional :size, union: -> { OpenAI::Responses::ResponseItem::ImageGenerationCall::Size }, nil?: true + + # @!method initialize(id:, result:, status:, quality: nil, size: nil, type: :image_generation_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Responses::ResponseItem::ImageGenerationCall} for more details. # @@ -289,6 +308,10 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # # @param status [Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Status] The status of the image generation call. # + # @param quality [Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo + # + # @param size [String, Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`. # The status of the image generation call. @@ -305,6 +328,54 @@ module Status # @!method self.values # @return [Array] end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @see OpenAI::Models::Responses::ResponseItem::ImageGenerationCall#quality + module Quality + extend OpenAI::Internal::Type::Enum + + LOW = :low + MEDIUM = :medium + HIGH = :high + XHIGH = :xhigh + MAX = :max + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @see OpenAI::Models::Responses::ResponseItem::ImageGenerationCall#size + module Size + extend OpenAI::Internal::Type::Union + + variant String + + variant const: -> { OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size::SIZE_1024X1024 } + + variant const: -> { OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size::SIZE_1024X1536 } + + variant const: -> { OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size::SIZE_1536X1024 } + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(String, OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::TaggedSymbol) } + end + + # @!group + + SIZE_1024X1024 = :"1024x1024" + SIZE_1024X1536 = :"1024x1536" + SIZE_1536X1024 = :"1536x1024" + + # @!endgroup + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/responses/response_output_item.rb b/lib/openai/models/responses/response_output_item.rb index 721e827fc..7b7fbef52 100644 --- a/lib/openai/models/responses/response_output_item.rb +++ b/lib/openai/models/responses/response_output_item.rb @@ -271,7 +271,30 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # @return [Symbol, :image_generation_call] required :type, const: :image_generation_call - # @!method initialize(id:, result:, status:, type: :image_generation_call) + # @!attribute quality + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @return [Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Quality, nil] + optional( + :quality, + enum: -> { OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality }, + nil?: true + ) + + # @!attribute size + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @return [String, Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size, nil] + optional( + :size, + union: -> { + OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size + }, + nil?: true + ) + + # @!method initialize(id:, result:, status:, quality: nil, size: nil, type: :image_generation_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall} for more # details. @@ -284,6 +307,10 @@ class ImageGenerationCall < OpenAI::Internal::Type::BaseModel # # @param status [Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Status] The status of the image generation call. # + # @param quality [Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Quality, nil] The quality of the image generated by the image generation tool call. One of `lo + # + # @param size [String, Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size, nil] The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # # @param type [Symbol, :image_generation_call] The type of the image generation call. Always `image_generation_call`. # The status of the image generation call. @@ -300,6 +327,62 @@ module Status # @!method self.values # @return [Array] end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + # + # @see OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall#quality + module Quality + extend OpenAI::Internal::Type::Enum + + LOW = :low + MEDIUM = :medium + HIGH = :high + XHIGH = :xhigh + MAX = :max + AUTO = :auto + + # @!method self.values + # @return [Array] + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + # + # @see OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall#size + module Size + extend OpenAI::Internal::Type::Union + + variant String + + variant( + const: -> { OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size::SIZE_1024X1024 } + ) + + variant( + const: -> { OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size::SIZE_1024X1536 } + ) + + variant( + const: -> { OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size::SIZE_1536X1024 } + ) + + # @!method self.variants + # @return [Array(String, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { + T.any(String, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol) + } + end + + # @!group + + SIZE_1024X1024 = :"1024x1024" + SIZE_1024X1536 = :"1024x1536" + SIZE_1536X1024 = :"1536x1024" + + # @!endgroup + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/responses/responses_client_event.rb b/lib/openai/models/responses/responses_client_event.rb index 0bb156c56..9d1f9d690 100644 --- a/lib/openai/models/responses/responses_client_event.rb +++ b/lib/openai/models/responses/responses_client_event.rb @@ -317,6 +317,9 @@ class ResponseCreate < OpenAI::Internal::Type::BaseModel # @!attribute store # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). # # @return [Boolean, nil] optional :store, OpenAI::Internal::Type::Boolean, nil?: true diff --git a/lib/openai/models/responses/tool.rb b/lib/openai/models/responses/tool.rb index 36a1acf3a..887ae884b 100644 --- a/lib/openai/models/responses/tool.rb +++ b/lib/openai/models/responses/tool.rb @@ -573,9 +573,11 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. # # @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Background, nil] optional :background, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Background } @@ -604,7 +606,9 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # @!attribute model # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. # # @return [String, Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Model, nil] @@ -637,24 +641,27 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel optional :partial_images, Integer # @!attribute quality - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. # # @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Quality, nil] optional :quality, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Quality } # @!attribute size - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. # # @return [String, Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Size, nil] optional :size, union: -> { OpenAI::Responses::Tool::ImageGeneration::Size } @@ -667,7 +674,7 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # # @param action [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Action] Whether to generate a new image or edit an existing image. Default: `auto`. # - # @param background [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Background] Allows to set transparency for the background of the generated image(s). + # @param background [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Background] Allows to set transparency for the background of the generated image(s). Must # # @param input_fidelity [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::InputFidelity, nil] Control how much effort the model will exert to match the style and features, es # @@ -683,9 +690,9 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel # # @param partial_images [Integer] Number of partial images to generate in streaming mode, from 0 (default value) t # - # @param quality [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Quality] The quality of the generated image. One of `low`, `medium`, `high`, + # @param quality [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Quality] The quality of the generated image. The GPT image models support `low`, # - # @param size [String, Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Size] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21` + # @param size [String, Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::Size] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, ` # # @param type [Symbol, :image_generation] The type of the image generation tool. Always `image_generation`. @@ -707,9 +714,11 @@ module Action # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. # # @see OpenAI::Models::Responses::Tool::ImageGeneration#background module Background @@ -767,7 +776,9 @@ class InputImageMask < OpenAI::Internal::Type::BaseModel end # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. # # @see OpenAI::Models::Responses::Tool::ImageGeneration#model @@ -784,6 +795,18 @@ module Model variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_2026_04_21 } + variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_SUNBURST } + + variant( + const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_SUNBURST_2026_09_08 } + ) + + variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_FLARE } + + variant( + const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_FLARE_2026_09_08 } + ) + variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::GPT_IMAGE_1_5 } variant const: -> { OpenAI::Models::Responses::Tool::ImageGeneration::Model::CHATGPT_IMAGE_LATEST } @@ -801,6 +824,10 @@ module Model GPT_IMAGE_1_MINI = :"gpt-image-1-mini" GPT_IMAGE_2 = :"gpt-image-2" GPT_IMAGE_2_2026_04_21 = :"gpt-image-2-2026-04-21" + GPT_IMAGE_2_5_SUNBURST = :"gpt-image-2.5-sunburst" + GPT_IMAGE_2_5_SUNBURST_2026_09_08 = :"gpt-image-2.5-sunburst-2026-09-08" + GPT_IMAGE_2_5_FLARE = :"gpt-image-2.5-flare" + GPT_IMAGE_2_5_FLARE_2026_09_08 = :"gpt-image-2.5-flare-2026-09-08" GPT_IMAGE_1_5 = :"gpt-image-1.5" CHATGPT_IMAGE_LATEST = :"chatgpt-image-latest" @@ -835,8 +862,10 @@ module OutputFormat # @return [Array] end - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. # # @see OpenAI::Models::Responses::Tool::ImageGeneration#quality module Quality @@ -845,23 +874,26 @@ module Quality LOW = :low MEDIUM = :medium HIGH = :high + XHIGH = :xhigh + MAX = :max AUTO = :auto # @!method self.values # @return [Array] end - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. # # @see OpenAI::Models::Responses::Tool::ImageGeneration#size module Size diff --git a/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb b/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb index 9b935f211..e2257fd81 100644 --- a/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb +++ b/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb @@ -55,8 +55,8 @@ class LiveCallIncomingWebhookEvent < OpenAI::Internal::Type::BaseModel # @see OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent#data class Data < OpenAI::Internal::Type::BaseModel # @!attribute session_id - # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears - # as `call_id` in `realtime.call.incoming`. + # The `live_...` ID of the pending SIP session. Forward this value unchanged when + # accepting or rejecting the call through the Live API. # # @return [String] required :session_id, String @@ -76,7 +76,7 @@ class Data < OpenAI::Internal::Type::BaseModel # # Event data payload. # - # @param session_id [String] The Transceiver `rtc_...` ID of the pending SIP session. The same + # @param session_id [String] The `live_...` ID of the pending SIP session. Forward this value # # @param sip_headers [Array] Headers from the SIP Invite. diff --git a/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb b/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb index 44ef843ea..7c6dcd673 100644 --- a/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +++ b/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb @@ -55,8 +55,10 @@ class RealtimeCallIncomingWebhookEvent < OpenAI::Internal::Type::BaseModel # @see OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent#data class Data < OpenAI::Internal::Type::BaseModel # @!attribute call_id - # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears - # as `session_id` in `live.call.incoming`. + # The Transceiver `rtc_...` ID of the pending SIP session. The paired + # `live.call.incoming` event derives its `session_id` by replacing the `rtc_` + # prefix with `live_`. Use the ID returned by the event with the corresponding + # Realtime or Live API. # # @return [String] required :call_id, String @@ -77,7 +79,7 @@ class Data < OpenAI::Internal::Type::BaseModel # # Event data payload. # - # @param call_id [String] The Transceiver `rtc_...` ID of the pending SIP session. The same + # @param call_id [String] The Transceiver `rtc_...` ID of the pending SIP session. The paired # # @param sip_headers [Array] Headers from the SIP Invite. diff --git a/lib/openai/resources/images.rb b/lib/openai/resources/images.rb index ad3fdc594..1c86d3deb 100644 --- a/lib/openai/resources/images.rb +++ b/lib/openai/resources/images.rb @@ -51,8 +51,7 @@ def create_variation(params) # {OpenAI::Models::ImageEditParams} for more details. # # Creates an edited or extended image given one or more source images and a - # prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - # `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + # prompt. This endpoint supports GPT Image models and `dall-e-2`. # # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload # metadata. Use `OpenAI::FilePart` when you need to override the filename or @@ -64,7 +63,7 @@ def create_variation(params) # # @param prompt [String] A text description of the desired image(s). The maximum length is 1000 character # - # @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil] Allows to set transparency for the background of the generated image(s). + # @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil] Allows to set transparency for the background of the generated image(s). Must # # @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil] Control how much effort the model will exert to match the style and features, es # @@ -80,11 +79,11 @@ def create_variation(params) # # @param partial_images [Integer, nil] The number of partial images to generate. This parameter is used for # - # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] The quality of the image that will be generated for GPT image models. Defaults t + # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] The quality of the image that will be generated for GPT image models. The GPT im # # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] The format in which the generated images are returned. Must be one of `url` or ` # - # @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21` + # @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, ` # # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor # @@ -117,8 +116,7 @@ def edit(params) # {OpenAI::Models::ImageEditParams} for more details. # # Creates an edited or extended image given one or more source images and a - # prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - # `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + # prompt. This endpoint supports GPT Image models and `dall-e-2`. # # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload # metadata. Use `OpenAI::FilePart` when you need to override the filename or @@ -130,7 +128,7 @@ def edit(params) # # @param prompt [String] A text description of the desired image(s). The maximum length is 1000 character # - # @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil] Allows to set transparency for the background of the generated image(s). + # @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil] Allows to set transparency for the background of the generated image(s). Must # # @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil] Control how much effort the model will exert to match the style and features, es # @@ -146,11 +144,11 @@ def edit(params) # # @param partial_images [Integer, nil] The number of partial images to generate. This parameter is used for # - # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] The quality of the image that will be generated for GPT image models. Defaults t + # @param quality [Symbol, OpenAI::Models::ImageEditParams::Quality, nil] The quality of the image that will be generated for GPT image models. The GPT im # # @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil] The format in which the generated images are returned. Must be one of `url` or ` # - # @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21` + # @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, ` # # @param user [String] A unique identifier representing your end-user, which can help OpenAI to monitor # @@ -195,7 +193,7 @@ def edit_stream_raw(params) # # @param prompt [String] A text description of the desired image(s). The maximum length is 32000 characte # - # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] Allows to set transparency for the background of the generated image(s). + # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] Allows to set transparency for the background of the generated image(s). Must # # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT i # @@ -213,7 +211,7 @@ def edit_stream_raw(params) # # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] The format in which generated images with `dall-e-2` and `dall-e-3` are returned # - # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21` + # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, ` # # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] The style of the generated images. This parameter is only supported for `dall-e- # @@ -253,7 +251,7 @@ def generate(params) # # @param prompt [String] A text description of the desired image(s). The maximum length is 32000 characte # - # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] Allows to set transparency for the background of the generated image(s). + # @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil] Allows to set transparency for the background of the generated image(s). Must # # @param model [String, Symbol, OpenAI::Models::ImageModel, nil] The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT i # @@ -271,7 +269,7 @@ def generate(params) # # @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil] The format in which generated images with `dall-e-2` and `dall-e-3` are returned # - # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. For `gpt-image-2` and `gpt-image-2-2026-04-21` + # @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil] The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, ` # # @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil] The style of the generated images. This parameter is only supported for `dall-e- # diff --git a/rbi/openai/models/beta/beta_response_input_item.rbi b/rbi/openai/models/beta/beta_response_input_item.rbi index 7932fe83b..fe5c6b61f 100644 --- a/rbi/openai/models/beta/beta_response_input_item.rbi +++ b/rbi/openai/models/beta/beta_response_input_item.rbi @@ -2109,6 +2109,17 @@ module OpenAI } attr_writer :agent + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + sig { returns(T.nilable(OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::OrSymbol)) } + attr_accessor :quality + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { + returns(T.nilable(T.any(String, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::OrSymbol))) + } + attr_accessor :size + # An image generation request made by the model. sig do params( @@ -2121,6 +2132,10 @@ module OpenAI agent: T.nilable(OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent::OrHash), + quality: T.nilable(OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::OrSymbol), + + size: T.nilable(T.any(String, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::OrSymbol)), + type: Symbol ) .returns(T.attached_class) @@ -2139,6 +2154,13 @@ module OpenAI # The agent that produced this item. agent: nil, + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + quality: nil, + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + size: nil, + # The type of the image generation call. Always `image_generation_call`. type: :image_generation_call @@ -2152,7 +2174,9 @@ module OpenAI result: T.nilable(String), status: OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Status::OrSymbol, type: Symbol, - agent: T.nilable(OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent) + agent: T.nilable(OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent), + quality: T.nilable(OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::OrSymbol), + size: T.nilable(T.any(String, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::OrSymbol)) } ) end @@ -2226,6 +2250,67 @@ module OpenAI end end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { + T.all(Symbol, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality) + } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = T.let(:low, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + + sig { + override.returns( + T::Array[OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol] + ) + } + def self.values + end + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + module Size + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { + T.any(String, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::TaggedSymbol) + } + + sig { + override.returns(T::Array[OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::Variants]) + } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size) + end + + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIZE_1024X1024 = T.let( + :"1024x1024", + OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1024X1536 = T.let( + :"1024x1536", + OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1536X1024 = T.let( + :"1536x1024", + OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Size::TaggedSymbol + ) + + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/rbi/openai/models/beta/beta_response_item.rbi b/rbi/openai/models/beta/beta_response_item.rbi index bde6c9d3e..ce38a3730 100644 --- a/rbi/openai/models/beta/beta_response_item.rbi +++ b/rbi/openai/models/beta/beta_response_item.rbi @@ -1360,6 +1360,15 @@ module OpenAI sig { params(agent: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent::OrHash)).void } attr_writer :agent + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + sig { returns(T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol)) } + attr_accessor :quality + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::Variants)) } + attr_accessor :size + # An image generation request made by the model. sig do params( @@ -1372,6 +1381,10 @@ module OpenAI agent: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent::OrHash), + quality: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::OrSymbol), + + size: T.nilable(T.any(String, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::OrSymbol)), + type: Symbol ) .returns(T.attached_class) @@ -1390,6 +1403,13 @@ module OpenAI # The agent that produced this item. agent: nil, + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + quality: nil, + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + size: nil, + # The type of the image generation call. Always `image_generation_call`. type: :image_generation_call @@ -1403,7 +1423,9 @@ module OpenAI result: T.nilable(String), status: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Status::TaggedSymbol, type: Symbol, - agent: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent) + agent: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent), + quality: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol), + size: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::Variants) } ) end @@ -1466,6 +1488,61 @@ module OpenAI end end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = T.let(:low, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + + sig { + override.returns(T::Array[OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol]) + } + def self.values + end + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + module Size + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { + T.any(String, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol) + } + + sig { override.returns(T::Array[OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::Variants]) } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size) + end + + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIZE_1024X1024 = T.let( + :"1024x1024", + OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1024X1536 = T.let( + :"1024x1536", + OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1536X1024 = T.let( + :"1536x1024", + OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol + ) + + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/rbi/openai/models/beta/beta_response_output_item.rbi b/rbi/openai/models/beta/beta_response_output_item.rbi index fd66416be..d19dca617 100644 --- a/rbi/openai/models/beta/beta_response_output_item.rbi +++ b/rbi/openai/models/beta/beta_response_output_item.rbi @@ -1390,6 +1390,15 @@ module OpenAI } attr_writer :agent + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + sig { returns(T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)) } + attr_accessor :quality + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::Variants)) } + attr_accessor :size + # An image generation request made by the model. sig do params( @@ -1402,6 +1411,10 @@ module OpenAI agent: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent::OrHash), + quality: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::OrSymbol), + + size: T.nilable(T.any(String, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::OrSymbol)), + type: Symbol ) .returns(T.attached_class) @@ -1420,6 +1433,13 @@ module OpenAI # The agent that produced this item. agent: nil, + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + quality: nil, + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + size: nil, + # The type of the image generation call. Always `image_generation_call`. type: :image_generation_call @@ -1433,7 +1453,9 @@ module OpenAI result: T.nilable(String), status: OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Status::TaggedSymbol, type: Symbol, - agent: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent) + agent: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent), + quality: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol), + size: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::Variants) } ) end @@ -1509,6 +1531,67 @@ module OpenAI end end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { + T.all(Symbol, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality) + } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = T.let(:low, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + + sig { + override.returns( + T::Array[OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol] + ) + } + def self.values + end + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + module Size + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { + T.any(String, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol) + } + + sig { + override.returns(T::Array[OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::Variants]) + } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size) + end + + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIZE_1024X1024 = T.let( + :"1024x1024", + OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1024X1536 = T.let( + :"1024x1536", + OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1536X1024 = T.let( + :"1536x1024", + OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol + ) + + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/rbi/openai/models/beta/beta_responses_client_event.rbi b/rbi/openai/models/beta/beta_responses_client_event.rbi index 8cbfa4edb..c0b5f07f3 100644 --- a/rbi/openai/models/beta/beta_responses_client_event.rbi +++ b/rbi/openai/models/beta/beta_responses_client_event.rbi @@ -264,6 +264,9 @@ module OpenAI attr_accessor :service_tier # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). sig { returns(T.nilable(T::Boolean)) } attr_accessor :store @@ -753,6 +756,9 @@ module OpenAI service_tier: nil, # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). store: nil, # If set to true, the model response data will be streamed to the client as it is diff --git a/rbi/openai/models/beta/beta_tool.rbi b/rbi/openai/models/beta/beta_tool.rbi index f1665c0a8..4322b5994 100644 --- a/rbi/openai/models/beta/beta_tool.rbi +++ b/rbi/openai/models/beta/beta_tool.rbi @@ -953,9 +953,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. sig { returns(T.nilable(OpenAI::Beta::BetaTool::ImageGeneration::Background::OrSymbol)) } attr_reader :background @@ -978,7 +980,9 @@ module OpenAI attr_writer :input_image_mask # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. sig { returns(T.nilable(T.any(String, OpenAI::Beta::BetaTool::ImageGeneration::Model::OrSymbol))) } attr_reader :model @@ -1016,25 +1020,28 @@ module OpenAI sig { params(partial_images: Integer).void } attr_writer :partial_images - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. sig { returns(T.nilable(OpenAI::Beta::BetaTool::ImageGeneration::Quality::OrSymbol)) } attr_reader :quality sig { params(quality: OpenAI::Beta::BetaTool::ImageGeneration::Quality::OrSymbol).void } attr_writer :quality - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. sig { returns(T.nilable(T.any(String, OpenAI::Beta::BetaTool::ImageGeneration::Size::OrSymbol))) } attr_reader :size @@ -1080,9 +1087,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. background: nil, # Control how much effort the model will exert to match the style and features, @@ -1096,7 +1105,9 @@ module OpenAI input_image_mask: nil, # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. model: nil, @@ -1114,21 +1125,24 @@ module OpenAI # to 3. partial_images: nil, - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. quality: nil, - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. size: nil, # The type of the image generation tool. Always `image_generation`. @@ -1178,9 +1192,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. module Background extend OpenAI::Internal::Type::Enum @@ -1269,7 +1285,9 @@ module OpenAI end # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. module Model extend OpenAI::Internal::Type::Union @@ -1293,6 +1311,22 @@ module OpenAI :"gpt-image-2-2026-04-21", OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol ) + GPT_IMAGE_2_5_SUNBURST = T.let( + :"gpt-image-2.5-sunburst", + OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol + ) + GPT_IMAGE_2_5_SUNBURST_2026_09_08 = T.let( + :"gpt-image-2.5-sunburst-2026-09-08", + OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol + ) + GPT_IMAGE_2_5_FLARE = T.let( + :"gpt-image-2.5-flare", + OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol + ) + GPT_IMAGE_2_5_FLARE_2026_09_08 = T.let( + :"gpt-image-2.5-flare-2026-09-08", + OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol + ) GPT_IMAGE_1_5 = T.let(:"gpt-image-1.5", OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol) CHATGPT_IMAGE_LATEST = T.let( :"chatgpt-image-latest", @@ -1333,8 +1367,10 @@ module OpenAI end end - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. module Quality extend OpenAI::Internal::Type::Enum @@ -1344,6 +1380,8 @@ module OpenAI LOW = T.let(:low, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol) AUTO = T.let(:auto, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol]) } @@ -1351,17 +1389,18 @@ module OpenAI end end - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. module Size extend OpenAI::Internal::Type::Union diff --git a/rbi/openai/models/beta/response_create_params.rbi b/rbi/openai/models/beta/response_create_params.rbi index dae32be71..a280907ea 100644 --- a/rbi/openai/models/beta/response_create_params.rbi +++ b/rbi/openai/models/beta/response_create_params.rbi @@ -229,6 +229,9 @@ module OpenAI attr_accessor :service_tier # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). sig { returns(T.nilable(T::Boolean)) } attr_accessor :store @@ -684,6 +687,9 @@ module OpenAI service_tier: nil, # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). store: nil, # Options for streaming responses. Only set this when you set `stream: true`. diff --git a/rbi/openai/models/conversations/conversation_item.rbi b/rbi/openai/models/conversations/conversation_item.rbi index dcbf2388e..26e065801 100644 --- a/rbi/openai/models/conversations/conversation_item.rbi +++ b/rbi/openai/models/conversations/conversation_item.rbi @@ -71,6 +71,17 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + sig { + returns(T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol)) + } + attr_accessor :quality + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::Variants)) } + attr_accessor :size + # An image generation request made by the model. sig do params( @@ -81,6 +92,12 @@ module OpenAI status: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Status::OrSymbol, + quality: T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::OrSymbol), + + size: T.nilable( + T.any(String, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::OrSymbol) + ), + type: Symbol ) .returns(T.attached_class) @@ -96,6 +113,13 @@ module OpenAI # The status of the image generation call. status:, + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + quality: nil, + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + size: nil, + # The type of the image generation call. Always `image_generation_call`. type: :image_generation_call @@ -108,7 +132,9 @@ module OpenAI id: String, result: T.nilable(String), status: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Status::TaggedSymbol, - type: Symbol + type: Symbol, + quality: T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol), + size: T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::Variants) } ) end @@ -146,6 +172,67 @@ module OpenAI def self.values end end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { + T.all(Symbol, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality) + } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = T.let(:low, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol) + + sig { + override.returns( + T::Array[OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol] + ) + } + def self.values + end + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + module Size + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { + T.any(String, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol) + } + + sig { + override.returns(T::Array[OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::Variants]) + } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size) + end + + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIZE_1024X1024 = T.let( + :"1024x1024", + OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1024X1536 = T.let( + :"1024x1536", + OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1536X1024 = T.let( + :"1536x1024", + OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol + ) + + end end class AdditionalTools < OpenAI::Internal::Type::BaseModel diff --git a/rbi/openai/models/image_edit_completed_event.rbi b/rbi/openai/models/image_edit_completed_event.rbi index 06dc3c990..b5d9e7a02 100644 --- a/rbi/openai/models/image_edit_completed_event.rbi +++ b/rbi/openai/models/image_edit_completed_event.rbi @@ -32,8 +32,8 @@ module OpenAI sig { returns(OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol) } attr_accessor :quality - # The size of the edited image. - sig { returns(OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol) } + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(OpenAI::ImageEditCompletedEvent::Size::Variants) } attr_accessor :size # The type of the event. Always `image_edit.completed`. @@ -62,7 +62,7 @@ module OpenAI quality: OpenAI::ImageEditCompletedEvent::Quality::OrSymbol, - size: OpenAI::ImageEditCompletedEvent::Size::OrSymbol, + size: T.any(String, OpenAI::ImageEditCompletedEvent::Size::OrSymbol), usage: OpenAI::ImageEditCompletedEvent::Usage::OrHash, @@ -87,7 +87,7 @@ module OpenAI # The quality setting for the edited image. quality:, - # The size of the edited image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. size:, # For the GPT image models only, the token usage information for the image @@ -108,7 +108,7 @@ module OpenAI created_at: Integer, output_format: OpenAI::ImageEditCompletedEvent::OutputFormat::TaggedSymbol, quality: OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol, - size: OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol, + size: OpenAI::ImageEditCompletedEvent::Size::Variants, type: Symbol, usage: OpenAI::ImageEditCompletedEvent::Usage } @@ -159,6 +159,8 @@ module OpenAI LOW = T.let(:low, OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::ImageEditCompletedEvent::Quality::TaggedSymbol]) } @@ -166,11 +168,20 @@ module OpenAI end end - # The size of the edited image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { T.any(String, OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol) } + + sig { override.returns(T::Array[OpenAI::ImageEditCompletedEvent::Size::Variants]) } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::ImageEditCompletedEvent::Size) + end - TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageEditCompletedEvent::Size) } OrSymbol = T.type_alias { T.any(Symbol, String) } SIZE_1024X1024 = T.let(:"1024x1024", OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol) @@ -178,7 +189,7 @@ module OpenAI SIZE_1536X1024 = T.let(:"1536x1024", OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol) - sig { override.returns(T::Array[OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol]) } + sig { returns(T::Array[OpenAI::ImageEditCompletedEvent::Size::TaggedSymbol]) } def self.values end end diff --git a/rbi/openai/models/image_edit_params.rbi b/rbi/openai/models/image_edit_params.rbi index 17fed4262..5c31783e4 100644 --- a/rbi/openai/models/image_edit_params.rbi +++ b/rbi/openai/models/image_edit_params.rbi @@ -18,9 +18,11 @@ module OpenAI # The image(s) to edit. Must be a supported image file or an array of images. # # For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - # `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - # should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - # 16 images. + # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), 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. @@ -40,9 +42,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. sig { returns(T.nilable(OpenAI::ImageEditParams::Background::OrSymbol)) } attr_accessor :background @@ -69,7 +73,9 @@ module OpenAI # The model to use for image generation. One of `dall-e-2` or a GPT image model # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - # `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to # `gpt-image-1.5`. sig { returns(T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol))) } attr_accessor :model @@ -99,8 +105,10 @@ module OpenAI sig { returns(T.nilable(Integer)) } attr_accessor :partial_images - # The quality of the image that will be generated for GPT image models. Defaults - # to `auto`. + # The quality of the image that will be generated for GPT image models. The GPT + # image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + # `xhigh` and `max`. Defaults to `auto`. sig { returns(T.nilable(OpenAI::ImageEditParams::Quality::OrSymbol)) } attr_accessor :quality @@ -111,17 +119,18 @@ module OpenAI sig { returns(T.nilable(OpenAI::ImageEditParams::ResponseFormat::OrSymbol)) } attr_accessor :response_format - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. sig { returns(T.nilable(T.any(String, OpenAI::ImageEditParams::Size::OrSymbol))) } attr_accessor :size @@ -174,9 +183,11 @@ module OpenAI # The image(s) to edit. Must be a supported image file or an array of images. # # For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - # `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - # should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - # 16 images. + # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), 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. @@ -194,9 +205,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. background: nil, # Control how much effort the model will exert to match the style and features, @@ -217,7 +230,9 @@ module OpenAI # The model to use for image generation. One of `dall-e-2` or a GPT image model # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - # `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to # `gpt-image-1.5`. model: nil, @@ -242,8 +257,10 @@ module OpenAI # are generated if the full image is generated more quickly. partial_images: nil, - # The quality of the image that will be generated for GPT image models. Defaults - # to `auto`. + # The quality of the image that will be generated for GPT image models. The GPT + # image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + # `xhigh` and `max`. Defaults to `auto`. quality: nil, # The format in which the generated images are returned. Must be one of `url` or @@ -252,17 +269,18 @@ module OpenAI # `dall-e-2`), as GPT image models always return base64-encoded images. response_format: nil, - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. size: nil, # A unique identifier representing your end-user, which can help OpenAI to monitor @@ -301,9 +319,11 @@ module OpenAI # The image(s) to edit. Must be a supported image file or an array of images. # # For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - # `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - # should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - # 16 images. + # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), 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. @@ -327,9 +347,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. module Background extend OpenAI::Internal::Type::Enum @@ -365,7 +387,9 @@ module OpenAI # The model to use for image generation. One of `dall-e-2` or a GPT image model # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - # `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to # `gpt-image-1.5`. module Model extend OpenAI::Internal::Type::Union @@ -396,8 +420,10 @@ module OpenAI end end - # The quality of the image that will be generated for GPT image models. Defaults - # to `auto`. + # The quality of the image that will be generated for GPT image models. The GPT + # image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + # `xhigh` and `max`. Defaults to `auto`. module Quality extend OpenAI::Internal::Type::Enum @@ -408,6 +434,8 @@ module OpenAI LOW = T.let(:low, OpenAI::ImageEditParams::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::ImageEditParams::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::ImageEditParams::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::ImageEditParams::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::ImageEditParams::Quality::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageEditParams::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::ImageEditParams::Quality::TaggedSymbol]) } @@ -433,17 +461,18 @@ module OpenAI end end - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. module Size extend OpenAI::Internal::Type::Union diff --git a/rbi/openai/models/image_edit_partial_image_event.rbi b/rbi/openai/models/image_edit_partial_image_event.rbi index 74bfeb1b8..60d9b3ada 100644 --- a/rbi/openai/models/image_edit_partial_image_event.rbi +++ b/rbi/openai/models/image_edit_partial_image_event.rbi @@ -36,8 +36,8 @@ module OpenAI sig { returns(OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol) } attr_accessor :quality - # The size of the requested edited image. - sig { returns(OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol) } + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(OpenAI::ImageEditPartialImageEvent::Size::Variants) } attr_accessor :size # The type of the event. Always `image_edit.partial_image`. @@ -60,7 +60,7 @@ module OpenAI quality: OpenAI::ImageEditPartialImageEvent::Quality::OrSymbol, - size: OpenAI::ImageEditPartialImageEvent::Size::OrSymbol, + size: T.any(String, OpenAI::ImageEditPartialImageEvent::Size::OrSymbol), type: Symbol ) @@ -86,7 +86,7 @@ module OpenAI # The quality setting for the requested edited image. quality:, - # The size of the requested edited image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. size:, # The type of the event. Always `image_edit.partial_image`. @@ -104,7 +104,7 @@ module OpenAI output_format: OpenAI::ImageEditPartialImageEvent::OutputFormat::TaggedSymbol, partial_image_index: Integer, quality: OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol, - size: OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol, + size: OpenAI::ImageEditPartialImageEvent::Size::Variants, type: Symbol } ) @@ -154,6 +154,8 @@ module OpenAI LOW = T.let(:low, OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::ImageEditPartialImageEvent::Quality::TaggedSymbol]) } @@ -161,11 +163,20 @@ module OpenAI end end - # The size of the requested edited image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { T.any(String, OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol) } + + sig { override.returns(T::Array[OpenAI::ImageEditPartialImageEvent::Size::Variants]) } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::ImageEditPartialImageEvent::Size) + end - TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageEditPartialImageEvent::Size) } OrSymbol = T.type_alias { T.any(Symbol, String) } SIZE_1024X1024 = T.let(:"1024x1024", OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol) @@ -173,7 +184,7 @@ module OpenAI SIZE_1536X1024 = T.let(:"1536x1024", OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol) - sig { override.returns(T::Array[OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol]) } + sig { returns(T::Array[OpenAI::ImageEditPartialImageEvent::Size::TaggedSymbol]) } def self.values end end diff --git a/rbi/openai/models/image_gen_completed_event.rbi b/rbi/openai/models/image_gen_completed_event.rbi index bcea413a7..2b9a2d719 100644 --- a/rbi/openai/models/image_gen_completed_event.rbi +++ b/rbi/openai/models/image_gen_completed_event.rbi @@ -32,8 +32,8 @@ module OpenAI sig { returns(OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol) } attr_accessor :quality - # The size of the generated image. - sig { returns(OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol) } + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(OpenAI::ImageGenCompletedEvent::Size::Variants) } attr_accessor :size # The type of the event. Always `image_generation.completed`. @@ -62,7 +62,7 @@ module OpenAI quality: OpenAI::ImageGenCompletedEvent::Quality::OrSymbol, - size: OpenAI::ImageGenCompletedEvent::Size::OrSymbol, + size: T.any(String, OpenAI::ImageGenCompletedEvent::Size::OrSymbol), usage: OpenAI::ImageGenCompletedEvent::Usage::OrHash, @@ -87,7 +87,7 @@ module OpenAI # The quality setting for the generated image. quality:, - # The size of the generated image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. size:, # For the GPT image models only, the token usage information for the image @@ -108,7 +108,7 @@ module OpenAI created_at: Integer, output_format: OpenAI::ImageGenCompletedEvent::OutputFormat::TaggedSymbol, quality: OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol, - size: OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol, + size: OpenAI::ImageGenCompletedEvent::Size::Variants, type: Symbol, usage: OpenAI::ImageGenCompletedEvent::Usage } @@ -159,6 +159,8 @@ module OpenAI LOW = T.let(:low, OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::ImageGenCompletedEvent::Quality::TaggedSymbol]) } @@ -166,11 +168,20 @@ module OpenAI end end - # The size of the generated image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { T.any(String, OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol) } + + sig { override.returns(T::Array[OpenAI::ImageGenCompletedEvent::Size::Variants]) } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::ImageGenCompletedEvent::Size) + end - TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageGenCompletedEvent::Size) } OrSymbol = T.type_alias { T.any(Symbol, String) } SIZE_1024X1024 = T.let(:"1024x1024", OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol) @@ -178,7 +189,7 @@ module OpenAI SIZE_1536X1024 = T.let(:"1536x1024", OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol) - sig { override.returns(T::Array[OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol]) } + sig { returns(T::Array[OpenAI::ImageGenCompletedEvent::Size::TaggedSymbol]) } def self.values end end diff --git a/rbi/openai/models/image_gen_partial_image_event.rbi b/rbi/openai/models/image_gen_partial_image_event.rbi index 7454bd2a6..024634a2c 100644 --- a/rbi/openai/models/image_gen_partial_image_event.rbi +++ b/rbi/openai/models/image_gen_partial_image_event.rbi @@ -36,8 +36,8 @@ module OpenAI sig { returns(OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol) } attr_accessor :quality - # The size of the requested image. - sig { returns(OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol) } + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(OpenAI::ImageGenPartialImageEvent::Size::Variants) } attr_accessor :size # The type of the event. Always `image_generation.partial_image`. @@ -60,7 +60,7 @@ module OpenAI quality: OpenAI::ImageGenPartialImageEvent::Quality::OrSymbol, - size: OpenAI::ImageGenPartialImageEvent::Size::OrSymbol, + size: T.any(String, OpenAI::ImageGenPartialImageEvent::Size::OrSymbol), type: Symbol ) @@ -86,7 +86,7 @@ module OpenAI # The quality setting for the requested image. quality:, - # The size of the requested image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. size:, # The type of the event. Always `image_generation.partial_image`. @@ -104,7 +104,7 @@ module OpenAI output_format: OpenAI::ImageGenPartialImageEvent::OutputFormat::TaggedSymbol, partial_image_index: Integer, quality: OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol, - size: OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol, + size: OpenAI::ImageGenPartialImageEvent::Size::Variants, type: Symbol } ) @@ -154,6 +154,8 @@ module OpenAI LOW = T.let(:low, OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::ImageGenPartialImageEvent::Quality::TaggedSymbol]) } @@ -161,11 +163,20 @@ module OpenAI end end - # The size of the requested image. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { T.any(String, OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol) } + + sig { override.returns(T::Array[OpenAI::ImageGenPartialImageEvent::Size::Variants]) } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::ImageGenPartialImageEvent::Size) + end - TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageGenPartialImageEvent::Size) } OrSymbol = T.type_alias { T.any(Symbol, String) } SIZE_1024X1024 = T.let(:"1024x1024", OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol) @@ -173,7 +184,7 @@ module OpenAI SIZE_1536X1024 = T.let(:"1536x1024", OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol) - sig { override.returns(T::Array[OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol]) } + sig { returns(T::Array[OpenAI::ImageGenPartialImageEvent::Size::TaggedSymbol]) } def self.values end end diff --git a/rbi/openai/models/image_generate_params.rbi b/rbi/openai/models/image_generate_params.rbi index 803a003e4..cd2d2f2b0 100644 --- a/rbi/openai/models/image_generate_params.rbi +++ b/rbi/openai/models/image_generate_params.rbi @@ -25,16 +25,20 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. sig { returns(T.nilable(OpenAI::ImageGenerateParams::Background::OrSymbol)) } attr_accessor :background # 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`, `gpt-image-2`, - # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - # to the GPT image models is used. + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + # specific to the GPT image models is used. sig { returns(T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol))) } attr_accessor :model @@ -74,6 +78,8 @@ module OpenAI # - `auto` (default value) will automatically select the best quality for the # given model. # - `high`, `medium` and `low` are supported for the GPT image models. + # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + # `2026-09-08` snapshots, also support `xhigh` and `max`. # - `hd` and `standard` are supported for `dall-e-3`. # - `standard` is the only option for `dall-e-2`. sig { returns(T.nilable(OpenAI::ImageGenerateParams::Quality::OrSymbol)) } @@ -86,17 +92,18 @@ module OpenAI sig { returns(T.nilable(OpenAI::ImageGenerateParams::ResponseFormat::OrSymbol)) } attr_accessor :response_format - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. sig { returns(T.nilable(T.any(String, OpenAI::ImageGenerateParams::Size::OrSymbol))) } attr_accessor :size @@ -160,15 +167,19 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. background: nil, # 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`, `gpt-image-2`, - # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - # to the GPT image models is used. + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + # specific to the GPT image models is used. model: nil, # Control the content-moderation level for images generated by the GPT image @@ -202,6 +213,8 @@ module OpenAI # - `auto` (default value) will automatically select the best quality for the # given model. # - `high`, `medium` and `low` are supported for the GPT image models. + # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + # `2026-09-08` snapshots, also support `xhigh` and `max`. # - `hd` and `standard` are supported for `dall-e-3`. # - `standard` is the only option for `dall-e-2`. quality: nil, @@ -212,17 +225,18 @@ module OpenAI # image models, which always return base64-encoded images. response_format: nil, - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. size: nil, # The style of the generated images. This parameter is only supported for @@ -267,9 +281,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. module Background extend OpenAI::Internal::Type::Enum @@ -287,8 +303,10 @@ module OpenAI # 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`, `gpt-image-2`, - # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - # to the GPT image models is used. + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + # specific to the GPT image models is used. module Model extend OpenAI::Internal::Type::Union @@ -339,6 +357,8 @@ module OpenAI # - `auto` (default value) will automatically select the best quality for the # given model. # - `high`, `medium` and `low` are supported for the GPT image models. + # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + # `2026-09-08` snapshots, also support `xhigh` and `max`. # - `hd` and `standard` are supported for `dall-e-3`. # - `standard` is the only option for `dall-e-2`. module Quality @@ -352,6 +372,8 @@ module OpenAI LOW = T.let(:low, OpenAI::ImageGenerateParams::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::ImageGenerateParams::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::ImageGenerateParams::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::ImageGenerateParams::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::ImageGenerateParams::Quality::TaggedSymbol) AUTO = T.let(:auto, OpenAI::ImageGenerateParams::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::ImageGenerateParams::Quality::TaggedSymbol]) } @@ -377,17 +399,18 @@ module OpenAI end end - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. module Size extend OpenAI::Internal::Type::Union diff --git a/rbi/openai/models/image_model.rbi b/rbi/openai/models/image_model.rbi index 8a6be5a8f..758dce868 100644 --- a/rbi/openai/models/image_model.rbi +++ b/rbi/openai/models/image_model.rbi @@ -13,6 +13,10 @@ module OpenAI GPT_IMAGE_1_MINI = T.let(:"gpt-image-1-mini", OpenAI::ImageModel::TaggedSymbol) GPT_IMAGE_2 = T.let(:"gpt-image-2", OpenAI::ImageModel::TaggedSymbol) GPT_IMAGE_2_2026_04_21 = T.let(:"gpt-image-2-2026-04-21", OpenAI::ImageModel::TaggedSymbol) + GPT_IMAGE_2_5_SUNBURST = T.let(:"gpt-image-2.5-sunburst", OpenAI::ImageModel::TaggedSymbol) + GPT_IMAGE_2_5_SUNBURST_2026_09_08 = T.let(:"gpt-image-2.5-sunburst-2026-09-08", OpenAI::ImageModel::TaggedSymbol) + GPT_IMAGE_2_5_FLARE = T.let(:"gpt-image-2.5-flare", OpenAI::ImageModel::TaggedSymbol) + GPT_IMAGE_2_5_FLARE_2026_09_08 = T.let(:"gpt-image-2.5-flare-2026-09-08", OpenAI::ImageModel::TaggedSymbol) GPT_IMAGE_1_5 = T.let(:"gpt-image-1.5", OpenAI::ImageModel::TaggedSymbol) CHATGPT_IMAGE_LATEST = T.let(:"chatgpt-image-latest", OpenAI::ImageModel::TaggedSymbol) DALL_E_2 = T.let(:"dall-e-2", OpenAI::ImageModel::TaggedSymbol) diff --git a/rbi/openai/models/images_response.rbi b/rbi/openai/models/images_response.rbi index b1b13491f..ec7eb0d90 100644 --- a/rbi/openai/models/images_response.rbi +++ b/rbi/openai/models/images_response.rbi @@ -38,19 +38,19 @@ module OpenAI sig { params(output_format: OpenAI::ImagesResponse::OutputFormat::OrSymbol).void } attr_writer :output_format - # The quality of the image generated. Either `low`, `medium`, or `high`. + # The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or + # `max`. sig { returns(T.nilable(OpenAI::ImagesResponse::Quality::TaggedSymbol)) } attr_reader :quality sig { params(quality: OpenAI::ImagesResponse::Quality::OrSymbol).void } attr_writer :quality - # The size of the image generated. Either `1024x1024`, `1024x1536`, or - # `1536x1024`. - sig { returns(T.nilable(OpenAI::ImagesResponse::Size::TaggedSymbol)) } + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(T.nilable(OpenAI::ImagesResponse::Size::Variants)) } attr_reader :size - sig { params(size: OpenAI::ImagesResponse::Size::OrSymbol).void } + sig { params(size: T.any(String, OpenAI::ImagesResponse::Size::OrSymbol)).void } attr_writer :size # For `gpt-image-1` only, the token usage information for the image generation. @@ -74,7 +74,7 @@ module OpenAI quality: OpenAI::ImagesResponse::Quality::OrSymbol, - size: OpenAI::ImagesResponse::Size::OrSymbol, + size: T.any(String, OpenAI::ImagesResponse::Size::OrSymbol), usage: OpenAI::ImagesResponse::Usage::OrHash ) @@ -95,11 +95,11 @@ module OpenAI # The output format of the image generation. Either `png`, `webp`, or `jpeg`. output_format: nil, - # The quality of the image generated. Either `low`, `medium`, or `high`. + # The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or + # `max`. quality: nil, - # The size of the image generated. Either `1024x1024`, `1024x1536`, or - # `1536x1024`. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. size: nil, # For `gpt-image-1` only, the token usage information for the image generation. @@ -116,7 +116,7 @@ module OpenAI data: T::Array[OpenAI::Image], output_format: OpenAI::ImagesResponse::OutputFormat::TaggedSymbol, quality: OpenAI::ImagesResponse::Quality::TaggedSymbol, - size: OpenAI::ImagesResponse::Size::TaggedSymbol, + size: OpenAI::ImagesResponse::Size::Variants, usage: OpenAI::ImagesResponse::Usage } ) @@ -156,7 +156,8 @@ module OpenAI end end - # The quality of the image generated. Either `low`, `medium`, or `high`. + # The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or + # `max`. module Quality extend OpenAI::Internal::Type::Enum @@ -166,25 +167,35 @@ module OpenAI LOW = T.let(:low, OpenAI::ImagesResponse::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::ImagesResponse::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::ImagesResponse::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::ImagesResponse::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::ImagesResponse::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::ImagesResponse::Quality::TaggedSymbol]) } def self.values end end - # The size of the image generated. Either `1024x1024`, `1024x1536`, or - # `1536x1024`. + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { T.any(String, OpenAI::ImagesResponse::Size::TaggedSymbol) } + + sig { override.returns(T::Array[OpenAI::ImagesResponse::Size::Variants]) } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::ImagesResponse::Size) + end - TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImagesResponse::Size) } OrSymbol = T.type_alias { T.any(Symbol, String) } SIZE_1024X1024 = T.let(:"1024x1024", OpenAI::ImagesResponse::Size::TaggedSymbol) SIZE_1024X1536 = T.let(:"1024x1536", OpenAI::ImagesResponse::Size::TaggedSymbol) SIZE_1536X1024 = T.let(:"1536x1024", OpenAI::ImagesResponse::Size::TaggedSymbol) - sig { override.returns(T::Array[OpenAI::ImagesResponse::Size::TaggedSymbol]) } + sig { returns(T::Array[OpenAI::ImagesResponse::Size::TaggedSymbol]) } def self.values end end diff --git a/rbi/openai/models/responses/response_create_params.rbi b/rbi/openai/models/responses/response_create_params.rbi index b751f7239..1d007711a 100644 --- a/rbi/openai/models/responses/response_create_params.rbi +++ b/rbi/openai/models/responses/response_create_params.rbi @@ -231,6 +231,9 @@ module OpenAI attr_accessor :service_tier # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). sig { returns(T.nilable(T::Boolean)) } attr_accessor :store @@ -682,6 +685,9 @@ module OpenAI service_tier: nil, # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). store: nil, # Options for streaming responses. Only set this when you set `stream: true`. diff --git a/rbi/openai/models/responses/response_input_item.rbi b/rbi/openai/models/responses/response_input_item.rbi index 31eacd741..f7a810f56 100644 --- a/rbi/openai/models/responses/response_input_item.rbi +++ b/rbi/openai/models/responses/response_input_item.rbi @@ -956,6 +956,17 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + sig { returns(T.nilable(OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::OrSymbol)) } + attr_accessor :quality + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { + returns(T.nilable(T.any(String, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::OrSymbol))) + } + attr_accessor :size + # An image generation request made by the model. sig do params( @@ -966,6 +977,10 @@ module OpenAI status: OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Status::OrSymbol, + quality: T.nilable(OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::OrSymbol), + + size: T.nilable(T.any(String, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::OrSymbol)), + type: Symbol ) .returns(T.attached_class) @@ -981,6 +996,13 @@ module OpenAI # The status of the image generation call. status:, + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + quality: nil, + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + size: nil, + # The type of the image generation call. Always `image_generation_call`. type: :image_generation_call @@ -993,7 +1015,11 @@ module OpenAI id: String, result: T.nilable(String), status: OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Status::OrSymbol, - type: Symbol + type: Symbol, + quality: T.nilable(OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::OrSymbol), + size: T.nilable( + T.any(String, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::OrSymbol) + ) } ) end @@ -1031,6 +1057,67 @@ module OpenAI def self.values end end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { + T.all(Symbol, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality) + } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = T.let(:low, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol) + + sig { + override.returns( + T::Array[OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Quality::TaggedSymbol] + ) + } + def self.values + end + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + module Size + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { + T.any(String, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::TaggedSymbol) + } + + sig { + override.returns(T::Array[OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::Variants]) + } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size) + end + + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIZE_1024X1024 = T.let( + :"1024x1024", + OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1024X1536 = T.let( + :"1024x1536", + OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1536X1024 = T.let( + :"1536x1024", + OpenAI::Responses::ResponseInputItem::ImageGenerationCall::Size::TaggedSymbol + ) + + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/rbi/openai/models/responses/response_item.rbi b/rbi/openai/models/responses/response_item.rbi index 8aeb96e3f..7bd5e497e 100644 --- a/rbi/openai/models/responses/response_item.rbi +++ b/rbi/openai/models/responses/response_item.rbi @@ -342,6 +342,15 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + sig { returns(T.nilable(OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol)) } + attr_accessor :quality + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(T.nilable(OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::Variants)) } + attr_accessor :size + # An image generation request made by the model. sig do params( @@ -352,6 +361,10 @@ module OpenAI status: OpenAI::Responses::ResponseItem::ImageGenerationCall::Status::OrSymbol, + quality: T.nilable(OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::OrSymbol), + + size: T.nilable(T.any(String, OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::OrSymbol)), + type: Symbol ) .returns(T.attached_class) @@ -367,6 +380,13 @@ module OpenAI # The status of the image generation call. status:, + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + quality: nil, + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + size: nil, + # The type of the image generation call. Always `image_generation_call`. type: :image_generation_call @@ -379,7 +399,9 @@ module OpenAI id: String, result: T.nilable(String), status: OpenAI::Responses::ResponseItem::ImageGenerationCall::Status::TaggedSymbol, - type: Symbol + type: Symbol, + quality: T.nilable(OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol), + size: T.nilable(OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::Variants) } ) end @@ -407,6 +429,63 @@ module OpenAI def self.values end end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { + T.all(Symbol, OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality) + } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = T.let(:low, OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol) + + sig { + override.returns(T::Array[OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality::TaggedSymbol]) + } + def self.values + end + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + module Size + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { + T.any(String, OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::TaggedSymbol) + } + + sig { override.returns(T::Array[OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::Variants]) } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::Responses::ResponseItem::ImageGenerationCall::Size) + end + + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIZE_1024X1024 = T.let( + :"1024x1024", + OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1024X1536 = T.let( + :"1024x1536", + OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1536X1024 = T.let( + :"1536x1024", + OpenAI::Responses::ResponseItem::ImageGenerationCall::Size::TaggedSymbol + ) + + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/rbi/openai/models/responses/response_output_item.rbi b/rbi/openai/models/responses/response_output_item.rbi index 23c1fcdf2..cebc0d27d 100644 --- a/rbi/openai/models/responses/response_output_item.rbi +++ b/rbi/openai/models/responses/response_output_item.rbi @@ -347,6 +347,15 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + sig { returns(T.nilable(OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)) } + attr_accessor :quality + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + sig { returns(T.nilable(OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::Variants)) } + attr_accessor :size + # An image generation request made by the model. sig do params( @@ -357,6 +366,10 @@ module OpenAI status: OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Status::OrSymbol, + quality: T.nilable(OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::OrSymbol), + + size: T.nilable(T.any(String, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::OrSymbol)), + type: Symbol ) .returns(T.attached_class) @@ -372,6 +385,13 @@ module OpenAI # The status of the image generation call. status:, + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + quality: nil, + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + size: nil, + # The type of the image generation call. Always `image_generation_call`. type: :image_generation_call @@ -384,7 +404,9 @@ module OpenAI id: String, result: T.nilable(String), status: OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Status::TaggedSymbol, - type: Symbol + type: Symbol, + quality: T.nilable(OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol), + size: T.nilable(OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::Variants) } ) end @@ -422,6 +444,67 @@ module OpenAI def self.values end end + + # The quality of the image generated by the image generation tool call. One of + # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`. + module Quality + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = T.type_alias { + T.all(Symbol, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality) + } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = T.let(:low, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + MEDIUM = T.let(:medium, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + HIGH = T.let(:high, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + AUTO = T.let(:auto, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol) + + sig { + override.returns( + T::Array[OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol] + ) + } + def self.values + end + end + + # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`. + module Size + extend OpenAI::Internal::Type::Union + + Variants = T.type_alias { + T.any(String, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol) + } + + sig { + override.returns(T::Array[OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::Variants]) + } + def self.variants + end + + TaggedSymbol = T.type_alias do + T.all(Symbol, OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size) + end + + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIZE_1024X1024 = T.let( + :"1024x1024", + OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1024X1536 = T.let( + :"1024x1536", + OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol + ) + SIZE_1536X1024 = T.let( + :"1536x1024", + OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol + ) + + end end class LocalShellCall < OpenAI::Internal::Type::BaseModel diff --git a/rbi/openai/models/responses/responses_client_event.rbi b/rbi/openai/models/responses/responses_client_event.rbi index 434d8f35d..fc73f88e5 100644 --- a/rbi/openai/models/responses/responses_client_event.rbi +++ b/rbi/openai/models/responses/responses_client_event.rbi @@ -256,6 +256,9 @@ module OpenAI attr_accessor :service_tier # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). sig { returns(T.nilable(T::Boolean)) } attr_accessor :store @@ -740,6 +743,9 @@ module OpenAI service_tier: nil, # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). store: nil, # If set to true, the model response data will be streamed to the client as it is diff --git a/rbi/openai/models/responses/tool.rbi b/rbi/openai/models/responses/tool.rbi index f55cada0c..44a52cbfe 100644 --- a/rbi/openai/models/responses/tool.rbi +++ b/rbi/openai/models/responses/tool.rbi @@ -954,9 +954,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. sig { returns(T.nilable(OpenAI::Responses::Tool::ImageGeneration::Background::OrSymbol)) } attr_reader :background @@ -979,7 +981,9 @@ module OpenAI attr_writer :input_image_mask # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. sig { returns(T.nilable(T.any(String, OpenAI::Responses::Tool::ImageGeneration::Model::OrSymbol))) } attr_reader :model @@ -1017,25 +1021,28 @@ module OpenAI sig { params(partial_images: Integer).void } attr_writer :partial_images - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. sig { returns(T.nilable(OpenAI::Responses::Tool::ImageGeneration::Quality::OrSymbol)) } attr_reader :quality sig { params(quality: OpenAI::Responses::Tool::ImageGeneration::Quality::OrSymbol).void } attr_writer :quality - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. sig { returns(T.nilable(T.any(String, OpenAI::Responses::Tool::ImageGeneration::Size::OrSymbol))) } attr_reader :size @@ -1081,9 +1088,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. background: nil, # Control how much effort the model will exert to match the style and features, @@ -1097,7 +1106,9 @@ module OpenAI input_image_mask: nil, # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. model: nil, @@ -1115,21 +1126,24 @@ module OpenAI # to 3. partial_images: nil, - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. quality: nil, - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. size: nil, # The type of the image generation tool. Always `image_generation`. @@ -1179,9 +1193,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. module Background extend OpenAI::Internal::Type::Enum @@ -1270,7 +1286,9 @@ module OpenAI end # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`, - # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or + # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or # `chatgpt-image-latest`. Default: `gpt-image-1`. module Model extend OpenAI::Internal::Type::Union @@ -1294,6 +1312,22 @@ module OpenAI :"gpt-image-2-2026-04-21", OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol ) + GPT_IMAGE_2_5_SUNBURST = T.let( + :"gpt-image-2.5-sunburst", + OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol + ) + GPT_IMAGE_2_5_SUNBURST_2026_09_08 = T.let( + :"gpt-image-2.5-sunburst-2026-09-08", + OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol + ) + GPT_IMAGE_2_5_FLARE = T.let( + :"gpt-image-2.5-flare", + OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol + ) + GPT_IMAGE_2_5_FLARE_2026_09_08 = T.let( + :"gpt-image-2.5-flare-2026-09-08", + OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol + ) GPT_IMAGE_1_5 = T.let(:"gpt-image-1.5", OpenAI::Responses::Tool::ImageGeneration::Model::TaggedSymbol) CHATGPT_IMAGE_LATEST = T.let( :"chatgpt-image-latest", @@ -1334,8 +1368,10 @@ module OpenAI end end - # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. - # Default: `auto`. + # The quality of the generated image. The GPT image models support `low`, + # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, + # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default: + # `auto`. module Quality extend OpenAI::Internal::Type::Enum @@ -1345,6 +1381,8 @@ module OpenAI LOW = T.let(:low, OpenAI::Responses::Tool::ImageGeneration::Quality::TaggedSymbol) MEDIUM = T.let(:medium, OpenAI::Responses::Tool::ImageGeneration::Quality::TaggedSymbol) HIGH = T.let(:high, OpenAI::Responses::Tool::ImageGeneration::Quality::TaggedSymbol) + XHIGH = T.let(:xhigh, OpenAI::Responses::Tool::ImageGeneration::Quality::TaggedSymbol) + MAX = T.let(:max, OpenAI::Responses::Tool::ImageGeneration::Quality::TaggedSymbol) AUTO = T.let(:auto, OpenAI::Responses::Tool::ImageGeneration::Quality::TaggedSymbol) sig { override.returns(T::Array[OpenAI::Responses::Tool::ImageGeneration::Quality::TaggedSymbol]) } @@ -1352,17 +1390,18 @@ module OpenAI end end - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. module Size extend OpenAI::Internal::Type::Union diff --git a/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi b/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi index 824e46df1..6870f1171 100644 --- a/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi +++ b/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi @@ -100,8 +100,8 @@ module OpenAI ) end - # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears - # as `call_id` in `realtime.call.incoming`. + # The `live_...` ID of the pending SIP session. Forward this value unchanged when + # accepting or rejecting the call through the Live API. sig { returns(String) } attr_accessor :session_id @@ -121,8 +121,8 @@ module OpenAI end def self.new( - # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears - # as `call_id` in `realtime.call.incoming`. + # The `live_...` ID of the pending SIP session. Forward this value unchanged when + # accepting or rejecting the call through the Live API. session_id:, # Headers from the SIP Invite. diff --git a/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi b/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi index a469448d5..3799ed0b8 100644 --- a/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +++ b/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi @@ -100,8 +100,10 @@ module OpenAI ) end - # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears - # as `session_id` in `live.call.incoming`. + # The Transceiver `rtc_...` ID of the pending SIP session. The paired + # `live.call.incoming` event derives its `session_id` by replacing the `rtc_` + # prefix with `live_`. Use the ID returned by the event with the corresponding + # Realtime or Live API. sig { returns(String) } attr_accessor :call_id @@ -121,8 +123,10 @@ module OpenAI end def self.new( - # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears - # as `session_id` in `live.call.incoming`. + # The Transceiver `rtc_...` ID of the pending SIP session. The paired + # `live.call.incoming` event derives its `session_id` by replacing the `rtc_` + # prefix with `live_`. Use the ID returned by the event with the corresponding + # Realtime or Live API. call_id:, # Headers from the SIP Invite. diff --git a/rbi/openai/resources/beta/responses.rbi b/rbi/openai/resources/beta/responses.rbi index c112bdbfd..ed89e1137 100644 --- a/rbi/openai/resources/beta/responses.rbi +++ b/rbi/openai/resources/beta/responses.rbi @@ -247,7 +247,9 @@ module OpenAI # parameter. service_tier: nil, # Body param: Whether to store the generated model response for later retrieval - # via API. + # via API. Defaults to true when omitted. If set to true, response data will be + # stored for at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). store: nil, # Body param: Options for streaming responses. Only set this when you set # `stream: true`. @@ -561,7 +563,9 @@ module OpenAI # parameter. service_tier: nil, # Body param: Whether to store the generated model response for later retrieval - # via API. + # via API. Defaults to true when omitted. If set to true, response data will be + # stored for at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). store: nil, # Body param: Options for streaming responses. Only set this when you set # `stream: true`. diff --git a/rbi/openai/resources/images.rbi b/rbi/openai/resources/images.rbi index 8f8bf9b04..9961eca6f 100644 --- a/rbi/openai/resources/images.rbi +++ b/rbi/openai/resources/images.rbi @@ -50,8 +50,7 @@ module OpenAI # See {OpenAI::Resources::Images#edit_stream_raw} for streaming counterpart. # # Creates an edited or extended image given one or more source images and a - # prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - # `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + # prompt. This endpoint supports GPT Image models and `dall-e-2`. sig { params( image: OpenAI::ImageEditParams::Image::Variants, @@ -77,9 +76,11 @@ module OpenAI # The image(s) to edit. Must be a supported image file or an array of images. # # For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - # `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - # should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - # 16 images. + # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), 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. @@ -95,9 +96,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. background: nil, # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported @@ -115,7 +118,9 @@ module OpenAI mask: nil, # The model to use for image generation. One of `dall-e-2` or a GPT image model # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - # `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to # `gpt-image-1.5`. model: nil, # The number of images to generate. Must be between 1 and 10. @@ -135,25 +140,28 @@ module OpenAI # Note that the final image may be sent before the full number of partial images # are generated if the full image is generated more quickly. partial_images: nil, - # The quality of the image that will be generated for GPT image models. Defaults - # to `auto`. + # The quality of the image that will be generated for GPT image models. The GPT + # image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + # `xhigh` and `max`. Defaults to `auto`. quality: nil, # 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` (default is `url` for # `dall-e-2`), as GPT image models always return base64-encoded images. response_format: nil, - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. size: nil, # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. @@ -169,8 +177,7 @@ module OpenAI # See {OpenAI::Resources::Images#edit} for non-streaming counterpart. # # Creates an edited or extended image given one or more source images and a - # prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, - # `gpt-image-1-mini`, and `chatgpt-image-latest`) and `dall-e-2`. + # prompt. This endpoint supports GPT Image models and `dall-e-2`. sig { params( image: OpenAI::ImageEditParams::Image::Variants, @@ -196,9 +203,11 @@ module OpenAI # The image(s) to edit. Must be a supported image file or an array of images. # # For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, - # `gpt-image-2`, `gpt-image-2-2026-04-21`, and `chatgpt-image-latest`), each image - # should be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to - # 16 images. + # `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), 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. @@ -214,9 +223,11 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. background: nil, # Control how much effort the model will exert to match the style and features, # especially facial features, of input images. This parameter is only supported @@ -234,7 +245,9 @@ module OpenAI mask: nil, # The model to use for image generation. One of `dall-e-2` or a GPT image model # (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`, - # `gpt-image-2-2026-04-21`, or `chatgpt-image-latest`). Defaults to + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`, or `chatgpt-image-latest`). Defaults to # `gpt-image-1.5`. model: nil, # The number of images to generate. Must be between 1 and 10. @@ -254,25 +267,28 @@ module OpenAI # Note that the final image may be sent before the full number of partial images # are generated if the full image is generated more quickly. partial_images: nil, - # The quality of the image that will be generated for GPT image models. Defaults - # to `auto`. + # The quality of the image that will be generated for GPT image models. The GPT + # image models support `low`, `medium`, and `high`. `gpt-image-2.5-sunburst` and + # `gpt-image-2.5-flare`, including their `2026-09-08` snapshots, also support + # `xhigh` and `max`. Defaults to `auto`. quality: nil, # 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` (default is `url` for # `dall-e-2`), as GPT image models always return base64-encoded images. response_format: nil, - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. size: nil, # A unique identifier representing your end-user, which can help OpenAI to monitor # and detect abuse. @@ -318,14 +334,18 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. background: nil, # 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`, `gpt-image-2`, - # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - # to the GPT image models is used. + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + # specific to the GPT image models is used. model: nil, # Control the content-moderation level for images generated by the GPT image # models. Must be either `low` for less restrictive filtering or `auto` (default @@ -353,6 +373,8 @@ module OpenAI # - `auto` (default value) will automatically select the best quality for the # given model. # - `high`, `medium` and `low` are supported for the GPT image models. + # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + # `2026-09-08` snapshots, also support `xhigh` and `max`. # - `hd` and `standard` are supported for `dall-e-3`. # - `standard` is the only option for `dall-e-2`. quality: nil, @@ -361,17 +383,18 @@ module OpenAI # after the image has been generated. This parameter isn't supported for the GPT # image models, which always return base64-encoded images. response_format: nil, - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. size: nil, # 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 @@ -422,14 +445,18 @@ module OpenAI # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, # the model will automatically determine the best background for the image. # - # Transparent backgrounds are available for supported GPT Image models. For - # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When - # using `transparent`, set the output format to `png` or `webp`. + # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08` + # snapshots, support `opaque` and `transparent` backgrounds. Transparent + # backgrounds are available for supported GPT Image models. For `gpt-image-2` and + # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`, + # set the output format to `png` or `webp`. background: nil, # 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`, `gpt-image-2`, - # or `gpt-image-2-2026-04-21`). Defaults to `dall-e-2` unless a parameter specific - # to the GPT image models is used. + # `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`, + # `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, + # `gpt-image-2.5-flare-2026-09-08`). Defaults to `dall-e-2` unless a parameter + # specific to the GPT image models is used. model: nil, # Control the content-moderation level for images generated by the GPT image # models. Must be either `low` for less restrictive filtering or `auto` (default @@ -457,6 +484,8 @@ module OpenAI # - `auto` (default value) will automatically select the best quality for the # given model. # - `high`, `medium` and `low` are supported for the GPT image models. + # - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their + # `2026-09-08` snapshots, also support `xhigh` and `max`. # - `hd` and `standard` are supported for `dall-e-3`. # - `standard` is the only option for `dall-e-2`. quality: nil, @@ -465,17 +494,18 @@ module OpenAI # after the image has been generated. This parameter isn't supported for the GPT # image models, which always return base64-encoded images. response_format: nil, - # The size of the generated images. For `gpt-image-2` and - # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT` - # strings, for example `1536x864`. Width and height must both be divisible by 16 - # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above - # `2560x1440` are experimental, and the maximum supported resolution is - # `3840x2160`. The requested size must also satisfy the model's current pixel and - # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are - # supported by the GPT image models; `auto` is supported for models that allow - # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or - # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or - # `1024x1792`. + # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`, + # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, + # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary + # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`. + # Width and height must both be divisible by 16 and the requested aspect ratio + # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and + # the maximum supported resolution is `3840x2160`. The requested size must also + # satisfy the model's current pixel and edge limits. The standard sizes + # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models; + # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use + # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of + # `1024x1024`, `1792x1024`, or `1024x1792`. size: nil, # 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/rbi/openai/resources/responses.rbi b/rbi/openai/resources/responses.rbi index 06ff13e16..af91719e9 100644 --- a/rbi/openai/resources/responses.rbi +++ b/rbi/openai/resources/responses.rbi @@ -241,6 +241,9 @@ module OpenAI # parameter. service_tier: nil, # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). store: nil, # Options for streaming responses. Only set this when you set `stream: true`. stream_options: nil, @@ -546,6 +549,9 @@ module OpenAI # parameter. service_tier: nil, # Whether to store the generated model response for later retrieval via API. + # Defaults to true when omitted. If set to true, response data will be stored for + # at least 30 days, subject to the + # [data retention exceptions](/api/docs/guides/your-data#v1responses). store: nil, # Options for streaming responses. Only set this when you set `stream: true`. stream_options: nil, diff --git a/sig/openai/models/beta/beta_response_input_item.rbs b/sig/openai/models/beta/beta_response_input_item.rbs index 6f791bfca..654230cb3 100644 --- a/sig/openai/models/beta/beta_response_input_item.rbs +++ b/sig/openai/models/beta/beta_response_input_item.rbs @@ -860,7 +860,9 @@ module OpenAI result: String?, status: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::status, ?type: :image_generation_call, - ?agent: OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent? + ?agent: OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::size? } class ImageGenerationCall < OpenAI::Internal::Type::BaseModel @@ -874,11 +876,17 @@ module OpenAI attr_accessor agent: OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent? + attr_accessor quality: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::quality? + + attr_accessor size: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::size? + def initialize: ( id: String, result: String?, status: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::status, ?agent: OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::size?, ?type: :image_generation_call ) -> void @@ -887,7 +895,9 @@ module OpenAI result: String?, status: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::status, ?type: :image_generation_call, - ?agent: OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent? + ?agent: OpenAI::Beta::BetaResponseInputItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::size? } type status = :in_progress | :completed | :generating | :failed @@ -912,6 +922,33 @@ module OpenAI def to_hash: -> { agent_name: String } end + + type quality = :low | :medium | :high | :xhigh | :max | :auto + + module Quality + extend OpenAI::Internal::Type::Enum + + LOW: :low + MEDIUM: :medium + HIGH: :high + XHIGH: :xhigh + MAX: :max + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::quality] + end + + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" + + module Size + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Beta::BetaResponseInputItem::ImageGenerationCall::size] + + SIZE_1024X1024: :"1024x1024" + SIZE_1024X1536: :"1024x1536" + SIZE_1536X1024: :"1536x1024" + end end type local_shell_call = diff --git a/sig/openai/models/beta/beta_response_item.rbs b/sig/openai/models/beta/beta_response_item.rbs index b5bdabb43..311a18225 100644 --- a/sig/openai/models/beta/beta_response_item.rbs +++ b/sig/openai/models/beta/beta_response_item.rbs @@ -593,7 +593,9 @@ module OpenAI result: String?, status: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::status, ?type: :image_generation_call, - ?agent: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent? + ?agent: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::size? } class ImageGenerationCall < OpenAI::Internal::Type::BaseModel @@ -607,11 +609,17 @@ module OpenAI attr_accessor agent: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent? + attr_accessor quality: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::quality? + + attr_accessor size: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::size? + def initialize: ( id: String, result: String?, status: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::status, ?agent: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::size?, ?type: :image_generation_call ) -> void @@ -620,7 +628,9 @@ module OpenAI result: String?, status: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::status, ?type: :image_generation_call, - ?agent: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent? + ?agent: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::size? } type status = :in_progress | :completed | :generating | :failed @@ -645,6 +655,33 @@ module OpenAI def to_hash: -> { agent_name: String } end + + type quality = :low | :medium | :high | :xhigh | :max | :auto + + module Quality + extend OpenAI::Internal::Type::Enum + + LOW: :low + MEDIUM: :medium + HIGH: :high + XHIGH: :xhigh + MAX: :max + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::quality] + end + + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" + + module Size + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Beta::BetaResponseItem::ImageGenerationCall::size] + + SIZE_1024X1024: :"1024x1024" + SIZE_1024X1536: :"1024x1536" + SIZE_1536X1024: :"1536x1024" + end end type local_shell_call = diff --git a/sig/openai/models/beta/beta_response_output_item.rbs b/sig/openai/models/beta/beta_response_output_item.rbs index 24b435c5e..a7b8022fc 100644 --- a/sig/openai/models/beta/beta_response_output_item.rbs +++ b/sig/openai/models/beta/beta_response_output_item.rbs @@ -591,7 +591,9 @@ module OpenAI result: String?, status: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::status, ?type: :image_generation_call, - ?agent: OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent? + ?agent: OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::size? } class ImageGenerationCall < OpenAI::Internal::Type::BaseModel @@ -605,11 +607,17 @@ module OpenAI attr_accessor agent: OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent? + attr_accessor quality: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::quality? + + attr_accessor size: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::size? + def initialize: ( id: String, result: String?, status: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::status, ?agent: OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::size?, ?type: :image_generation_call ) -> void @@ -618,7 +626,9 @@ module OpenAI result: String?, status: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::status, ?type: :image_generation_call, - ?agent: OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent? + ?agent: OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent?, + ?quality: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::size? } type status = :in_progress | :completed | :generating | :failed @@ -643,6 +653,33 @@ module OpenAI def to_hash: -> { agent_name: String } end + + type quality = :low | :medium | :high | :xhigh | :max | :auto + + module Quality + extend OpenAI::Internal::Type::Enum + + LOW: :low + MEDIUM: :medium + HIGH: :high + XHIGH: :xhigh + MAX: :max + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::quality] + end + + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" + + module Size + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Beta::BetaResponseOutputItem::ImageGenerationCall::size] + + SIZE_1024X1024: :"1024x1024" + SIZE_1024X1536: :"1024x1536" + SIZE_1536X1024: :"1536x1024" + end end type local_shell_call = diff --git a/sig/openai/models/beta/beta_tool.rbs b/sig/openai/models/beta/beta_tool.rbs index 7d2ac9a85..ded0b388c 100644 --- a/sig/openai/models/beta/beta_tool.rbs +++ b/sig/openai/models/beta/beta_tool.rbs @@ -556,6 +556,10 @@ module OpenAI | :"gpt-image-1-mini" | :"gpt-image-2" | :"gpt-image-2-2026-04-21" + | :"gpt-image-2.5-sunburst" + | :"gpt-image-2.5-sunburst-2026-09-08" + | :"gpt-image-2.5-flare" + | :"gpt-image-2.5-flare-2026-09-08" | :"gpt-image-1.5" | :"chatgpt-image-latest" @@ -568,6 +572,10 @@ module OpenAI GPT_IMAGE_1_MINI: :"gpt-image-1-mini" GPT_IMAGE_2: :"gpt-image-2" GPT_IMAGE_2_2026_04_21: :"gpt-image-2-2026-04-21" + GPT_IMAGE_2_5_SUNBURST: :"gpt-image-2.5-sunburst" + GPT_IMAGE_2_5_SUNBURST_2026_09_08: :"gpt-image-2.5-sunburst-2026-09-08" + GPT_IMAGE_2_5_FLARE: :"gpt-image-2.5-flare" + GPT_IMAGE_2_5_FLARE_2026_09_08: :"gpt-image-2.5-flare-2026-09-08" GPT_IMAGE_1_5: :"gpt-image-1.5" CHATGPT_IMAGE_LATEST: :"chatgpt-image-latest" end @@ -595,7 +603,7 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::Beta::BetaTool::ImageGeneration::output_format] end - type quality = :low | :medium | :high | :auto + type quality = :low | :medium | :high | :xhigh | :max | :auto module Quality extend OpenAI::Internal::Type::Enum @@ -603,6 +611,8 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::Beta::BetaTool::ImageGeneration::quality] diff --git a/sig/openai/models/conversations/conversation_item.rbs b/sig/openai/models/conversations/conversation_item.rbs index 59d06ebf6..1f6e0144b 100644 --- a/sig/openai/models/conversations/conversation_item.rbs +++ b/sig/openai/models/conversations/conversation_item.rbs @@ -42,7 +42,9 @@ module OpenAI id: String, result: String?, status: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status, - ?type: :image_generation_call + ?type: :image_generation_call, + ?quality: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::size? } class ImageGenerationCall < OpenAI::Internal::Type::BaseModel @@ -54,10 +56,16 @@ module OpenAI attr_accessor type: :image_generation_call + attr_accessor quality: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::quality? + + attr_accessor size: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::size? + def initialize: ( id: String, result: String?, status: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status, + ?quality: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::size?, ?type: :image_generation_call ) -> void @@ -65,7 +73,9 @@ module OpenAI id: String, result: String?, status: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status, - ?type: :image_generation_call + ?type: :image_generation_call, + ?quality: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::size? } type status = :in_progress | :completed | :generating | :failed @@ -80,6 +90,33 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::status] end + + type quality = :low | :medium | :high | :xhigh | :max | :auto + + module Quality + extend OpenAI::Internal::Type::Enum + + LOW: :low + MEDIUM: :medium + HIGH: :high + XHIGH: :xhigh + MAX: :max + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::quality] + end + + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" + + module Size + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Conversations::ConversationItem::ImageGenerationCall::size] + + SIZE_1024X1024: :"1024x1024" + SIZE_1024X1536: :"1024x1536" + SIZE_1536X1024: :"1536x1024" + end end type additional_tools = diff --git a/sig/openai/models/image_edit_completed_event.rbs b/sig/openai/models/image_edit_completed_event.rbs index f768fd1c2..414243883 100644 --- a/sig/openai/models/image_edit_completed_event.rbs +++ b/sig/openai/models/image_edit_completed_event.rbs @@ -75,7 +75,7 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::ImageEditCompletedEvent::output_format] end - type quality = :low | :medium | :high | :auto + type quality = :low | :medium | :high | :xhigh | :max | :auto module Quality extend OpenAI::Internal::Type::Enum @@ -83,22 +83,29 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::ImageEditCompletedEvent::quality] end - type size = :"1024x1024" | :"1024x1536" | :"1536x1024" | :auto + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" | :auto module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::ImageEditCompletedEvent::size] SIZE_1024X1024: :"1024x1024" SIZE_1024X1536: :"1024x1536" SIZE_1536X1024: :"1536x1024" AUTO: :auto - def self?.values: -> ::Array[OpenAI::Models::ImageEditCompletedEvent::size] + def self?.values: -> ::Array[(:"1024x1024" + | :"1024x1536" + | :"1536x1024" + | :auto)] end type usage = diff --git a/sig/openai/models/image_edit_params.rbs b/sig/openai/models/image_edit_params.rbs index 612be3108..0b6f5c8d9 100644 --- a/sig/openai/models/image_edit_params.rbs +++ b/sig/openai/models/image_edit_params.rbs @@ -145,7 +145,7 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::ImageEditParams::output_format] end - type quality = :standard | :low | :medium | :high | :auto + type quality = :standard | :low | :medium | :high | :xhigh | :max | :auto module Quality extend OpenAI::Internal::Type::Enum @@ -154,6 +154,8 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::ImageEditParams::quality] diff --git a/sig/openai/models/image_edit_partial_image_event.rbs b/sig/openai/models/image_edit_partial_image_event.rbs index c9664ab5c..a061f6d87 100644 --- a/sig/openai/models/image_edit_partial_image_event.rbs +++ b/sig/openai/models/image_edit_partial_image_event.rbs @@ -75,7 +75,7 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::ImageEditPartialImageEvent::output_format] end - type quality = :low | :medium | :high | :auto + type quality = :low | :medium | :high | :xhigh | :max | :auto module Quality extend OpenAI::Internal::Type::Enum @@ -83,22 +83,29 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::ImageEditPartialImageEvent::quality] end - type size = :"1024x1024" | :"1024x1536" | :"1536x1024" | :auto + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" | :auto module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::ImageEditPartialImageEvent::size] SIZE_1024X1024: :"1024x1024" SIZE_1024X1536: :"1024x1536" SIZE_1536X1024: :"1536x1024" AUTO: :auto - def self?.values: -> ::Array[OpenAI::Models::ImageEditPartialImageEvent::size] + def self?.values: -> ::Array[(:"1024x1024" + | :"1024x1536" + | :"1536x1024" + | :auto)] end end end diff --git a/sig/openai/models/image_gen_completed_event.rbs b/sig/openai/models/image_gen_completed_event.rbs index df39dd5f3..aacb3efff 100644 --- a/sig/openai/models/image_gen_completed_event.rbs +++ b/sig/openai/models/image_gen_completed_event.rbs @@ -75,7 +75,7 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::ImageGenCompletedEvent::output_format] end - type quality = :low | :medium | :high | :auto + type quality = :low | :medium | :high | :xhigh | :max | :auto module Quality extend OpenAI::Internal::Type::Enum @@ -83,22 +83,29 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::ImageGenCompletedEvent::quality] end - type size = :"1024x1024" | :"1024x1536" | :"1536x1024" | :auto + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" | :auto module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::ImageGenCompletedEvent::size] SIZE_1024X1024: :"1024x1024" SIZE_1024X1536: :"1024x1536" SIZE_1536X1024: :"1536x1024" AUTO: :auto - def self?.values: -> ::Array[OpenAI::Models::ImageGenCompletedEvent::size] + def self?.values: -> ::Array[(:"1024x1024" + | :"1024x1536" + | :"1536x1024" + | :auto)] end type usage = diff --git a/sig/openai/models/image_gen_partial_image_event.rbs b/sig/openai/models/image_gen_partial_image_event.rbs index d9ed335fe..2ca557cd8 100644 --- a/sig/openai/models/image_gen_partial_image_event.rbs +++ b/sig/openai/models/image_gen_partial_image_event.rbs @@ -75,7 +75,7 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::ImageGenPartialImageEvent::output_format] end - type quality = :low | :medium | :high | :auto + type quality = :low | :medium | :high | :xhigh | :max | :auto module Quality extend OpenAI::Internal::Type::Enum @@ -83,22 +83,29 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::ImageGenPartialImageEvent::quality] end - type size = :"1024x1024" | :"1024x1536" | :"1536x1024" | :auto + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" | :auto module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::ImageGenPartialImageEvent::size] SIZE_1024X1024: :"1024x1024" SIZE_1024X1536: :"1024x1536" SIZE_1536X1024: :"1536x1024" AUTO: :auto - def self?.values: -> ::Array[OpenAI::Models::ImageGenPartialImageEvent::size] + def self?.values: -> ::Array[(:"1024x1024" + | :"1024x1536" + | :"1536x1024" + | :auto)] end end end diff --git a/sig/openai/models/image_generate_params.rbs b/sig/openai/models/image_generate_params.rbs index 69dc7c529..2337cb609 100644 --- a/sig/openai/models/image_generate_params.rbs +++ b/sig/openai/models/image_generate_params.rbs @@ -127,7 +127,8 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::ImageGenerateParams::output_format] end - type quality = :standard | :hd | :low | :medium | :high | :auto + type quality = + :standard | :hd | :low | :medium | :high | :xhigh | :max | :auto module Quality extend OpenAI::Internal::Type::Enum @@ -137,6 +138,8 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::ImageGenerateParams::quality] diff --git a/sig/openai/models/image_model.rbs b/sig/openai/models/image_model.rbs index 42ef7cd52..a4f3a4ae9 100644 --- a/sig/openai/models/image_model.rbs +++ b/sig/openai/models/image_model.rbs @@ -5,6 +5,10 @@ module OpenAI | :"gpt-image-1-mini" | :"gpt-image-2" | :"gpt-image-2-2026-04-21" + | :"gpt-image-2.5-sunburst" + | :"gpt-image-2.5-sunburst-2026-09-08" + | :"gpt-image-2.5-flare" + | :"gpt-image-2.5-flare-2026-09-08" | :"gpt-image-1.5" | :"chatgpt-image-latest" | :"dall-e-2" @@ -17,6 +21,10 @@ module OpenAI GPT_IMAGE_1_MINI: :"gpt-image-1-mini" GPT_IMAGE_2: :"gpt-image-2" GPT_IMAGE_2_2026_04_21: :"gpt-image-2-2026-04-21" + GPT_IMAGE_2_5_SUNBURST: :"gpt-image-2.5-sunburst" + GPT_IMAGE_2_5_SUNBURST_2026_09_08: :"gpt-image-2.5-sunburst-2026-09-08" + GPT_IMAGE_2_5_FLARE: :"gpt-image-2.5-flare" + GPT_IMAGE_2_5_FLARE_2026_09_08: :"gpt-image-2.5-flare-2026-09-08" GPT_IMAGE_1_5: :"gpt-image-1.5" CHATGPT_IMAGE_LATEST: :"chatgpt-image-latest" DALL_E_2: :"dall-e-2" diff --git a/sig/openai/models/images_response.rbs b/sig/openai/models/images_response.rbs index 9468c6439..979b54fe4 100644 --- a/sig/openai/models/images_response.rbs +++ b/sig/openai/models/images_response.rbs @@ -91,7 +91,7 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::ImagesResponse::output_format] end - type quality = :low | :medium | :high + type quality = :low | :medium | :high | :xhigh | :max module Quality extend OpenAI::Internal::Type::Enum @@ -99,20 +99,26 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max def self?.values: -> ::Array[OpenAI::Models::ImagesResponse::quality] end - type size = :"1024x1024" | :"1024x1536" | :"1536x1024" + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" module Size - extend OpenAI::Internal::Type::Enum + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::ImagesResponse::size] SIZE_1024X1024: :"1024x1024" SIZE_1024X1536: :"1024x1536" SIZE_1536X1024: :"1536x1024" - def self?.values: -> ::Array[OpenAI::Models::ImagesResponse::size] + def self?.values: -> ::Array[(:"1024x1024" + | :"1024x1536" + | :"1536x1024")] end type usage = diff --git a/sig/openai/models/responses/response_input_item.rbs b/sig/openai/models/responses/response_input_item.rbs index 3569ddb48..d94dc97c2 100644 --- a/sig/openai/models/responses/response_input_item.rbs +++ b/sig/openai/models/responses/response_input_item.rbs @@ -398,7 +398,9 @@ module OpenAI id: String, result: String?, status: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::status, - ?type: :image_generation_call + ?type: :image_generation_call, + ?quality: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::size? } class ImageGenerationCall < OpenAI::Internal::Type::BaseModel @@ -410,10 +412,16 @@ module OpenAI attr_accessor type: :image_generation_call + attr_accessor quality: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::quality? + + attr_accessor size: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::size? + def initialize: ( id: String, result: String?, status: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::status, + ?quality: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::size?, ?type: :image_generation_call ) -> void @@ -421,7 +429,9 @@ module OpenAI id: String, result: String?, status: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::status, - ?type: :image_generation_call + ?type: :image_generation_call, + ?quality: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::size? } type status = :in_progress | :completed | :generating | :failed @@ -436,6 +446,33 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::status] end + + type quality = :low | :medium | :high | :xhigh | :max | :auto + + module Quality + extend OpenAI::Internal::Type::Enum + + LOW: :low + MEDIUM: :medium + HIGH: :high + XHIGH: :xhigh + MAX: :max + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::quality] + end + + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" + + module Size + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall::size] + + SIZE_1024X1024: :"1024x1024" + SIZE_1024X1536: :"1024x1536" + SIZE_1536X1024: :"1536x1024" + end end type local_shell_call = diff --git a/sig/openai/models/responses/response_item.rbs b/sig/openai/models/responses/response_item.rbs index 808ffbce5..b3367e3b2 100644 --- a/sig/openai/models/responses/response_item.rbs +++ b/sig/openai/models/responses/response_item.rbs @@ -183,7 +183,9 @@ module OpenAI id: String, result: String?, status: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::status, - ?type: :image_generation_call + ?type: :image_generation_call, + ?quality: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::size? } class ImageGenerationCall < OpenAI::Internal::Type::BaseModel @@ -195,10 +197,16 @@ module OpenAI attr_accessor type: :image_generation_call + attr_accessor quality: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::quality? + + attr_accessor size: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::size? + def initialize: ( id: String, result: String?, status: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::status, + ?quality: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::size?, ?type: :image_generation_call ) -> void @@ -206,7 +214,9 @@ module OpenAI id: String, result: String?, status: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::status, - ?type: :image_generation_call + ?type: :image_generation_call, + ?quality: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::size? } type status = :in_progress | :completed | :generating | :failed @@ -221,6 +231,33 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::status] end + + type quality = :low | :medium | :high | :xhigh | :max | :auto + + module Quality + extend OpenAI::Internal::Type::Enum + + LOW: :low + MEDIUM: :medium + HIGH: :high + XHIGH: :xhigh + MAX: :max + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::quality] + end + + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" + + module Size + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::size] + + SIZE_1024X1024: :"1024x1024" + SIZE_1024X1536: :"1024x1536" + SIZE_1536X1024: :"1536x1024" + end end type local_shell_call = diff --git a/sig/openai/models/responses/response_output_item.rbs b/sig/openai/models/responses/response_output_item.rbs index 67be193ce..c63809991 100644 --- a/sig/openai/models/responses/response_output_item.rbs +++ b/sig/openai/models/responses/response_output_item.rbs @@ -181,7 +181,9 @@ module OpenAI id: String, result: String?, status: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::status, - ?type: :image_generation_call + ?type: :image_generation_call, + ?quality: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::size? } class ImageGenerationCall < OpenAI::Internal::Type::BaseModel @@ -193,10 +195,16 @@ module OpenAI attr_accessor type: :image_generation_call + attr_accessor quality: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::quality? + + attr_accessor size: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::size? + def initialize: ( id: String, result: String?, status: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::status, + ?quality: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::size?, ?type: :image_generation_call ) -> void @@ -204,7 +212,9 @@ module OpenAI id: String, result: String?, status: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::status, - ?type: :image_generation_call + ?type: :image_generation_call, + ?quality: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::quality?, + ?size: OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::size? } type status = :in_progress | :completed | :generating | :failed @@ -219,6 +229,33 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::status] end + + type quality = :low | :medium | :high | :xhigh | :max | :auto + + module Quality + extend OpenAI::Internal::Type::Enum + + LOW: :low + MEDIUM: :medium + HIGH: :high + XHIGH: :xhigh + MAX: :max + AUTO: :auto + + def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::quality] + end + + type size = String | :"1024x1024" | :"1024x1536" | :"1536x1024" + + module Size + extend OpenAI::Internal::Type::Union + + def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::size] + + SIZE_1024X1024: :"1024x1024" + SIZE_1024X1536: :"1024x1536" + SIZE_1536X1024: :"1536x1024" + end end type local_shell_call = diff --git a/sig/openai/models/responses/tool.rbs b/sig/openai/models/responses/tool.rbs index 48eaa62fc..04560a0c2 100644 --- a/sig/openai/models/responses/tool.rbs +++ b/sig/openai/models/responses/tool.rbs @@ -554,6 +554,10 @@ module OpenAI | :"gpt-image-1-mini" | :"gpt-image-2" | :"gpt-image-2-2026-04-21" + | :"gpt-image-2.5-sunburst" + | :"gpt-image-2.5-sunburst-2026-09-08" + | :"gpt-image-2.5-flare" + | :"gpt-image-2.5-flare-2026-09-08" | :"gpt-image-1.5" | :"chatgpt-image-latest" @@ -566,6 +570,10 @@ module OpenAI GPT_IMAGE_1_MINI: :"gpt-image-1-mini" GPT_IMAGE_2: :"gpt-image-2" GPT_IMAGE_2_2026_04_21: :"gpt-image-2-2026-04-21" + GPT_IMAGE_2_5_SUNBURST: :"gpt-image-2.5-sunburst" + GPT_IMAGE_2_5_SUNBURST_2026_09_08: :"gpt-image-2.5-sunburst-2026-09-08" + GPT_IMAGE_2_5_FLARE: :"gpt-image-2.5-flare" + GPT_IMAGE_2_5_FLARE_2026_09_08: :"gpt-image-2.5-flare-2026-09-08" GPT_IMAGE_1_5: :"gpt-image-1.5" CHATGPT_IMAGE_LATEST: :"chatgpt-image-latest" end @@ -593,7 +601,7 @@ module OpenAI def self?.values: -> ::Array[OpenAI::Models::Responses::Tool::ImageGeneration::output_format] end - type quality = :low | :medium | :high | :auto + type quality = :low | :medium | :high | :xhigh | :max | :auto module Quality extend OpenAI::Internal::Type::Enum @@ -601,6 +609,8 @@ module OpenAI LOW: :low MEDIUM: :medium HIGH: :high + XHIGH: :xhigh + MAX: :max AUTO: :auto def self?.values: -> ::Array[OpenAI::Models::Responses::Tool::ImageGeneration::quality] diff --git a/test/openai/image_size_compatibility_test.rb b/test/openai/image_size_compatibility_test.rb new file mode 100644 index 000000000..7dd1ca813 --- /dev/null +++ b/test/openai/image_size_compatibility_test.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class OpenAI::Test::ImageSizeCompatibilityTest < Minitest::Test + extend Minitest::Serial + + def test_image_response_preserves_known_size_symbols_and_custom_size_strings + {"1024x1024" => :"1024x1024", "1536x864" => "1536x864"}.each do |wire_size, expected| + with_response({created: 1, data: [], quality: "max", size: wire_size}.to_json) do |client| + image = client.images.generate(prompt: "synthetic", model: "gpt-image-2.5-sunburst", quality: :max) + + assert_equal(expected, image.size) + assert_equal(:max, image.quality) + end + end + + assert_equal( + [:"1024x1024", :"1024x1536", :"1536x1024"].to_set, + OpenAI::ImagesResponse::Size.values.to_set + ) + end + + def test_image_streams_preserve_size_values_and_enum_helpers + %w[image_generation.completed image_generation.partial_image image_edit.completed image_edit.partial_image] + .each do |type| + {"1024x1024" => :"1024x1024", "1536x864" => "1536x864"}.each do |wire_size, expected| + payload = {type: type, created_at: 1, b64_json: "synthetic", quality: "xhigh", size: wire_size} + wire = "event: #{type}\ndata: #{payload.to_json}\n\n" + + with_response(wire, content_type: "text/event-stream") do |client| + stream = if type.start_with?("image_edit.") + client.images.edit_stream_raw(image: StringIO.new("synthetic"), prompt: "synthetic") + else + client.images.generate_stream_raw(prompt: "synthetic") + end + + event = stream.to_a.fetch(0) + + assert_equal(expected, event.size, type) + assert_equal(:xhigh, event.quality, type) + assert_equal( + [:"1024x1024", :"1024x1536", :"1536x1024", :auto].to_set, + event.class::Size.values.to_set + ) + ensure + stream&.close + end + end + end + end + + private + + def with_response(body, content_type: "application/json") + transport = OpenAI::HTTPClient.new + response = OpenAI::HTTPClient::Response.new( + status: 200, + headers: {"content-type" => content_type}, + body: [body] + ) + + transport.stub(:execute, response) do + yield( + OpenAI::Client.new( + api_key: "synthetic-key", + base_url: "https://sdk.example.test", + http_client: transport + ) + ) + end + end +end diff --git a/test/openai/resources/beta/responses/input_items_test.rb b/test/openai/resources/beta/responses/input_items_test.rb index ef5c9ef93..6a762faa4 100644 --- a/test/openai/resources/beta/responses/input_items_test.rb +++ b/test/openai/resources/beta/responses/input_items_test.rb @@ -173,7 +173,9 @@ def test_list id: String, result: String | nil, status: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Status, - agent: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent | nil + agent: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent | nil, + quality: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality | nil, + size: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size | nil } | { type: :code_interpreter_call, id: String, diff --git a/test/openai/resources/conversations/items_test.rb b/test/openai/resources/conversations/items_test.rb index 621ea9314..40bae525d 100644 --- a/test/openai/resources/conversations/items_test.rb +++ b/test/openai/resources/conversations/items_test.rb @@ -75,7 +75,9 @@ def test_retrieve_required_params type: :image_generation_call, id: String, result: String | nil, - status: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Status + status: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Status, + quality: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality | nil, + size: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size | nil } | { type: :computer_call, id: String, @@ -290,7 +292,9 @@ def test_list type: :image_generation_call, id: String, result: String | nil, - status: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Status + status: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Status, + quality: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality | nil, + size: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size | nil } | { type: :computer_call, id: String, diff --git a/test/openai/resources/responses/input_items_test.rb b/test/openai/resources/responses/input_items_test.rb index eb165afe9..0d7a597e9 100644 --- a/test/openai/resources/responses/input_items_test.rb +++ b/test/openai/resources/responses/input_items_test.rb @@ -125,7 +125,9 @@ def test_list type: :image_generation_call, id: String, result: String | nil, - status: OpenAI::Responses::ResponseItem::ImageGenerationCall::Status + status: OpenAI::Responses::ResponseItem::ImageGenerationCall::Status, + quality: OpenAI::Responses::ResponseItem::ImageGenerationCall::Quality | nil, + size: OpenAI::Responses::ResponseItem::ImageGenerationCall::Size | nil } | { type: :code_interpreter_call, id: String,