openai 0.86.0 → 0.87.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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +10 -1
  4. data/examples/audio/record_and_play.rb +19 -0
  5. data/examples/responses/websocket_workflows.rb +159 -0
  6. data/lib/openai/helpers/local_audio/errors.rb +27 -0
  7. data/lib/openai/helpers/local_audio/process.rb +158 -0
  8. data/lib/openai/helpers/local_audio.rb +157 -0
  9. data/lib/openai/helpers/realtime/connection.rb +20 -2
  10. data/lib/openai/helpers/realtime/errors.rb +18 -0
  11. data/lib/openai/helpers/realtime/recovery.rb +489 -0
  12. data/lib/openai/helpers/realtime/resources/realtime_extension.rb +26 -1
  13. data/lib/openai/helpers/realtime.rb +1 -0
  14. data/lib/openai/models/beta/beta_response_input_item.rb +84 -1
  15. data/lib/openai/models/beta/beta_response_item.rb +72 -1
  16. data/lib/openai/models/beta/beta_response_output_item.rb +84 -1
  17. data/lib/openai/models/beta/beta_responses_client_event.rb +3 -0
  18. data/lib/openai/models/beta/beta_tool.rb +69 -37
  19. data/lib/openai/models/beta/response_create_params.rb +3 -0
  20. data/lib/openai/models/conversations/conversation_item.rb +82 -1
  21. data/lib/openai/models/image_edit_completed_event.rb +34 -8
  22. data/lib/openai/models/image_edit_params.rb +64 -44
  23. data/lib/openai/models/image_edit_partial_image_event.rb +34 -8
  24. data/lib/openai/models/image_gen_completed_event.rb +34 -8
  25. data/lib/openai/models/image_gen_partial_image_event.rb +34 -8
  26. data/lib/openai/models/image_generate_params.rb +51 -35
  27. data/lib/openai/models/image_model.rb +4 -0
  28. data/lib/openai/models/images_response.rb +37 -13
  29. data/lib/openai/models/responses/response_create_params.rb +3 -0
  30. data/lib/openai/models/responses/response_input_item.rb +84 -1
  31. data/lib/openai/models/responses/response_item.rb +72 -1
  32. data/lib/openai/models/responses/response_output_item.rb +84 -1
  33. data/lib/openai/models/responses/responses_client_event.rb +3 -0
  34. data/lib/openai/models/responses/tool.rb +69 -37
  35. data/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb +3 -3
  36. data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +5 -3
  37. data/lib/openai/resources/images.rb +12 -14
  38. data/lib/openai/version.rb +1 -1
  39. data/local-audio.md +146 -0
  40. data/rbi/openai/helpers/local_audio/interface.rbi +110 -0
  41. data/rbi/openai/helpers/realtime/connection.rbi +18 -2
  42. data/rbi/openai/helpers/realtime/extensions.rbi +8 -0
  43. data/rbi/openai/helpers/realtime/recovery.rbi +27 -0
  44. data/rbi/openai/models/beta/beta_response_input_item.rbi +86 -1
  45. data/rbi/openai/models/beta/beta_response_item.rbi +78 -1
  46. data/rbi/openai/models/beta/beta_response_output_item.rbi +84 -1
  47. data/rbi/openai/models/beta/beta_responses_client_event.rbi +6 -0
  48. data/rbi/openai/models/beta/beta_tool.rbi +90 -51
  49. data/rbi/openai/models/beta/response_create_params.rbi +6 -0
  50. data/rbi/openai/models/conversations/conversation_item.rbi +88 -1
  51. data/rbi/openai/models/image_edit_completed_event.rbi +20 -9
  52. data/rbi/openai/models/image_edit_params.rbi +89 -60
  53. data/rbi/openai/models/image_edit_partial_image_event.rbi +20 -9
  54. data/rbi/openai/models/image_gen_completed_event.rbi +20 -9
  55. data/rbi/openai/models/image_gen_partial_image_event.rbi +20 -9
  56. data/rbi/openai/models/image_generate_params.rbi +71 -48
  57. data/rbi/openai/models/image_model.rbi +4 -0
  58. data/rbi/openai/models/images_response.rbi +27 -16
  59. data/rbi/openai/models/responses/response_create_params.rbi +6 -0
  60. data/rbi/openai/models/responses/response_input_item.rbi +88 -1
  61. data/rbi/openai/models/responses/response_item.rbi +80 -1
  62. data/rbi/openai/models/responses/response_output_item.rbi +84 -1
  63. data/rbi/openai/models/responses/responses_client_event.rbi +6 -0
  64. data/rbi/openai/models/responses/tool.rbi +90 -51
  65. data/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi +4 -4
  66. data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +8 -4
  67. data/rbi/openai/resources/beta/responses.rbi +6 -2
  68. data/rbi/openai/resources/images.rbi +106 -76
  69. data/rbi/openai/resources/responses.rbi +6 -0
  70. data/realtime.md +101 -0
  71. data/responses-websocket.md +182 -0
  72. data/sig/openai/helpers/local_audio/interface.rbs +62 -0
  73. data/sig/openai/helpers/realtime/connection.rbs +9 -1
  74. data/sig/openai/helpers/realtime/extensions.rbs +4 -0
  75. data/sig/openai/helpers/realtime/recovery.rbs +19 -0
  76. data/sig/openai/models/beta/beta_response_input_item.rbs +39 -2
  77. data/sig/openai/models/beta/beta_response_item.rbs +39 -2
  78. data/sig/openai/models/beta/beta_response_output_item.rbs +39 -2
  79. data/sig/openai/models/beta/beta_tool.rbs +11 -1
  80. data/sig/openai/models/conversations/conversation_item.rbs +39 -2
  81. data/sig/openai/models/image_edit_completed_event.rbs +11 -4
  82. data/sig/openai/models/image_edit_params.rbs +3 -1
  83. data/sig/openai/models/image_edit_partial_image_event.rbs +11 -4
  84. data/sig/openai/models/image_gen_completed_event.rbs +11 -4
  85. data/sig/openai/models/image_gen_partial_image_event.rbs +11 -4
  86. data/sig/openai/models/image_generate_params.rbs +4 -1
  87. data/sig/openai/models/image_model.rbs +8 -0
  88. data/sig/openai/models/images_response.rbs +10 -4
  89. data/sig/openai/models/responses/response_input_item.rbs +39 -2
  90. data/sig/openai/models/responses/response_item.rbs +39 -2
  91. data/sig/openai/models/responses/response_output_item.rbs +39 -2
  92. data/sig/openai/models/responses/tool.rbs +11 -1
  93. metadata +15 -1
