Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .castiron.stats.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
schema_version: 1
generation_id: cf94c82f-0604-4dfc-aff0-cec482e84953
openapi_spec_hash: ce912f79d7f8cb19a7a515513c214b8a
openapi_transformed_spec_hash: 352b5a7a028f990b6475b6593e381eee
config_hash: dde98d9c41cd6f4163320f92c70f83e6
codegen_sha: 326831af0c0fdf859335a189df2b6716e4b605d4
codegen_hash: 00e7f6a53e1a6a1adf02385bc368fce999fdd775d1f1c28615f790c7a4109ad0
public_codegen_sha: c2abe7c282c83c8fb9a7330254235c20b67a2b10
generation_id: f4a5f0f7-43a5-4384-b6cb-220dd7898c6a
openapi_spec_hash: 9463cd81496b22aea083ca5d0487c9b4
openapi_transformed_spec_hash: bf0bde503e128caf8f16da77c0f068a3
config_hash: 96c2739e5fb89fed6c7777e5a4e74294
codegen_sha: 92be1ab3f0a5e8090717bb844310cfed5158880a
codegen_hash: 436b874262e18f5462d6781ea55586409f52ec6819c2e5c1d1bdf8d8dff91bf2
public_codegen_sha: 45fc337d98e43dd06b6129dba4ff78ad64c95080
123 changes: 33 additions & 90 deletions api_reference/openapi.transformed.yml

Large diffs are not rendered by default.

42 changes: 24 additions & 18 deletions lib/openai/models/beta/beta_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,13 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel
optional :background, enum: -> { OpenAI::Beta::BetaTool::ImageGeneration::Background }

