openai 0.98.0 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/README.md +1 -1
- data/bedrock.md +17 -1
- data/lib/openai/client.rb +9 -0
- data/lib/openai/helpers/agents/session_stream.rb +11 -36
- data/lib/openai/helpers/agents/tools.rb +34 -4
- data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
- data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
- data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
- data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_completions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
- data/lib/openai/models/admin/organization/usage_costs_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_images_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +140 -5
- data/lib/openai/models/all_models.rb +42 -0
- data/lib/openai/models/audio/speech_create_params.rb +6 -0
- data/lib/openai/models/audio/voice.rb +75 -0
- data/lib/openai/models/audio/voice_create_params.rb +217 -0
- data/lib/openai/models/beta/agent_create_params.rb +0 -3
- data/lib/openai/models/beta/agent_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/environments/template_create_params.rb +6 -6
- data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
- data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/sessions/turns/item_list_params.rb +79 -0
- data/lib/openai/models/beta/beta_response.rb +220 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/beta/beta_response_error.rb +12 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
- data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
- data/lib/openai/models/beta/beta_tool.rb +15 -18
- data/lib/openai/models/beta/environment_param.rb +6 -6
- data/lib/openai/models/beta/response_compact_params.rb +220 -0
- data/lib/openai/models/beta/response_create_params.rb +220 -0
- data/lib/openai/models/beta/session_turn_error.rb +9 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
- data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
- data/lib/openai/models/chat_model.rb +178 -0
- data/lib/openai/models/error_object.rb +12 -1
- data/lib/openai/models/eval_create_params.rb +1 -1
- data/lib/openai/models/eval_create_response.rb +1 -1
- data/lib/openai/models/eval_list_response.rb +1 -1
- data/lib/openai/models/eval_retrieve_response.rb +1 -1
- data/lib/openai/models/eval_update_response.rb +1 -1
- data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
- data/lib/openai/models/graders/score_model_grader.rb +2 -2
- data/lib/openai/models/image.rb +14 -14
- data/lib/openai/models/image_create_variation_params.rb +7 -7
- data/lib/openai/models/image_edit_params.rb +88 -96
- data/lib/openai/models/image_generate_params.rb +51 -62
- data/lib/openai/models/image_model.rb +5 -3
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
- data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
- data/lib/openai/models/realtime/session_update_event.rb +16 -0
- data/lib/openai/models/responses/response_compact_params.rb +220 -0
- data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/responses/response_error.rb +12 -1
- data/lib/openai/models/responses/responses_server_event.rb +12 -1
- data/lib/openai/models/responses/tool.rb +15 -18
- data/lib/openai/models/responses_model.rb +42 -0
- data/lib/openai/models/video_create_error.rb +12 -1
- data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
- data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
- data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
- data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
- data/lib/openai/providers/bedrock.rb +20 -1
- data/lib/openai/resources/admin/organization/usage.rb +15 -6
- data/lib/openai/resources/audio/speech.rb +2 -0
- data/lib/openai/resources/audio/voices.rb +53 -0
- data/lib/openai/resources/audio.rb +5 -0
- data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
- data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
- data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -2
- data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
- data/lib/openai/resources/images.rb +79 -109
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +10 -0
- data/rbi/openai/helpers/agents.rbi +2 -0
- data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
- data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
- data/rbi/openai/helpers/beta/agents.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +213 -3
- data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
- data/rbi/openai/models/audio/voice.rbi +111 -0
- data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
- data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
- data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
- data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
- data/rbi/openai/models/beta/beta_tool.rbi +15 -18
- data/rbi/openai/models/beta/environment_param.rbi +6 -6
- data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
- data/rbi/openai/models/error_object.rbi +12 -0
- data/rbi/openai/models/eval_create_params.rbi +1 -1
- data/rbi/openai/models/eval_create_response.rbi +1 -1
- data/rbi/openai/models/eval_list_response.rbi +1 -1
- data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
- data/rbi/openai/models/eval_update_response.rbi +1 -1
- data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
- data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
- data/rbi/openai/models/image.rbi +14 -14
- data/rbi/openai/models/image_create_variation_params.rbi +6 -6
- data/rbi/openai/models/image_edit_params.rbi +73 -91
- data/rbi/openai/models/image_generate_params.rbi +30 -61
- data/rbi/openai/models/image_model.rbi +3 -3
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
- data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
- data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/responses/response_error.rbi +12 -0
- data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
- data/rbi/openai/models/responses/tool.rbi +15 -18
- data/rbi/openai/models/video_create_error.rbi +12 -0
- data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
- data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
- data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
- data/rbi/openai/resources/audio/speech.rbi +2 -0
- data/rbi/openai/resources/audio/voices.rbi +49 -0
- data/rbi/openai/resources/audio.rbi +4 -0
- data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
- data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
- data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
- data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
- data/rbi/openai/resources/images.rbi +77 -109
- data/rbi/openai/resources/webhooks.rbi +5 -0
- data/sig/openai/helpers/agents.rbs +3 -0
- data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
- data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
- data/sig/openai/helpers/beta/agents.rbs +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_images_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +107 -5
- data/sig/openai/models/audio/speech_create_params.rbs +4 -0
- data/sig/openai/models/audio/voice.rbs +70 -0
- data/sig/openai/models/audio/voice_create_params.rbs +203 -0
- data/sig/openai/models/beta/agent_create_params.rbs +1 -5
- data/sig/openai/models/beta/agent_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
- data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
- data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/sessions/turns/item_list_params.rbs +91 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/beta/beta_response_error.rbs +10 -0
- data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
- data/sig/openai/models/beta/beta_tool.rbs +11 -15
- data/sig/openai/models/beta/environment_param.rbs +4 -4
- data/sig/openai/models/beta/session_turn_error.rbs +12 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
- data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
- data/sig/openai/models/error_object.rbs +10 -0
- data/sig/openai/models/eval_create_params.rbs +1 -1
- data/sig/openai/models/eval_create_response.rbs +1 -1
- data/sig/openai/models/eval_list_response.rbs +1 -1
- data/sig/openai/models/eval_retrieve_response.rbs +1 -1
- data/sig/openai/models/eval_update_response.rbs +1 -1
- data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
- data/sig/openai/models/graders/score_model_grader.rbs +3 -3
- data/sig/openai/models/image.rbs +21 -21
- data/sig/openai/models/image_create_variation_params.rbs +4 -4
- data/sig/openai/models/image_edit_params.rbs +54 -66
- data/sig/openai/models/image_generate_params.rbs +23 -45
- data/sig/openai/models/image_model.rbs +6 -6
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
- data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/responses/response_error.rbs +10 -0
- data/sig/openai/models/responses/responses_server_event.rbs +10 -0
- data/sig/openai/models/responses/tool.rbs +11 -15
- data/sig/openai/models/video_create_error.rbs +10 -0
- data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
- data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
- data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
- data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
- data/sig/openai/resources/audio/voices.rbs +14 -0
- data/sig/openai/resources/audio.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
- data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
- data/sig/openai/resources/webhooks.rbs +6 -1
- metadata +35 -1
|
@@ -19,8 +19,8 @@ module OpenAI
|
|
|
19
19
|
required :image, OpenAI::Internal::Type::FileInput
|
|
20
20
|
|
|
21
21
|
# @!attribute model
|
|
22
|
-
# The model
|
|
23
|
-
#
|
|
22
|
+
# The legacy model used by the retired image variations endpoint. This endpoint no
|
|
23
|
+
# longer accepts requests.
|
|
24
24
|
#
|
|
25
25
|
# @return [String, Symbol, OpenAI::Models::ImageModel, nil]
|
|
26
26
|
optional :model, union: -> { OpenAI::ImageCreateVariationParams::Model }, nil?: true
|
|
@@ -64,8 +64,8 @@ module OpenAI
|
|
|
64
64
|
# content type.
|
|
65
65
|
#
|
|
66
66
|
# @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
|
|
67
|
-
# The model
|
|
68
|
-
#
|
|
67
|
+
# The legacy model used by the retired image variations endpoint. This endpoint no
|
|
68
|
+
# longer accepts requests.
|
|
69
69
|
#
|
|
70
70
|
# @param n [Integer, nil]
|
|
71
71
|
# The number of images to generate. Must be between 1 and 10.
|
|
@@ -86,14 +86,14 @@ module OpenAI
|
|
|
86
86
|
#
|
|
87
87
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
88
88
|
|
|
89
|
-
# The model
|
|
90
|
-
#
|
|
89
|
+
# The legacy model used by the retired image variations endpoint. This endpoint no
|
|
90
|
+
# longer accepts requests.
|
|
91
91
|
module Model
|
|
92
92
|
extend OpenAI::Internal::Type::Union
|
|
93
93
|
|
|
94
94
|
variant String
|
|
95
95
|
|
|
96
|
-
# The model
|
|
96
|
+
# The legacy model used by the retired image variations endpoint. This endpoint no longer accepts requests.
|
|
97
97
|
variant enum: -> { OpenAI::ImageModel }
|
|
98
98
|
|
|
99
99
|
# @!method self.variants
|
|
@@ -19,9 +19,6 @@ module OpenAI
|
|
|
19
19
|
# be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
|
|
20
20
|
# images.
|
|
21
21
|
#
|
|
22
|
-
# For `dall-e-2`, you can only provide one image, and it should be a square `png`
|
|
23
|
-
# file less than 4MB.
|
|
24
|
-
#
|
|
25
22
|
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
26
23
|
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
27
24
|
# content type.
|
|
@@ -30,8 +27,8 @@ module OpenAI
|
|
|
30
27
|
required :image, union: -> { OpenAI::ImageEditParams::Image }
|
|
31
28
|
|
|
32
29
|
# @!attribute prompt
|
|
33
|
-
# A text description of the desired image(s). The maximum length is
|
|
34
|
-
# characters for
|
|
30
|
+
# A text description of the desired image(s). The maximum length is 32000
|
|
31
|
+
# characters for the GPT image models.
|
|
35
32
|
#
|
|
36
33
|
# @return [String]
|
|
37
34
|
required :prompt, String
|
|
@@ -51,9 +48,10 @@ module OpenAI
|
|
|
51
48
|
optional :background, enum: -> { OpenAI::ImageEditParams::Background }, nil?: true
|
|
52
49
|
|
|
53
50
|
# @!attribute input_fidelity
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
# `gpt-image-
|
|
51
|
+
# Control how much effort the model will exert to match the style and features,
|
|
52
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
53
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
54
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
57
55
|
#
|
|
58
56
|
# @return [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil]
|
|
59
57
|
optional :input_fidelity, enum: -> { OpenAI::ImageEditParams::InputFidelity }, nil?: true
|
|
@@ -72,12 +70,11 @@ module OpenAI
|
|
|
72
70
|
optional :mask, OpenAI::Internal::Type::FileInput
|
|
73
71
|
|
|
74
72
|
# @!attribute model
|
|
75
|
-
# The model to use for image
|
|
76
|
-
#
|
|
77
|
-
# `gpt-image-2-
|
|
78
|
-
# `gpt-image-2.5-
|
|
79
|
-
# `
|
|
80
|
-
# `gpt-image-1.5`.
|
|
73
|
+
# The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
|
|
74
|
+
# `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
75
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
76
|
+
# `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
|
|
77
|
+
# `chatgpt-image-latest`).
|
|
81
78
|
#
|
|
82
79
|
# @return [String, Symbol, OpenAI::Models::ImageModel, nil]
|
|
83
80
|
optional :model, union: -> { OpenAI::ImageEditParams::Model }, nil?: true
|
|
@@ -125,27 +122,26 @@ module OpenAI
|
|
|
125
122
|
optional :quality, enum: -> { OpenAI::ImageEditParams::Quality }, nil?: true
|
|
126
123
|
|
|
127
124
|
# @!attribute response_format
|
|
128
|
-
#
|
|
129
|
-
#
|
|
130
|
-
#
|
|
131
|
-
#
|
|
125
|
+
# @deprecated
|
|
126
|
+
#
|
|
127
|
+
# Legacy response format parameter for retired image models. Unsupported for GPT
|
|
128
|
+
# image models, which always return base64-encoded images.
|
|
132
129
|
#
|
|
133
130
|
# @return [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil]
|
|
134
131
|
optional :response_format, enum: -> { OpenAI::ImageEditParams::ResponseFormat }, nil?: true
|
|
135
132
|
|
|
136
133
|
# @!attribute size
|
|
137
|
-
# The size of the generated images.
|
|
138
|
-
# `gpt-image-2
|
|
139
|
-
# `gpt-image-2.5-
|
|
140
|
-
# resolutions are supported as
|
|
141
|
-
# Width and height must both be
|
|
142
|
-
# must be between 1:3 and 3:1.
|
|
143
|
-
#
|
|
144
|
-
#
|
|
145
|
-
#
|
|
146
|
-
# `
|
|
147
|
-
#
|
|
148
|
-
# `1024x1024`, `1792x1024`, or `1024x1792`.
|
|
134
|
+
# The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
|
|
135
|
+
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
136
|
+
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
|
|
137
|
+
# `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
|
|
138
|
+
# `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
|
|
139
|
+
# divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
|
|
140
|
+
# Resolutions above `2560x1440` are experimental, and the maximum supported
|
|
141
|
+
# resolution is `3840x2160`. The requested size must also satisfy the model's
|
|
142
|
+
# current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
|
|
143
|
+
# `1024x1536` are supported by the GPT image models; `auto` is supported for
|
|
144
|
+
# models that allow automatic sizing.
|
|
149
145
|
#
|
|
150
146
|
# @return [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil]
|
|
151
147
|
optional :size, union: -> { OpenAI::ImageEditParams::Size }, nil?: true
|
|
@@ -169,16 +165,13 @@ module OpenAI
|
|
|
169
165
|
# be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
|
|
170
166
|
# images.
|
|
171
167
|
#
|
|
172
|
-
# For `dall-e-2`, you can only provide one image, and it should be a square `png`
|
|
173
|
-
# file less than 4MB.
|
|
174
|
-
#
|
|
175
168
|
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
176
169
|
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
177
170
|
# content type.
|
|
178
171
|
#
|
|
179
172
|
# @param prompt [String]
|
|
180
|
-
# A text description of the desired image(s). The maximum length is
|
|
181
|
-
# characters for
|
|
173
|
+
# A text description of the desired image(s). The maximum length is 32000
|
|
174
|
+
# characters for the GPT image models.
|
|
182
175
|
#
|
|
183
176
|
# @param background [Symbol, OpenAI::Models::ImageEditParams::Background, nil]
|
|
184
177
|
# Allows to set transparency for the background of the generated image(s). Must be
|
|
@@ -192,9 +185,10 @@ module OpenAI
|
|
|
192
185
|
# set the output format to `png` or `webp`.
|
|
193
186
|
#
|
|
194
187
|
# @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil]
|
|
195
|
-
#
|
|
196
|
-
#
|
|
197
|
-
# `gpt-image-
|
|
188
|
+
# Control how much effort the model will exert to match the style and features,
|
|
189
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
190
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
191
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
198
192
|
#
|
|
199
193
|
# @param mask [Pathname, StringIO, IO, String, OpenAI::FilePart]
|
|
200
194
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
|
@@ -207,12 +201,11 @@ module OpenAI
|
|
|
207
201
|
# content type.
|
|
208
202
|
#
|
|
209
203
|
# @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
|
|
210
|
-
# The model to use for image
|
|
211
|
-
#
|
|
212
|
-
# `gpt-image-2-
|
|
213
|
-
# `gpt-image-2.5-
|
|
214
|
-
# `
|
|
215
|
-
# `gpt-image-1.5`.
|
|
204
|
+
# The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
|
|
205
|
+
# `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
206
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
207
|
+
# `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
|
|
208
|
+
# `chatgpt-image-latest`).
|
|
216
209
|
#
|
|
217
210
|
# @param n [Integer, nil]
|
|
218
211
|
# The number of images to generate. Must be between 1 and 10.
|
|
@@ -242,24 +235,21 @@ module OpenAI
|
|
|
242
235
|
# `xhigh` and `max`. Defaults to `auto`.
|
|
243
236
|
#
|
|
244
237
|
# @param response_format [Symbol, OpenAI::Models::ImageEditParams::ResponseFormat, nil]
|
|
245
|
-
#
|
|
246
|
-
#
|
|
247
|
-
# generated. This parameter is only supported for `dall-e-2` (default is `url` for
|
|
248
|
-
# `dall-e-2`), as GPT image models always return base64-encoded images.
|
|
238
|
+
# Legacy response format parameter for retired image models. Unsupported for GPT
|
|
239
|
+
# image models, which always return base64-encoded images.
|
|
249
240
|
#
|
|
250
241
|
# @param size [String, Symbol, OpenAI::Models::ImageEditParams::Size, nil]
|
|
251
|
-
# The size of the generated images.
|
|
252
|
-
# `gpt-image-2
|
|
253
|
-
# `gpt-image-2.5-
|
|
254
|
-
# resolutions are supported as
|
|
255
|
-
# Width and height must both be
|
|
256
|
-
# must be between 1:3 and 3:1.
|
|
257
|
-
#
|
|
258
|
-
#
|
|
259
|
-
#
|
|
260
|
-
# `
|
|
261
|
-
#
|
|
262
|
-
# `1024x1024`, `1792x1024`, or `1024x1792`.
|
|
242
|
+
# The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
|
|
243
|
+
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
244
|
+
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
|
|
245
|
+
# `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
|
|
246
|
+
# `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
|
|
247
|
+
# divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
|
|
248
|
+
# Resolutions above `2560x1440` are experimental, and the maximum supported
|
|
249
|
+
# resolution is `3840x2160`. The requested size must also satisfy the model's
|
|
250
|
+
# current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
|
|
251
|
+
# `1024x1536` are supported by the GPT image models; `auto` is supported for
|
|
252
|
+
# models that allow automatic sizing.
|
|
263
253
|
#
|
|
264
254
|
# @param user [String]
|
|
265
255
|
# A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
@@ -276,9 +266,6 @@ module OpenAI
|
|
|
276
266
|
# `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`), each image should
|
|
277
267
|
# be a `png`, `webp`, or `jpg` file less than 50MB. You can provide up to 16
|
|
278
268
|
# images.
|
|
279
|
-
#
|
|
280
|
-
# For `dall-e-2`, you can only provide one image, and it should be a square `png`
|
|
281
|
-
# file less than 4MB.
|
|
282
269
|
module Image
|
|
283
270
|
extend OpenAI::Internal::Type::Union
|
|
284
271
|
|
|
@@ -313,9 +300,10 @@ module OpenAI
|
|
|
313
300
|
# @return [Array<Symbol>]
|
|
314
301
|
end
|
|
315
302
|
|
|
316
|
-
#
|
|
317
|
-
#
|
|
318
|
-
# `gpt-image-
|
|
303
|
+
# Control how much effort the model will exert to match the style and features,
|
|
304
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
305
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
306
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
319
307
|
module InputFidelity
|
|
320
308
|
extend OpenAI::Internal::Type::Enum
|
|
321
309
|
|
|
@@ -326,18 +314,17 @@ module OpenAI
|
|
|
326
314
|
# @return [Array<Symbol>]
|
|
327
315
|
end
|
|
328
316
|
|
|
329
|
-
# The model to use for image
|
|
330
|
-
#
|
|
331
|
-
# `gpt-image-2-
|
|
332
|
-
# `gpt-image-2.5-
|
|
333
|
-
# `
|
|
334
|
-
# `gpt-image-1.5`.
|
|
317
|
+
# The GPT image model to use for image editing (`gpt-image-1`, `gpt-image-1-mini`,
|
|
318
|
+
# `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
319
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
320
|
+
# `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
|
|
321
|
+
# `chatgpt-image-latest`).
|
|
335
322
|
module Model
|
|
336
323
|
extend OpenAI::Internal::Type::Union
|
|
337
324
|
|
|
338
325
|
variant String
|
|
339
326
|
|
|
340
|
-
# The model to use for image
|
|
327
|
+
# The GPT image model to use for image editing (`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`).
|
|
341
328
|
variant enum: -> { OpenAI::ImageModel }
|
|
342
329
|
|
|
343
330
|
# @!method self.variants
|
|
@@ -365,22 +352,24 @@ module OpenAI
|
|
|
365
352
|
module Quality
|
|
366
353
|
extend OpenAI::Internal::Type::Enum
|
|
367
354
|
|
|
368
|
-
STANDARD = :standard
|
|
369
355
|
LOW = :low
|
|
370
356
|
MEDIUM = :medium
|
|
371
357
|
HIGH = :high
|
|
372
358
|
XHIGH = :xhigh
|
|
373
359
|
MAX = :max
|
|
374
360
|
AUTO = :auto
|
|
361
|
+
# @deprecated This quality was only supported by retired DALL·E models. Use a GPT image
|
|
362
|
+
# quality instead.
|
|
363
|
+
STANDARD = :standard
|
|
375
364
|
|
|
376
365
|
# @!method self.values
|
|
377
366
|
# @return [Array<Symbol>]
|
|
378
367
|
end
|
|
379
368
|
|
|
380
|
-
#
|
|
381
|
-
#
|
|
382
|
-
#
|
|
383
|
-
#
|
|
369
|
+
# @deprecated
|
|
370
|
+
#
|
|
371
|
+
# Legacy response format parameter for retired image models. Unsupported for GPT
|
|
372
|
+
# image models, which always return base64-encoded images.
|
|
384
373
|
module ResponseFormat
|
|
385
374
|
extend OpenAI::Internal::Type::Enum
|
|
386
375
|
|
|
@@ -391,27 +380,22 @@ module OpenAI
|
|
|
391
380
|
# @return [Array<Symbol>]
|
|
392
381
|
end
|
|
393
382
|
|
|
394
|
-
# The size of the generated images.
|
|
395
|
-
# `gpt-image-2
|
|
396
|
-
# `gpt-image-2.5-
|
|
397
|
-
# resolutions are supported as
|
|
398
|
-
# Width and height must both be
|
|
399
|
-
# must be between 1:3 and 3:1.
|
|
400
|
-
#
|
|
401
|
-
#
|
|
402
|
-
#
|
|
403
|
-
# `
|
|
404
|
-
#
|
|
405
|
-
# `1024x1024`, `1792x1024`, or `1024x1792`.
|
|
383
|
+
# The size of the generated images. Defaults to `auto`. For `gpt-image-2`,
|
|
384
|
+
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
385
|
+
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
|
|
386
|
+
# `gpt-image-2.5-flare-2026-09-08`, arbitrary resolutions are supported as
|
|
387
|
+
# `WIDTHxHEIGHT` strings, for example `1536x864`. Width and height must both be
|
|
388
|
+
# divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1.
|
|
389
|
+
# Resolutions above `2560x1440` are experimental, and the maximum supported
|
|
390
|
+
# resolution is `3840x2160`. The requested size must also satisfy the model's
|
|
391
|
+
# current pixel and edge limits. The standard sizes `1024x1024`, `1536x1024`, and
|
|
392
|
+
# `1024x1536` are supported by the GPT image models; `auto` is supported for
|
|
393
|
+
# models that allow automatic sizing.
|
|
406
394
|
module Size
|
|
407
395
|
extend OpenAI::Internal::Type::Union
|
|
408
396
|
|
|
409
397
|
variant String
|
|
410
398
|
|
|
411
|
-
variant const: -> { OpenAI::Models::ImageEditParams::Size::SIZE_256X256 }
|
|
412
|
-
|
|
413
|
-
variant const: -> { OpenAI::Models::ImageEditParams::Size::SIZE_512X512 }
|
|
414
|
-
|
|
415
399
|
variant const: -> { OpenAI::Models::ImageEditParams::Size::SIZE_1024X1024 }
|
|
416
400
|
|
|
417
401
|
variant const: -> { OpenAI::Models::ImageEditParams::Size::SIZE_1536X1024 }
|
|
@@ -420,6 +404,10 @@ module OpenAI
|
|
|
420
404
|
|
|
421
405
|
variant const: -> { OpenAI::Models::ImageEditParams::Size::AUTO }
|
|
422
406
|
|
|
407
|
+
variant const: -> { OpenAI::Models::ImageEditParams::Size::SIZE_256X256 }
|
|
408
|
+
|
|
409
|
+
variant const: -> { OpenAI::Models::ImageEditParams::Size::SIZE_512X512 }
|
|
410
|
+
|
|
423
411
|
# @!method self.variants
|
|
424
412
|
# @return [Array(String, Symbol)]
|
|
425
413
|
|
|
@@ -429,12 +417,16 @@ module OpenAI
|
|
|
429
417
|
|
|
430
418
|
# @!group
|
|
431
419
|
|
|
432
|
-
SIZE_256X256 = :"256x256"
|
|
433
|
-
SIZE_512X512 = :"512x512"
|
|
434
420
|
SIZE_1024X1024 = :"1024x1024"
|
|
435
421
|
SIZE_1536X1024 = :"1536x1024"
|
|
436
422
|
SIZE_1024X1536 = :"1024x1536"
|
|
437
423
|
AUTO = :auto
|
|
424
|
+
# @deprecated This legacy size suggestion is retained for SDK compatibility. Check the
|
|
425
|
+
# selected GPT image model's supported sizes.
|
|
426
|
+
SIZE_256X256 = :"256x256"
|
|
427
|
+
# @deprecated This legacy size suggestion is retained for SDK compatibility. Check the
|
|
428
|
+
# selected GPT image model's supported sizes.
|
|
429
|
+
SIZE_512X512 = :"512x512"
|
|
438
430
|
|
|
439
431
|
# @!endgroup
|
|
440
432
|
end
|
|
@@ -11,8 +11,7 @@ module OpenAI
|
|
|
11
11
|
|
|
12
12
|
# @!attribute prompt
|
|
13
13
|
# A text description of the desired image(s). The maximum length is 32000
|
|
14
|
-
# characters
|
|
15
|
-
# characters for `dall-e-3`.
|
|
14
|
+
# characters.
|
|
16
15
|
#
|
|
17
16
|
# @return [String]
|
|
18
17
|
required :prompt, String
|
|
@@ -32,12 +31,11 @@ module OpenAI
|
|
|
32
31
|
optional :background, enum: -> { OpenAI::ImageGenerateParams::Background }, nil?: true
|
|
33
32
|
|
|
34
33
|
# @!attribute model
|
|
35
|
-
# The model to use for image generation.
|
|
36
|
-
#
|
|
37
|
-
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
34
|
+
# The GPT image model to use for image generation. Specify a model explicitly.
|
|
35
|
+
# Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
|
|
36
|
+
# `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
38
37
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
39
|
-
# `gpt-image-2.5-flare-2026-09-08
|
|
40
|
-
# specific to the GPT image models is used.
|
|
38
|
+
# `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
|
|
41
39
|
#
|
|
42
40
|
# @return [String, Symbol, OpenAI::Models::ImageModel, nil]
|
|
43
41
|
optional :model, union: -> { OpenAI::ImageGenerateParams::Model }, nil?: true
|
|
@@ -51,8 +49,7 @@ module OpenAI
|
|
|
51
49
|
optional :moderation, enum: -> { OpenAI::ImageGenerateParams::Moderation }, nil?: true
|
|
52
50
|
|
|
53
51
|
# @!attribute n
|
|
54
|
-
# The number of images to generate. Must be between 1 and 10.
|
|
55
|
-
# `n=1` is supported.
|
|
52
|
+
# The number of images to generate. Must be between 1 and 10.
|
|
56
53
|
#
|
|
57
54
|
# @return [Integer, nil]
|
|
58
55
|
optional :n, Integer, nil?: true
|
|
@@ -91,16 +88,14 @@ module OpenAI
|
|
|
91
88
|
# - `high`, `medium` and `low` are supported for the GPT image models.
|
|
92
89
|
# - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
|
|
93
90
|
# `2026-09-08` snapshots, also support `xhigh` and `max`.
|
|
94
|
-
# - `hd` and `standard` are supported for `dall-e-3`.
|
|
95
|
-
# - `standard` is the only option for `dall-e-2`.
|
|
96
91
|
#
|
|
97
92
|
# @return [Symbol, OpenAI::Models::ImageGenerateParams::Quality, nil]
|
|
98
93
|
optional :quality, enum: -> { OpenAI::ImageGenerateParams::Quality }, nil?: true
|
|
99
94
|
|
|
100
95
|
# @!attribute response_format
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
#
|
|
96
|
+
# @deprecated
|
|
97
|
+
#
|
|
98
|
+
# Legacy response format parameter for retired image models. Unsupported for GPT
|
|
104
99
|
# image models, which always return base64-encoded images.
|
|
105
100
|
#
|
|
106
101
|
# @return [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil]
|
|
@@ -116,18 +111,16 @@ module OpenAI
|
|
|
116
111
|
# the maximum supported resolution is `3840x2160`. The requested size must also
|
|
117
112
|
# satisfy the model's current pixel and edge limits. The standard sizes
|
|
118
113
|
# `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
|
|
119
|
-
# `auto` is supported for models that allow automatic sizing.
|
|
120
|
-
# one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
|
|
121
|
-
# `1024x1024`, `1792x1024`, or `1024x1792`.
|
|
114
|
+
# `auto` is supported for models that allow automatic sizing.
|
|
122
115
|
#
|
|
123
116
|
# @return [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil]
|
|
124
117
|
optional :size, union: -> { OpenAI::ImageGenerateParams::Size }, nil?: true
|
|
125
118
|
|
|
126
119
|
# @!attribute style
|
|
127
|
-
#
|
|
128
|
-
#
|
|
129
|
-
#
|
|
130
|
-
#
|
|
120
|
+
# @deprecated
|
|
121
|
+
#
|
|
122
|
+
# Legacy style parameter for retired image models. Unsupported for GPT image
|
|
123
|
+
# models; describe the desired style in the prompt instead.
|
|
131
124
|
#
|
|
132
125
|
# @return [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil]
|
|
133
126
|
optional :style, enum: -> { OpenAI::ImageGenerateParams::Style }, nil?: true
|
|
@@ -143,8 +136,7 @@ module OpenAI
|
|
|
143
136
|
# @!method initialize(prompt:, background: nil, model: nil, moderation: nil, n: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, response_format: nil, size: nil, style: nil, user: nil, request_options: {})
|
|
144
137
|
# @param prompt [String]
|
|
145
138
|
# A text description of the desired image(s). The maximum length is 32000
|
|
146
|
-
# characters
|
|
147
|
-
# characters for `dall-e-3`.
|
|
139
|
+
# characters.
|
|
148
140
|
#
|
|
149
141
|
# @param background [Symbol, OpenAI::Models::ImageGenerateParams::Background, nil]
|
|
150
142
|
# Allows to set transparency for the background of the generated image(s). Must be
|
|
@@ -158,12 +150,11 @@ module OpenAI
|
|
|
158
150
|
# set the output format to `png` or `webp`.
|
|
159
151
|
#
|
|
160
152
|
# @param model [String, Symbol, OpenAI::Models::ImageModel, nil]
|
|
161
|
-
# The model to use for image generation.
|
|
162
|
-
#
|
|
163
|
-
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
153
|
+
# The GPT image model to use for image generation. Specify a model explicitly.
|
|
154
|
+
# Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
|
|
155
|
+
# `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
164
156
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
165
|
-
# `gpt-image-2.5-flare-2026-09-08
|
|
166
|
-
# specific to the GPT image models is used.
|
|
157
|
+
# `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
|
|
167
158
|
#
|
|
168
159
|
# @param moderation [Symbol, OpenAI::Models::ImageGenerateParams::Moderation, nil]
|
|
169
160
|
# Control the content-moderation level for images generated by the GPT image
|
|
@@ -171,8 +162,7 @@ module OpenAI
|
|
|
171
162
|
# value).
|
|
172
163
|
#
|
|
173
164
|
# @param n [Integer, nil]
|
|
174
|
-
# The number of images to generate. Must be between 1 and 10.
|
|
175
|
-
# `n=1` is supported.
|
|
165
|
+
# The number of images to generate. Must be between 1 and 10.
|
|
176
166
|
#
|
|
177
167
|
# @param output_compression [Integer, nil]
|
|
178
168
|
# The compression level (0-100%) for the generated images. This parameter is only
|
|
@@ -199,13 +189,9 @@ module OpenAI
|
|
|
199
189
|
# - `high`, `medium` and `low` are supported for the GPT image models.
|
|
200
190
|
# - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
|
|
201
191
|
# `2026-09-08` snapshots, also support `xhigh` and `max`.
|
|
202
|
-
# - `hd` and `standard` are supported for `dall-e-3`.
|
|
203
|
-
# - `standard` is the only option for `dall-e-2`.
|
|
204
192
|
#
|
|
205
193
|
# @param response_format [Symbol, OpenAI::Models::ImageGenerateParams::ResponseFormat, nil]
|
|
206
|
-
#
|
|
207
|
-
# returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes
|
|
208
|
-
# after the image has been generated. This parameter isn't supported for the GPT
|
|
194
|
+
# Legacy response format parameter for retired image models. Unsupported for GPT
|
|
209
195
|
# image models, which always return base64-encoded images.
|
|
210
196
|
#
|
|
211
197
|
# @param size [String, Symbol, OpenAI::Models::ImageGenerateParams::Size, nil]
|
|
@@ -218,15 +204,11 @@ module OpenAI
|
|
|
218
204
|
# the maximum supported resolution is `3840x2160`. The requested size must also
|
|
219
205
|
# satisfy the model's current pixel and edge limits. The standard sizes
|
|
220
206
|
# `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
|
|
221
|
-
# `auto` is supported for models that allow automatic sizing.
|
|
222
|
-
# one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
|
|
223
|
-
# `1024x1024`, `1792x1024`, or `1024x1792`.
|
|
207
|
+
# `auto` is supported for models that allow automatic sizing.
|
|
224
208
|
#
|
|
225
209
|
# @param style [Symbol, OpenAI::Models::ImageGenerateParams::Style, nil]
|
|
226
|
-
#
|
|
227
|
-
#
|
|
228
|
-
# towards generating hyper-real and dramatic images. Natural causes the model to
|
|
229
|
-
# produce more natural, less hyper-real looking images.
|
|
210
|
+
# Legacy style parameter for retired image models. Unsupported for GPT image
|
|
211
|
+
# models; describe the desired style in the prompt instead.
|
|
230
212
|
#
|
|
231
213
|
# @param user [String]
|
|
232
214
|
# A unique identifier representing your end-user, which can help OpenAI to monitor
|
|
@@ -255,18 +237,17 @@ module OpenAI
|
|
|
255
237
|
# @return [Array<Symbol>]
|
|
256
238
|
end
|
|
257
239
|
|
|
258
|
-
# The model to use for image generation.
|
|
259
|
-
#
|
|
260
|
-
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
240
|
+
# The GPT image model to use for image generation. Specify a model explicitly.
|
|
241
|
+
# Supported models include `gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`,
|
|
242
|
+
# `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
261
243
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
262
|
-
# `gpt-image-2.5-flare-2026-09-08
|
|
263
|
-
# specific to the GPT image models is used.
|
|
244
|
+
# `gpt-image-2.5-flare-2026-09-08`, and `chatgpt-image-latest`.
|
|
264
245
|
module Model
|
|
265
246
|
extend OpenAI::Internal::Type::Union
|
|
266
247
|
|
|
267
248
|
variant String
|
|
268
249
|
|
|
269
|
-
# The model to use for image generation.
|
|
250
|
+
# The GPT image model to use for image generation. Specify a model explicitly. Supported models include `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`.
|
|
270
251
|
variant enum: -> { OpenAI::ImageModel }
|
|
271
252
|
|
|
272
253
|
# @!method self.variants
|
|
@@ -306,27 +287,29 @@ module OpenAI
|
|
|
306
287
|
# - `high`, `medium` and `low` are supported for the GPT image models.
|
|
307
288
|
# - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their
|
|
308
289
|
# `2026-09-08` snapshots, also support `xhigh` and `max`.
|
|
309
|
-
# - `hd` and `standard` are supported for `dall-e-3`.
|
|
310
|
-
# - `standard` is the only option for `dall-e-2`.
|
|
311
290
|
module Quality
|
|
312
291
|
extend OpenAI::Internal::Type::Enum
|
|
313
292
|
|
|
314
|
-
STANDARD = :standard
|
|
315
|
-
HD = :hd
|
|
316
293
|
LOW = :low
|
|
317
294
|
MEDIUM = :medium
|
|
318
295
|
HIGH = :high
|
|
319
296
|
XHIGH = :xhigh
|
|
320
297
|
MAX = :max
|
|
321
298
|
AUTO = :auto
|
|
299
|
+
# @deprecated This quality was only supported by retired DALL·E models. Use a GPT image
|
|
300
|
+
# quality instead.
|
|
301
|
+
STANDARD = :standard
|
|
302
|
+
# @deprecated This quality was only supported by retired DALL·E models. Use a GPT image
|
|
303
|
+
# quality instead.
|
|
304
|
+
HD = :hd
|
|
322
305
|
|
|
323
306
|
# @!method self.values
|
|
324
307
|
# @return [Array<Symbol>]
|
|
325
308
|
end
|
|
326
309
|
|
|
327
|
-
#
|
|
328
|
-
#
|
|
329
|
-
#
|
|
310
|
+
# @deprecated
|
|
311
|
+
#
|
|
312
|
+
# Legacy response format parameter for retired image models. Unsupported for GPT
|
|
330
313
|
# image models, which always return base64-encoded images.
|
|
331
314
|
module ResponseFormat
|
|
332
315
|
extend OpenAI::Internal::Type::Enum
|
|
@@ -347,9 +330,7 @@ module OpenAI
|
|
|
347
330
|
# the maximum supported resolution is `3840x2160`. The requested size must also
|
|
348
331
|
# satisfy the model's current pixel and edge limits. The standard sizes
|
|
349
332
|
# `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
|
|
350
|
-
# `auto` is supported for models that allow automatic sizing.
|
|
351
|
-
# one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
|
|
352
|
-
# `1024x1024`, `1792x1024`, or `1024x1792`.
|
|
333
|
+
# `auto` is supported for models that allow automatic sizing.
|
|
353
334
|
module Size
|
|
354
335
|
extend OpenAI::Internal::Type::Union
|
|
355
336
|
|
|
@@ -384,18 +365,26 @@ module OpenAI
|
|
|
384
365
|
SIZE_1024X1024 = :"1024x1024"
|
|
385
366
|
SIZE_1536X1024 = :"1536x1024"
|
|
386
367
|
SIZE_1024X1536 = :"1024x1536"
|
|
368
|
+
# @deprecated This legacy size suggestion is retained for SDK compatibility. Check the
|
|
369
|
+
# selected GPT image model's supported sizes.
|
|
387
370
|
SIZE_256X256 = :"256x256"
|
|
371
|
+
# @deprecated This legacy size suggestion is retained for SDK compatibility. Check the
|
|
372
|
+
# selected GPT image model's supported sizes.
|
|
388
373
|
SIZE_512X512 = :"512x512"
|
|
374
|
+
# @deprecated This legacy size suggestion is retained for SDK compatibility. Check the
|
|
375
|
+
# selected GPT image model's supported sizes.
|
|
389
376
|
SIZE_1792X1024 = :"1792x1024"
|
|
377
|
+
# @deprecated This legacy size suggestion is retained for SDK compatibility. Check the
|
|
378
|
+
# selected GPT image model's supported sizes.
|
|
390
379
|
SIZE_1024X1792 = :"1024x1792"
|
|
391
380
|
|
|
392
381
|
# @!endgroup
|
|
393
382
|
end
|
|
394
383
|
|
|
395
|
-
#
|
|
396
|
-
#
|
|
397
|
-
#
|
|
398
|
-
#
|
|
384
|
+
# @deprecated
|
|
385
|
+
#
|
|
386
|
+
# Legacy style parameter for retired image models. Unsupported for GPT image
|
|
387
|
+
# models; describe the desired style in the prompt instead.
|
|
399
388
|
module Style
|
|
400
389
|
extend OpenAI::Internal::Type::Enum
|
|
401
390
|
|