@@ -1360,6 +1360,15 @@ module OpenAI
1360
1360
  sig { params(agent: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent::OrHash)).void }
1361
1361
  attr_writer :agent
1362
1362
 
1363
+ # The quality of the image generated by the image generation tool call. One of
1364
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
1365
+ sig { returns(T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol)) }
1366
+ attr_accessor :quality
1367
+
1368
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
1369
+ sig { returns(T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::Variants)) }
1370
+ attr_accessor :size
1371
+
1363
1372
  # An image generation request made by the model.
1364
1373
  sig do
1365
1374
  params(
@@ -1372,6 +1381,10 @@ module OpenAI
1372
1381
 
1373
1382
  agent: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent::OrHash),
1374
1383
 
1384
+ quality: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::OrSymbol),
1385
+
1386
+ size: T.nilable(T.any(String, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::OrSymbol)),
1387
+
1375
1388
  type: Symbol
1376
1389
  )
1377
1390
  .returns(T.attached_class)
@@ -1390,6 +1403,13 @@ module OpenAI
1390
1403
  # The agent that produced this item.
1391
1404
  agent: nil,
1392
1405
 
1406
+ # The quality of the image generated by the image generation tool call. One of
1407
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
1408
+ quality: nil,
1409
+
1410
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
1411
+ size: nil,
1412
+
1393
1413
  # The type of the image generation call. Always `image_generation_call`.