# @!attribute input_fidelity
# 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.
# Control how much effort the model will exert to match the style and features,
# especially facial features, of input images. Supported models accept `high` and
# `low`, except `gpt-image-1-mini`, which accepts only `low`. Defaults to `low` on
# models that support this parameter. Omit this parameter for `gpt-image-2`,
# `gpt-image-2-2026-04-21`, and other models that do not support it. See the
# [image input fidelity guide](https://developers.openai.com/api/docs/guides/image-generation#image-input-fidelity)
# for model-specific guidance.
#
# @return [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::InputFidelity, nil]
optional(
Expand Down Expand Up @@ -707,9 +711,7 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel
# 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`.
# `auto` is supported for models that allow automatic sizing.
#
# @return [String, Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::Size, nil]
optional :size, union: -> { OpenAI::Beta::BetaTool::ImageGeneration::Size }
Expand All @@ -732,9 +734,13 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel
# set the output format to `png` or `webp`.
#
# @param input_fidelity [Symbol, OpenAI::Models::Beta::BetaTool::ImageGeneration::InputFidelity, nil]
# 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.
# Control how much effort the model will exert to match the style and features,
# especially facial features, of input images. Supported models accept `high` and
# `low`, except `gpt-image-1-mini`, which accepts only `low`. Defaults to `low` on
# models that support this parameter. Omit this parameter for `gpt-image-2`,
# `gpt-image-2-2026-04-21`, and other models that do not support it. See the
# [image input fidelity guide](https://developers.openai.com/api/docs/guides/image-generation#image-input-fidelity)
# for model-specific guidance.
#
# @param input_image_mask [OpenAI::Models::Beta::BetaTool::ImageGeneration::InputImageMask]
# Optional mask for inpainting. Contains `image_url` (string, optional) and
Expand Down Expand Up @@ -777,9 +783,7 @@ class ImageGeneration < OpenAI::Internal::Type::BaseModel
# 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`.
# `auto` is supported for models that allow automatic sizing.
#
# @param type [Symbol, :image_generation]
# The type of the image generation tool. Always `image_generation`.
Expand Down Expand Up @@ -820,9 +824,13 @@ module Background
# @return [Array<Symbol>]
end

# 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.
# Control how much effort the model will exert to match the style and features,
# especially facial features, of input images. Supported models accept `high` and
# `low`, except `gpt-image-1-mini`, which accepts only `low`. Defaults to `low` on
# models that support this parameter. Omit this parameter for `gpt-image-2`,
# `gpt-image-2-2026-04-21`, and other models that do not support it. See the
# [image input fidelity guide](https://developers.openai.com/api/docs/guides/image-generation#image-input-fidelity)
# for model-specific guidance.
#
# @see OpenAI::Models::Beta::BetaTool::ImageGeneration#input_fidelity
module InputFidelity
Expand Down Expand Up @@ -976,9 +984,7 @@ module Quality
# 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`.
# `auto` is supported for models that allow automatic sizing.
#
# @see OpenAI::Models::Beta::BetaTool::ImageGeneration#size
module Size
Expand Down
30 changes: 16 additions & 14 deletions lib/openai/models/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ module OpenAI
module Models
class Image < OpenAI::Internal::Type::BaseModel
# @!attribute b64_json
# The base64-encoded JSON of the generated image. Returned by default for the GPT
# image models, and only present if `response_format` is set to `b64_json` for
# `dall-e-2` and `dall-e-3`.
# The base64-encoded image data. Returned by default for the GPT image models. For
# the retired `dall-e-2` and `dall-e-3` models, this field was present only when
# `response_format` was set to `b64_json`.
#
# @return [String, nil]
optional :b64_json, String

# @!attribute revised_prompt
# For `dall-e-3` only, the revised prompt that was used to generate the image.
# Legacy field for the retired `dall-e-3` model: the revised prompt that was used
# to generate the image.
#
# @return [String, nil]
optional :revised_prompt, String

# @!attribute url
# When using `dall-e-2` or `dall-e-3`, the URL of the generated image if
# `response_format` is set to `url` (default value). Unsupported for the GPT image
# models.
# Legacy field for the retired `dall-e-2` and `dall-e-3` models: the URL of the
# generated image when `response_format` was set to `url`, the legacy default.
# Unsupported for the GPT image models.
#
# @return [String, nil]
optional :url, String
Expand All @@ -29,17 +30,18 @@ class Image < OpenAI::Internal::Type::BaseModel
# Represents the content or the URL of an image generated by the OpenAI API.
#
# @param b64_json [String]
# The base64-encoded JSON of the generated image. Returned by default for the GPT
# image models, and only present if `response_format` is set to `b64_json` for
# `dall-e-2` and `dall-e-3`.
# The base64-encoded image data. Returned by default for the GPT image models. For
# the retired `dall-e-2` and `dall-e-3` models, this field was present only when
# `response_format` was set to `b64_json`.
#
# @param revised_prompt [String]
# For `dall-e-3` only, the revised prompt that was used to generate the image.
# Legacy field for the retired `dall-e-3` model: the revised prompt that was used
# to generate the image.
#
# @param url [String]
# When using `dall-e-2` or `dall-e-3`, the URL of the generated image if
# `response_format` is set to `url` (default value). Unsupported for the GPT image
# models.
# Legacy field for the retired `dall-e-2` and `dall-e-3` models: the URL of the
# generated image when `response_format` was set to `url`, the legacy default.
# Unsupported for the GPT image models.
end
end
end
61 changes: 33 additions & 28 deletions lib/openai/models/image_create_variation_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class ImageCreateVariationParams < OpenAI::Internal::Type::BaseModel
include OpenAI::Internal::Type::RequestParameters

# @!attribute image
# The image to use as the basis for the variation(s). Must be a valid PNG file,
# less than 4MB, and square.
# The input image for the legacy variations endpoint. The legacy format requires a
# valid PNG file, less than 4MB, and square.
#
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
Expand All @@ -19,29 +19,31 @@ class ImageCreateVariationParams < OpenAI::Internal::Type::BaseModel
required :image, OpenAI::Internal::Type::FileInput

# @!attribute model
# The model to use for image generation. Only `dall-e-2` is supported at this
# time.
# Legacy model selection for the variations endpoint, which was designed for
# `dall-e-2`. DALL·E 2 was retired from the API on May 12, 2026; see
# [deprecations](https://developers.openai.com/api/docs/deprecations). Use image
# edits with a supported GPT Image model for new integrations.
#
# @return [String, Symbol, OpenAI::Models::ImageModel, nil]
optional :model, union: -> { OpenAI::ImageCreateVariationParams::Model }, nil?: true

# @!attribute n
# The number of images to generate. Must be between 1 and 10.
# The number of images requested from the legacy variations endpoint. Must be
# between 1 and 10.
#
# @return [Integer, nil]
optional :n, Integer, nil?: true

# @!attribute response_format
# The format in which the generated images are returned. Must be one of `url` or
# `b64_json`. URLs are only valid for 60 minutes after the image has been
# generated.
# The response format for the legacy variations endpoint: `url` or `b64_json`.
# Returned URLs were valid for 60 minutes after image generation.
#
# @return [Symbol, OpenAI::Models::ImageCreateVariationParams::ResponseFormat, nil]
optional :response_format, enum: -> { OpenAI::ImageCreateVariationParams::ResponseFormat }, nil?: true

# @!attribute size
# The size of the generated images. Must be one of `256x256`, `512x512`, or
# `1024x1024`.
# The requested image size for the legacy variations endpoint. Must be one of
# `256x256`, `512x512`, or `1024x1024`.
#
# @return [Symbol, OpenAI::Models::ImageCreateVariationParams::Size, nil]
optional :size, enum: -> { OpenAI::ImageCreateVariationParams::Size }, nil?: true
Expand All @@ -56,28 +58,30 @@ class ImageCreateVariationParams < OpenAI::Internal::Type::BaseModel

# @!method initialize(image:, model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {})
# @param image [Pathname, StringIO, IO, String, OpenAI::FilePart]
# The image to use as the basis for the variation(s). Must be a valid PNG file,
# less than 4MB, and square.
# The input image for the legacy variations endpoint. The legacy format requires a
# valid PNG file, less than 4MB, and square.
#
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
# content type.
#
# @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
# The model to use for image generation. Only `dall-e-2` is supported at this
# time.
# Legacy model selection for the variations endpoint, which was designed for
# `dall-e-2`. DALL·E 2 was retired from the API on May 12, 2026; see
# [deprecations](https://developers.openai.com/api/docs/deprecations). Use image
# edits with a supported GPT Image model for new integrations.
#
# @param n [Integer, nil]
# The number of images to generate. Must be between 1 and 10.
# The number of images requested from the legacy variations endpoint. Must be
# between 1 and 10.
#
# @param response_format [Symbol, OpenAI::Models::ImageCreateVariationParams::ResponseFormat, 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.
# The response format for the legacy variations endpoint: `url` or `b64_json`.
# Returned URLs were valid for 60 minutes after image generation.
#
# @param size [Symbol, OpenAI::Models::ImageCreateVariationParams::Size, nil]
# The size of the generated images. Must be one of `256x256`, `512x512`, or
# `1024x1024`.
# The requested image size for the legacy variations endpoint. Must be one of
# `256x256`, `512x512`, or `1024x1024`.
#
# @param user [String]
# A unique identifier representing your end-user, which can help OpenAI to monitor
Expand All @@ -86,23 +90,24 @@ class ImageCreateVariationParams < OpenAI::Internal::Type::BaseModel
#
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]