1394
1414
 
1395
1415
  type: :image_generation_call
@@ -1403,7 +1423,9 @@ module OpenAI
1403
1423
  result: T.nilable(String),
1404
1424
  status: OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Status::TaggedSymbol,
1405
1425
  type: Symbol,
1406
- agent: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent)
1426
+ agent: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Agent),
1427
+ quality: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol),
1428
+ size: T.nilable(OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::Variants)
1407
1429
  }
1408
1430
  )
1409
1431
  end
@@ -1466,6 +1488,61 @@ module OpenAI
1466
1488
  end
1467
1489
 
1468
1490
  end
1491
+
1492
+ # The quality of the image generated by the image generation tool call. One of
1493
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
1494
+ module Quality
1495
+ extend OpenAI::Internal::Type::Enum
1496
+
1497
+ TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality) }
1498
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1499
+
1500
+ LOW = T.let(:low, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol)
1501
+ MEDIUM = T.let(:medium, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol)
1502
+ HIGH = T.let(:high, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol)
1503
+ XHIGH = T.let(:xhigh, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol)
1504
+ MAX = T.let(:max, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol)
1505
+ AUTO = T.let(:auto, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol)
1506
+
1507
+ sig {
1508
+ override.returns(T::Array[OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Quality::TaggedSymbol])
1509
+ }
1510
+ def self.values
1511
+ end
1512
+ end
1513
+
1514
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
1515
+ module Size
1516
+ extend OpenAI::Internal::Type::Union
1517
+
1518
+ Variants = T.type_alias {
1519
+ T.any(String, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol)
1520
+ }
1521
+
1522
+ sig { override.returns(T::Array[OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::Variants]) }
1523
+ def self.variants
1524
+ end
1525
+
1526
+ TaggedSymbol = T.type_alias do
1527
+ T.all(Symbol, OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size)
1528
+ end
1529
+
1530
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1531
+
1532
+ SIZE_1024X1024 = T.let(
1533
+ :"1024x1024",
1534
+ OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol
1535
+ )
1536
+ SIZE_1024X1536 = T.let(
1537
+ :"1024x1536",
1538
+ OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol
1539
+ )
1540
+ SIZE_1536X1024 = T.let(
1541
+ :"1536x1024",
1542
+ OpenAI::Beta::BetaResponseItem::ImageGenerationCall::Size::TaggedSymbol
1543
+ )
1544
+
1545
+ end
1469
1546
  end
1470
1547
 
1471
1548
  class LocalShellCall < OpenAI::Internal::Type::BaseModel
@@ -1390,6 +1390,15 @@ module OpenAI
1390
1390
  }
1391
1391
  attr_writer :agent
1392
1392
 
1393
+ # The quality of the image generated by the image generation tool call. One of
1394
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
1395
+ sig { returns(T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)) }
1396
+ attr_accessor :quality
1397
+
1398
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
1399
+ sig { returns(T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::Variants)) }
1400
+ attr_accessor :size
1401
+
1393
1402
  # An image generation request made by the model.
1394
1403
  sig do
1395
1404
  params(
@@ -1402,6 +1411,10 @@ module OpenAI
1402
1411
 
1403
1412
  agent: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent::OrHash),
1404
1413
 
1414
+ quality: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::OrSymbol),
1415
+
1416
+ size: T.nilable(T.any(String, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::OrSymbol)),
1417
+
1405
1418
  type: Symbol
1406
1419
  )
1407
1420
  .returns(T.attached_class)
@@ -1420,6 +1433,13 @@ module OpenAI
1420
1433
  # The agent that produced this item.
1421
1434
  agent: nil,
1422
1435
 
1436
+ # The quality of the image generated by the image generation tool call. One of
1437
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
1438
+ quality: nil,
1439
+
1440
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
1441
+ size: nil,
1442
+
1423
1443
  # The type of the image generation call. Always `image_generation_call`.
1424
1444
 
1425
1445
  type: :image_generation_call
@@ -1433,7 +1453,9 @@ module OpenAI
1433
1453
  result: T.nilable(String),
1434
1454
  status: OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Status::TaggedSymbol,
1435
1455
  type: Symbol,
1436
- agent: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent)
1456
+ agent: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Agent),
1457
+ quality: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol),
1458
+ size: T.nilable(OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::Variants)
1437
1459
  }
1438
1460
  )
1439
1461
  end
@@ -1509,6 +1531,67 @@ module OpenAI
1509
1531
  end
1510
1532
 
1511
1533
  end
1534
+
1535
+ # The quality of the image generated by the image generation tool call. One of
1536
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
1537
+ module Quality
1538
+ extend OpenAI::Internal::Type::Enum
1539
+
1540
+ TaggedSymbol = T.type_alias {
1541
+ T.all(Symbol, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality)
1542
+ }
1543
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1544
+
1545
+ LOW = T.let(:low, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)
1546
+ MEDIUM = T.let(:medium, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)
1547
+ HIGH = T.let(:high, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)
1548
+ XHIGH = T.let(:xhigh, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)
1549
+ MAX = T.let(:max, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)
1550
+ AUTO = T.let(:auto, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol)
1551
+
1552
+ sig {
1553
+ override.returns(
1554
+ T::Array[OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Quality::TaggedSymbol]
1555
+ )
1556
+ }
1557
+ def self.values
1558
+ end
1559
+ end
1560
+
1561
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
1562
+ module Size
1563
+ extend OpenAI::Internal::Type::Union
1564
+
1565
+ Variants = T.type_alias {
1566
+ T.any(String, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol)
1567
+ }
1568
+
1569
+ sig {
1570
+ override.returns(T::Array[OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::Variants])
1571
+ }
1572
+ def self.variants
1573
+ end
1574
+
1575
+ TaggedSymbol = T.type_alias do
1576
+ T.all(Symbol, OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size)
1577
+ end
1578
+
1579
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1580
+
1581
+ SIZE_1024X1024 = T.let(
1582
+ :"1024x1024",
1583
+ OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol
1584
+ )
1585
+ SIZE_1024X1536 = T.let(
1586
+ :"1024x1536",
1587
+ OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol
1588
+ )
1589
+ SIZE_1536X1024 = T.let(
1590
+ :"1536x1024",
1591
+ OpenAI::Beta::BetaResponseOutputItem::ImageGenerationCall::Size::TaggedSymbol
1592
+ )
1593
+
1594
+ end
1512
1595
  end
1513
1596
 
1514
1597
  class LocalShellCall < OpenAI::Internal::Type::BaseModel
@@ -264,6 +264,9 @@ module OpenAI
264
264
  attr_accessor :service_tier
265
265
 
266
266
  # Whether to store the generated model response for later retrieval via API.
267
+ # Defaults to true when omitted. If set to true, response data will be stored for
268
+ # at least 30 days, subject to the
269
+ # [data retention exceptions](/api/docs/guides/your-data#v1responses).
267
270
  sig { returns(T.nilable(T::Boolean)) }
268
271
  attr_accessor :store
269
272
 
@@ -753,6 +756,9 @@ module OpenAI
753
756
  service_tier: nil,
754
757
 
755
758
  # Whether to store the generated model response for later retrieval via API.
759
+ # Defaults to true when omitted. If set to true, response data will be stored for
760
+ # at least 30 days, subject to the
761
+ # [data retention exceptions](/api/docs/guides/your-data#v1responses).
756
762
  store: nil,
757
763
 
758
764
  # If set to true, the model response data will be streamed to the client as it is
@@ -953,9 +953,11 @@ module OpenAI
953
953
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
954
954
  # the model will automatically determine the best background for the image.