# The model to use for image generation. Only `dall-e-2` is supported at this
# time.
# Legacy model selection for the variations endpoint, which was designed for
# `dall-e-2`. DALL·E 2 was retired from the API on May 12, 2026; see
# [deprecations](https://developers.openai.com/api/docs/deprecations). Use image
# edits with a supported GPT Image model for new integrations.
module Model
extend OpenAI::Internal::Type::Union

variant String

# The model to use for image generation. Only `dall-e-2` is supported at this time.
# Legacy model selection for the variations endpoint, which was designed for `dall-e-2`. DALL·E 2 was retired from the API on May 12, 2026; see [deprecations](https://developers.openai.com/api/docs/deprecations). Use image edits with a supported GPT Image model for new integrations.
variant enum: -> { OpenAI::ImageModel }

# @!method self.variants
# @return [Array(String, Symbol, OpenAI::Models::ImageModel)]
end

# 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.
# The response format for the legacy variations endpoint: `url` or `b64_json`.
# Returned URLs were valid for 60 minutes after image generation.
module ResponseFormat
extend OpenAI::Internal::Type::Enum

Expand All @@ -113,8 +118,8 @@ module ResponseFormat
# @return [Array<Symbol>]
end

# The size of the generated images. Must be one of `256x256`, `512x512`, or
# `1024x1024`.
# The requested image size for the legacy variations endpoint. Must be one of
# `256x256`, `512x512`, or `1024x1024`.
module Size
extend OpenAI::Internal::Type::Enum

Expand Down
Loading
Loading