955
955
  #
956
- # Transparent backgrounds are available for supported GPT Image models. For
957
- # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
958
- # using `transparent`, set the output format to `png` or `webp`.
956
+ # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
957
+ # snapshots, support `opaque` and `transparent` backgrounds. Transparent
958
+ # backgrounds are available for supported GPT Image models. For `gpt-image-2` and
959
+ # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
960
+ # set the output format to `png` or `webp`.
959
961
  sig { returns(T.nilable(OpenAI::Beta::BetaTool::ImageGeneration::Background::OrSymbol)) }
960
962
  attr_reader :background
961
963
 
@@ -978,7 +980,9 @@ module OpenAI
978
980
  attr_writer :input_image_mask
979
981
 
980
982
  # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
981
- # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or
983
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
984
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
985
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
982
986
  # `chatgpt-image-latest`. Default: `gpt-image-1`.
983
987
  sig { returns(T.nilable(T.any(String, OpenAI::Beta::BetaTool::ImageGeneration::Model::OrSymbol))) }
984
988
  attr_reader :model
@@ -1016,25 +1020,28 @@ module OpenAI
1016
1020
  sig { params(partial_images: Integer).void }
1017
1021
  attr_writer :partial_images
1018
1022
 
1019
- # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`.
1020
- # Default: `auto`.
1023
+ # The quality of the generated image. The GPT image models support `low`,
1024
+ # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
1025
+ # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
1026
+ # `auto`.
1021
1027
  sig { returns(T.nilable(OpenAI::Beta::BetaTool::ImageGeneration::Quality::OrSymbol)) }
1022
1028
  attr_reader :quality
1023
1029
 
1024
1030
  sig { params(quality: OpenAI::Beta::BetaTool::ImageGeneration::Quality::OrSymbol).void }
1025
1031
  attr_writer :quality
1026
1032
 
1027
- # The size of the generated images. For `gpt-image-2` and
1028
- # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT`
1029
- # strings, for example `1536x864`. Width and height must both be divisible by 16
1030
- # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
1031
- # `2560x1440` are experimental, and the maximum supported resolution is
1032
- # `3840x2160`. The requested size must also satisfy the model's current pixel and
1033
- # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are
1034
- # supported by the GPT image models; `auto` is supported for models that allow
1035
- # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or
1036
- # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or
1037
- # `1024x1792`.
1033
+ # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
1034
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
1035
+ # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
1036
+ # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
1037
+ # Width and height must both be divisible by 16 and the requested aspect ratio
1038
+ # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
1039
+ # the maximum supported resolution is `3840x2160`. The requested size must also
1040
+ # satisfy the model's current pixel and edge limits. The standard sizes
1041
+ # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
1042
+ # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
1043
+ # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
1044
+ # `1024x1024`, `1792x1024`, or `1024x1792`.
1038
1045
  sig { returns(T.nilable(T.any(String, OpenAI::Beta::BetaTool::ImageGeneration::Size::OrSymbol))) }
1039
1046
  attr_reader :size
1040
1047
 
@@ -1080,9 +1087,11 @@ module OpenAI
1080
1087
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
1081
1088
  # the model will automatically determine the best background for the image.
1082
1089
  #
1083
- # Transparent backgrounds are available for supported GPT Image models. For
1084
- # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
1085
- # using `transparent`, set the output format to `png` or `webp`.
1090
+ # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
1091
+ # snapshots, support `opaque` and `transparent` backgrounds. Transparent
1092
+ # backgrounds are available for supported GPT Image models. For `gpt-image-2` and
1093
+ # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
1094
+ # set the output format to `png` or `webp`.
1086
1095
  background: nil,
1087
1096
 
1088
1097
  # Control how much effort the model will exert to match the style and features,
@@ -1096,7 +1105,9 @@ module OpenAI
1096
1105
  input_image_mask: nil,
1097
1106
 
1098
1107
  # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
1099
- # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or
1108
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
1109
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
1110
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
1100
1111
  # `chatgpt-image-latest`. Default: `gpt-image-1`.
1101
1112
  model: nil,
1102
1113
 
@@ -1114,21 +1125,24 @@ module OpenAI
1114
1125
  # to 3.
1115
1126
  partial_images: nil,
1116
1127
 
1117
- # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`.
1118
- # Default: `auto`.
1128
+ # The quality of the generated image. The GPT image models support `low`,
1129
+ # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
1130
+ # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
1131
+ # `auto`.
1119
1132
  quality: nil,
1120
1133
 
1121
- # The size of the generated images. For `gpt-image-2` and
1122
- # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT`
1123
- # strings, for example `1536x864`. Width and height must both be divisible by 16
1124
- # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
1125
- # `2560x1440` are experimental, and the maximum supported resolution is
1126
- # `3840x2160`. The requested size must also satisfy the model's current pixel and
1127
- # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are
1128
- # supported by the GPT image models; `auto` is supported for models that allow
1129
- # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or
1130
- # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or
1131
- # `1024x1792`.
1134
+ # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
1135
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
1136
+ # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
1137
+ # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
1138
+ # Width and height must both be divisible by 16 and the requested aspect ratio
1139
+ # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
1140
+ # the maximum supported resolution is `3840x2160`. The requested size must also
1141
+ # satisfy the model's current pixel and edge limits. The standard sizes
1142
+ # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
1143
+ # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
1144
+ # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
1145
+ # `1024x1024`, `1792x1024`, or `1024x1792`.
1132
1146
  size: nil,
1133
1147
 
1134
1148
  # The type of the image generation tool. Always `image_generation`.
@@ -1178,9 +1192,11 @@ module OpenAI
1178
1192
  # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
1179
1193
  # the model will automatically determine the best background for the image.
1180
1194
  #
1181
- # Transparent backgrounds are available for supported GPT Image models. For
1182
- # `gpt-image-2` and `gpt-image-2-2026-04-21`, this support is in preview. When
1183
- # using `transparent`, set the output format to `png` or `webp`.
1195
+ # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
1196
+ # snapshots, support `opaque` and `transparent` backgrounds. Transparent
1197
+ # backgrounds are available for supported GPT Image models. For `gpt-image-2` and
1198
+ # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
1199
+ # set the output format to `png` or `webp`.
1184
1200
  module Background
1185
1201
  extend OpenAI::Internal::Type::Enum
1186
1202
 
@@ -1269,7 +1285,9 @@ module OpenAI
1269
1285
  end
1270
1286
 
1271
1287
  # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
1272
- # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`, or
1288
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
1289
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
1290
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
1273
1291
  # `chatgpt-image-latest`. Default: `gpt-image-1`.
1274
1292
  module Model
1275
1293
  extend OpenAI::Internal::Type::Union
@@ -1293,6 +1311,22 @@ module OpenAI
1293
1311
  :"gpt-image-2-2026-04-21",
1294
1312
  OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol
1295
1313
  )
1314
+ GPT_IMAGE_2_5_SUNBURST = T.let(
1315
+ :"gpt-image-2.5-sunburst",
1316
+ OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol
1317
+ )
1318
+ GPT_IMAGE_2_5_SUNBURST_2026_09_08 = T.let(
1319
+ :"gpt-image-2.5-sunburst-2026-09-08",
1320
+ OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol
1321
+ )
1322
+ GPT_IMAGE_2_5_FLARE = T.let(
1323
+ :"gpt-image-2.5-flare",
1324
+ OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol
1325
+ )
1326
+ GPT_IMAGE_2_5_FLARE_2026_09_08 = T.let(
1327
+ :"gpt-image-2.5-flare-2026-09-08",
1328
+ OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol
1329
+ )
1296
1330
  GPT_IMAGE_1_5 = T.let(:"gpt-image-1.5", OpenAI::Beta::BetaTool::ImageGeneration::Model::TaggedSymbol)
1297
1331
  CHATGPT_IMAGE_LATEST = T.let(
1298
1332
  :"chatgpt-image-latest",
@@ -1333,8 +1367,10 @@ module OpenAI
1333
1367
  end
1334
1368
  end
1335
1369
 
1336
- # The quality of the generated image. One of `low`, `medium`, `high`, or `auto`.
1337
- # Default: `auto`.
1370
+ # The quality of the generated image. The GPT image models support `low`,
1371
+ # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
1372
+ # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
1373
+ # `auto`.
1338
1374
  module Quality
1339
1375
  extend OpenAI::Internal::Type::Enum
1340
1376
 
@@ -1344,6 +1380,8 @@ module OpenAI
1344
1380
  LOW = T.let(:low, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol)
1345
1381
  MEDIUM = T.let(:medium, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol)
1346
1382
  HIGH = T.let(:high, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol)
1383
+ XHIGH = T.let(:xhigh, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol)
1384
+ MAX = T.let(:max, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol)
1347
1385
  AUTO = T.let(:auto, OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol)
1348
1386
 
1349
1387
  sig { override.returns(T::Array[OpenAI::Beta::BetaTool::ImageGeneration::Quality::TaggedSymbol]) }
@@ -1351,17 +1389,18 @@ module OpenAI
1351
1389
  end
1352
1390
  end
1353
1391
 
1354
- # The size of the generated images. For `gpt-image-2` and
1355
- # `gpt-image-2-2026-04-21`, arbitrary resolutions are supported as `WIDTHxHEIGHT`
1356
- # strings, for example `1536x864`. Width and height must both be divisible by 16
1357
- # and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
1358
- # `2560x1440` are experimental, and the maximum supported resolution is
1359
- # `3840x2160`. The requested size must also satisfy the model's current pixel and
1360
- # edge limits. The standard sizes `1024x1024`, `1536x1024`, and `1024x1536` are
1361
- # supported by the GPT image models; `auto` is supported for models that allow
1362
- # automatic sizing. For `dall-e-2`, use one of `256x256`, `512x512`, or
1363
- # `1024x1024`. For `dall-e-3`, use one of `1024x1024`, `1792x1024`, or
1364
- # `1024x1792`.
1392
+ # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
1393
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
1394
+ # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
1395
+ # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
1396
+ # Width and height must both be divisible by 16 and the requested aspect ratio
1397
+ # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
1398
+ # the maximum supported resolution is `3840x2160`. The requested size must also
1399
+ # satisfy the model's current pixel and edge limits. The standard sizes
1400
+ # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
1401
+ # `auto` is supported for models that allow automatic sizing. For `dall-e-2`, use
1402
+ # one of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`, use one of
1403
+ # `1024x1024`, `1792x1024`, or `1024x1792`.
1365
1404
  module Size
1366
1405
  extend OpenAI::Internal::Type::Union
1367
1406
 
@@ -229,6 +229,9 @@ module OpenAI
229
229
  attr_accessor :service_tier
230
230
 
231
231
  # Whether to store the generated model response for later retrieval via API.
232
+ # Defaults to true when omitted. If set to true, response data will be stored for
233
+ # at least 30 days, subject to the
234
+ # [data retention exceptions](/api/docs/guides/your-data#v1responses).
232
235
  sig { returns(T.nilable(T::Boolean)) }
233
236
  attr_accessor :store
234
237
 
@@ -684,6 +687,9 @@ module OpenAI
684
687
  service_tier: nil,
685
688
 
686
689
  # Whether to store the generated model response for later retrieval via API.
690
+ # Defaults to true when omitted. If set to true, response data will be stored for
691
+ # at least 30 days, subject to the
692
+ # [data retention exceptions](/api/docs/guides/your-data#v1responses).
687
693
  store: nil,
688
694
 
689
695
  # Options for streaming responses. Only set this when you set `stream: true`.
@@ -71,6 +71,17 @@ module OpenAI
71
71
  sig { returns(Symbol) }
72
72
  attr_accessor :type
73
73
 
74
+ # The quality of the image generated by the image generation tool call. One of
75
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
76
+ sig {
77
+ returns(T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol))
78
+ }
79
+ attr_accessor :quality
80
+
81
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
82
+ sig { returns(T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::Variants)) }
83
+ attr_accessor :size
84
+
74
85
  # An image generation request made by the model.
75
86
  sig do
76
87
  params(
@@ -81,6 +92,12 @@ module OpenAI
81
92
 
82
93
  status: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Status::OrSymbol,
83
94
 
95
+ quality: T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::OrSymbol),
96
+
97
+ size: T.nilable(
98
+ T.any(String, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::OrSymbol)
99
+ ),
100
+
84
101
  type: Symbol
85
102
  )
86
103
  .returns(T.attached_class)
@@ -96,6 +113,13 @@ module OpenAI
96
113
  # The status of the image generation call.
97
114
  status:,
98
115
 
116
+ # The quality of the image generated by the image generation tool call. One of
117
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
118
+ quality: nil,
119
+
120
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
121
+ size: nil,
122
+
99
123
  # The type of the image generation call. Always `image_generation_call`.
100
124
 
101
125
  type: :image_generation_call
@@ -108,7 +132,9 @@ module OpenAI
108
132
  id: String,
109
133
  result: T.nilable(String),
110
134
  status: OpenAI::Conversations::ConversationItem::ImageGenerationCall::Status::TaggedSymbol,
111
- type: Symbol
135
+ type: Symbol,
136
+ quality: T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol),
137
+ size: T.nilable(OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::Variants)
112
138
  }
113
139
  )
114
140
  end
@@ -146,6 +172,67 @@ module OpenAI
146
172
  def self.values
147
173
  end
148
174
  end
175
+
176
+ # The quality of the image generated by the image generation tool call. One of
177
+ # `low`, `medium`, `high`, `xhigh`, `max`, or `auto`.
178
+ module Quality
179
+ extend OpenAI::Internal::Type::Enum
180
+
181
+ TaggedSymbol = T.type_alias {
182
+ T.all(Symbol, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality)
183
+ }
184
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
185
+
186
+ LOW = T.let(:low, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol)
187
+ MEDIUM = T.let(:medium, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol)
188
+ HIGH = T.let(:high, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol)
189
+ XHIGH = T.let(:xhigh, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol)
190
+ MAX = T.let(:max, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol)
191
+ AUTO = T.let(:auto, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol)
192
+
193
+ sig {
194
+ override.returns(
195
+ T::Array[OpenAI::Conversations::ConversationItem::ImageGenerationCall::Quality::TaggedSymbol]
196
+ )
197
+ }
198
+ def self.values
199
+ end
200
+ end
201
+
202
+ # The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
203
+ module Size
204
+ extend OpenAI::Internal::Type::Union
205
+
206
+ Variants = T.type_alias {
207
+ T.any(String, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol)
208
+ }
209
+
210
+ sig {
211
+ override.returns(T::Array[OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::Variants])
212
+ }
213
+ def self.variants
214
+ end
215
+
216
+ TaggedSymbol = T.type_alias do
217
+ T.all(Symbol, OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size)
218
+ end
219
+
220
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
221
+
222
+ SIZE_1024X1024 = T.let(
223
+ :"1024x1024",
224
+ OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol
225
+ )
226
+ SIZE_1024X1536 = T.let(
227
+ :"1024x1536",
228
+ OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol
229
+ )
230
+ SIZE_1536X1024 = T.let(
231
+ :"1536x1024",
232
+ OpenAI::Conversations::ConversationItem::ImageGenerationCall::Size::TaggedSymbol
233
+ )
234
+
235
+ end
149
236
  end
150
237
 
151
238
  class AdditionalTools < OpenAI::Internal::Type::BaseModel