openai 0.74.0 → 0.76.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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +8 -7
  4. data/VERSIONING.md +77 -0
  5. data/lib/openai/client.rb +4 -0
  6. data/lib/openai/internal/type/base_stream.rb +1 -1
  7. data/lib/openai/models/beta/response_compact_params.rb +32 -3
  8. data/lib/openai/models/content_provenance_check.rb +221 -0
  9. data/lib/openai/models/content_provenance_check_create_params.rb +22 -0
  10. data/lib/openai/models/responses/response_compact_params.rb +32 -3
  11. data/lib/openai/models.rb +4 -0
  12. data/lib/openai/resources/beta/responses.rb +1 -1
  13. data/lib/openai/resources/content_provenance_checks.rb +46 -0
  14. data/lib/openai/resources/responses.rb +1 -1
  15. data/lib/openai/version.rb +1 -1
  16. data/lib/openai.rb +3 -0
  17. data/rbi/openai/client.rbi +3 -0
  18. data/rbi/openai/models/beta/response_compact_params.rbi +50 -3
  19. data/rbi/openai/models/content_provenance_check.rbi +413 -0
  20. data/rbi/openai/models/content_provenance_check_create_params.rbi +46 -0
  21. data/rbi/openai/models/responses/response_compact_params.rbi +50 -3
  22. data/rbi/openai/models.rbi +5 -0
  23. data/rbi/openai/resources/beta/responses.rbi +15 -1
  24. data/rbi/openai/resources/content_provenance_checks.rbi +34 -0
  25. data/rbi/openai/resources/responses.rbi +15 -1
  26. data/sig/openai/client.rbs +2 -0
  27. data/sig/openai/models/beta/response_compact_params.rbs +2 -1
  28. data/sig/openai/models/content_provenance_check.rbs +159 -0
  29. data/sig/openai/models/content_provenance_check_create_params.rbs +24 -0
  30. data/sig/openai/models/responses/response_compact_params.rbs +2 -1
  31. data/sig/openai/models.rbs +4 -0
  32. data/sig/openai/resources/content_provenance_checks.rbs +12 -0
  33. metadata +15 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e15647c84c14cc64a8534b798c574db9f0136f734337db3d08a5f682b665eef
4
- data.tar.gz: 98d82a2c561be991ce27e4d70917ab87ecbdecc253c4847457dbe58950f08954
3
+ metadata.gz: cab767061478241e5accb3482ec747785aff81c5b375a726d9e90d7d28401e88
4
+ data.tar.gz: 8d127b01f66be6a38f85530c93d7c33f8abf4f3b61d5750080f7f1308dbfa46b
5
5
  SHA512:
6
- metadata.gz: 78bab0c2d6d33997ba5b81a2805a71bc00cd0fb8e116e057aa55bf4beed5e3992df65cfa41968ae985109295e74511b60eb0c935d52f8e75f4c1eac5454b637a
7
- data.tar.gz: 4175e30bb0c664a56e0229ea30d57eac555103463ba496d123c6b439c1a812da5c234de046dca7a9e78ba090a659b71a9191db2c16e21e1829f3d82bd67343c9
6
+ metadata.gz: e0a6982a093b6263fd2484b2ee50c9b3d712a0548015cda1b6401157fddef8ae802a9fc6a4b2fbfdea8e2e37ad6f8173500f9b97884008690fc2a8ced51cddbd
7
+ data.tar.gz: 9688ca923096844c3c6cd4205d448f7c06474214562cf28af350471e1ed8a726694960dd8733de94a9249bd86d0da4b06c3f52cdbe3ac5fcc1bdae6dd77890c2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.76.0 (2026-07-31)
4
+
5
+ Full Changelog: [v0.75.0...v0.76.0](https://github.com/openai/openai-ruby/compare/v0.75.0...v0.76.0)
6
+
7
+ ### Features
8
+
9
+ * require Ruby 3.3 or newer ([#322](https://github.com/openai/openai-ruby/issues/322)) ([f40aef1](https://github.com/openai/openai-ruby/commit/f40aef1892a4ebafaf4c254522dbf12f3c04ba78))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * preserve generic Linux ffi lock entry ([#323](https://github.com/openai/openai-ruby/issues/323)) ([491eacb](https://github.com/openai/openai-ruby/commit/491eacbe59aa77586731a7929f487a4dcd6f7113))
15
+
16
+ ## 0.75.0 (2026-07-31)
17
+
18
+ Full Changelog: [v0.74.0...v0.75.0](https://github.com/openai/openai-ruby/compare/v0.74.0...v0.75.0)
19
+
20
+ ### Features
21
+
22
+ * **api:** content provenance checks ([62229f3](https://github.com/openai/openai-ruby/commit/62229f3057975721ebe6d904c05da905b57e7255))
23
+
3
24
  ## 0.74.0 (2026-07-30)
4
25
 
5
26
  Full Changelog: [v0.73.0...v0.74.0](https://github.com/openai/openai-ruby/compare/v0.73.0...v0.74.0)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OpenAI Ruby API library
2
2
 
3
- The OpenAI Ruby library provides convenient access to the OpenAI REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/openai/openai-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
3
+ The OpenAI Ruby library provides convenient access to the OpenAI REST API from any Ruby 3.3.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/openai/openai-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.
4
4
 
5
5
  ## Documentation
6
6
 
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "openai", "~> 0.74.0"
18
+ gem "openai", "~> 0.76.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -80,7 +80,7 @@ end
80
80
 
81
81
  ### File uploads
82
82
 
83
- Request parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, [`StringIO`](https://rubyapi.org/3.2/o/stringio), or more.
83
+ Request parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.3/o/pathname) instance, [`StringIO`](https://rubyapi.org/3.3/o/stringio), or more.
84
84
 
85
85
  ```ruby
86
86
  require "pathname"
@@ -633,13 +633,14 @@ openai.chat.completions.create(
633
633
 
634
634
  ## Versioning
635
635
 
636
- This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.
637
-
638
- This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.
636
+ This package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See the [versioning policy](VERSIONING.md) for how releases, breaking changes, Ruby support, dependencies, and type definitions are managed.
639
637
 
640
638
  ## Requirements
641
639
 
642
- Ruby 3.2.0 or higher.
640
+ Ruby 3.3.0 or higher.
641
+
642
+ Ruby 3.2 users can continue using v0.75.x, the final compatible release line.
643
+ This line will not receive separate maintenance.
643
644
 
644
645
  ## Contributing
645
646
 
data/VERSIONING.md ADDED
@@ -0,0 +1,77 @@
1
+ # Versioning policy
2
+
3
+ The OpenAI Ruby SDK follows [Semantic Versioning](https://semver.org/). This
4
+ policy covers the public gem API, supported Ruby runtimes, dependencies, and
5
+ type definitions.
6
+
7
+ ## Gem releases
8
+
9
+ | Change | While the gem is `0.x` | After `1.0` |
10
+ | --- | --- | --- |
11
+ | Backwards-compatible bug or security fix | Patch | Patch |
12
+ | Additive endpoint, optional argument, response field, or public type | Minor | Minor |
13
+ | Higher minimum Ruby version | Minor | Major by default |
14
+ | Other user-visible breaking change | Minor, with migration guidance | Major |
15
+
16
+ Breaking changes include removing or renaming public behavior and incompatible
17
+ changes to required arguments, return types, exception families,
18
+ serialization, retries, or authentication. A dependency upgrade follows the
19
+ same rule: its version number does not determine the SDK release; its effect on
20
+ SDK users does.
21
+
22
+ Corrections to non-runtime RBI or RBS definitions are normally patches. Use a
23
+ minor release when a type-only change is likely to create substantial new type
24
+ errors for users.
25
+
26
+ Security may require an accelerated breaking release, but an incompatible
27
+ change is never shipped as a routine patch.
28
+
29
+ ## Ruby support
30
+
31
+ The SDK supports released CRuby versions that are in Ruby Core's normal or
32
+ security maintenance phases. An EOL Ruby may receive up to six months of grace
33
+ only through an explicit SDK and Security exception. See [Ruby maintenance
34
+ branches](https://www.ruby-lang.org/en/downloads/branches/) for the upstream
35
+ lifecycle.
36
+
37
+ The current supported versions are Ruby 3.3, 3.4, and 4.0. The authoritative
38
+ minimum is `required_ruby_version` in `openai.gemspec`.
39
+
40
+ When the minimum Ruby version changes:
41
+
42
+ 1. Ship the change in the release category defined above, never in a patch.
43
+ 2. Name the final compatible gem release line in the README and release notes.
44
+ 3. Keep old releases available, without promising fixes or backports.
45
+ 4. Test every supported Ruby minor and verify the built gem rejects the old
46
+ runtime while installing on the new minimum.
47
+
48
+ CRuby is the supported implementation and its CI jobs are blocking. JRuby and
49
+ TruffleRuby are best effort until each has an explicitly owned compatibility
50
+ matrix and support decision.
51
+
52
+ ## Dependencies
53
+
54
+ - Keep the runtime dependency graph small and framework-neutral.
55
+ - Declare standard-library components that are distributed as independent gems.
56
+ - Prefer minimum or open-ended requirements. Add upper bounds only for known
57
+ incompatibilities.
58
+ - Test the minimum and latest resolvable dependency sets when practical.
59
+ - Keep framework and transport integrations optional or in separate gems when
60
+ adding them to the core gem would expand its compatibility surface.
61
+
62
+ ## Maintaining the policy
63
+
64
+ The Ruby version settings serve different purposes:
65
+
66
+ - `openai.gemspec` declares the customer support floor.
67
+ - `.rubocop.yml` targets the syntax of the oldest supported Ruby minor.
68
+ - The CI matrix tests every supported Ruby minor.
69
+ - `.ruby-version` pins the latest patch of the newest supported Ruby for local
70
+ development; it is not the customer support floor.
71
+ - Routine lint, package, and release jobs use the newest supported Ruby minor.
72
+
73
+ After each annual Ruby release, add the new minor to CI and move routine
74
+ development jobs to it once the suite is green. Around each March/April Ruby
75
+ EOL window, explicitly decide whether to raise the customer floor. A floor
76
+ increase must update the gemspec, README, RuboCop target, CI matrix, and release
77
+ notes together; automation must not make that decision by itself.
data/lib/openai/client.rb CHANGED
@@ -58,6 +58,9 @@ module OpenAI
58
58
  # @return [OpenAI::Resources::Images]
59
59
  attr_reader :images
60
60
 
61
+ # @return [OpenAI::Resources::ContentProvenanceChecks]
62
+ attr_reader :content_provenance_checks
63
+
61
64
  # @return [OpenAI::Resources::Audio]
62
65
  attr_reader :audio
63
66
 
@@ -349,6 +352,7 @@ module OpenAI
349
352
  @embeddings = OpenAI::Resources::Embeddings.new(client: self)
350
353
  @files = OpenAI::Resources::Files.new(client: self)
351
354
  @images = OpenAI::Resources::Images.new(client: self)
355
+ @content_provenance_checks = OpenAI::Resources::ContentProvenanceChecks.new(client: self)
352
356
  @audio = OpenAI::Resources::Audio.new(client: self)
353
357
  @moderations = OpenAI::Resources::Moderations.new(client: self)
354
358
  @models = OpenAI::Resources::Models.new(client: self)
@@ -9,7 +9,7 @@ module OpenAI
9
9
  #
10
10
  # This module provides a base implementation for streaming responses in the SDK.
11
11
  #
12
- # @see https://rubyapi.org/3.2/o/enumerable
12
+ # @see https://rubyapi.org/3.3/o/enumerable
13
13
  module BaseStream
14
14
  include Enumerable
15
15
 
@@ -77,7 +77,21 @@ module OpenAI
77
77
  nil?: true
78
78
 
79
79
  # @!attribute service_tier
80
- # The service tier to use for this request.
80
+ # Specifies the processing type used for serving the request. - If set to 'auto',
81
+ # then the request will be processed with the service tier configured in the
82
+ # Project settings. Unless otherwise configured, the Project will use 'default'. -
83
+ # If set to 'default', then the request will be processed with the standard
84
+ # pricing and performance for the selected model. - If set to
85
+ # '[flex](https://platform.openai.com/docs/guides/flex-processing)', then the
86
+ # request will be processed with the Flex Processing service tier. - To opt-in to
87
+ # [Fast mode](/api/docs/guides/fast-mode) at the request level, include the
88
+ # `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat
89
+ # Completions. The response will show `service_tier=priority` regardless of if you
90
+ # specify `service_tier=fast` or `priority` in your request. - When not set, the
91
+ # default behavior is 'auto'. When the `service_tier` parameter is set, the
92
+ # response body will include the `service_tier` value based on the processing mode
93
+ # actually used to serve the request. This response value may be different from
94
+ # the value set in the parameter.
81
95
  #
82
96
  # @return [Symbol, OpenAI::Models::Beta::ResponseCompactParams::ServiceTier, nil]
83
97
  optional :service_tier, enum: -> { OpenAI::Beta::ResponseCompactParams::ServiceTier }, nil?: true
@@ -105,7 +119,7 @@ module OpenAI
105
119
  #
106
120
  # @param prompt_cache_retention [Symbol, OpenAI::Models::Beta::ResponseCompactParams::PromptCacheRetention, nil] How long to retain a prompt cache entry created by this request.
107
121
  #
108
- # @param service_tier [Symbol, OpenAI::Models::Beta::ResponseCompactParams::ServiceTier, nil] The service tier to use for this request.
122
+ # @param service_tier [Symbol, OpenAI::Models::Beta::ResponseCompactParams::ServiceTier, nil] Specifies the processing type used for serving the request. - If set to 'auto'
109
123
  #
110
124
  # @param betas [Array<Symbol, OpenAI::Models::Beta::ResponseCompactParams::Beta>]
111
125
  #
@@ -522,12 +536,27 @@ module OpenAI
522
536
  # @return [Array<Symbol>]
523
537
  end
524
538
 
525
- # The service tier to use for this request.
539
+ # Specifies the processing type used for serving the request. - If set to 'auto',
540
+ # then the request will be processed with the service tier configured in the
541
+ # Project settings. Unless otherwise configured, the Project will use 'default'. -
542
+ # If set to 'default', then the request will be processed with the standard
543
+ # pricing and performance for the selected model. - If set to
544
+ # '[flex](https://platform.openai.com/docs/guides/flex-processing)', then the
545
+ # request will be processed with the Flex Processing service tier. - To opt-in to
546
+ # [Fast mode](/api/docs/guides/fast-mode) at the request level, include the
547
+ # `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat
548
+ # Completions. The response will show `service_tier=priority` regardless of if you
549
+ # specify `service_tier=fast` or `priority` in your request. - When not set, the
550
+ # default behavior is 'auto'. When the `service_tier` parameter is set, the
551
+ # response body will include the `service_tier` value based on the processing mode
552
+ # actually used to serve the request. This response value may be different from
553
+ # the value set in the parameter.
526
554
  module ServiceTier
527
555
  extend OpenAI::Internal::Type::Enum
528
556
 
529
557
  AUTO = :auto
530
558
  DEFAULT = :default
559
+ FAST = :fast
531
560
  FLEX = :flex
532
561
  PRIORITY = :priority
533
562
 
@@ -0,0 +1,221 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::ContentProvenanceChecks#create
6
+ class ContentProvenanceCheck < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute created_at
8
+ # The Unix timestamp, in seconds, when the provenance check was created.
9
+ #
10
+ # @return [Integer]
11
+ required :created_at, Integer
12
+
13
+ # @!attribute object
14
+ # The object type. Always `content_provenance_check` for this endpoint.
15
+ #
16
+ # @return [Symbol, OpenAI::Models::ContentProvenanceCheck::Object]
17
+ required :object, enum: -> { OpenAI::ContentProvenanceCheck::Object }
18
+
19
+ # @!attribute results
20
+ # The provenance results that apply to the uploaded file. Image results include
21
+ # C2PA and SynthID; audio results include SynthID.
22
+ #
23
+ # @return [Array<OpenAI::Models::ContentProvenanceCheck::Result::C2PA, OpenAI::Models::ContentProvenanceCheck::Result::SynthID>]
24
+ required :results, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::ContentProvenanceCheck::Result] }
25
+
26
+ # @!method initialize(created_at:, object:, results:)
27
+ # Some parameter documentations has been truncated, see
28
+ # {OpenAI::Models::ContentProvenanceCheck} for more details.
29
+ #
30
+ # @param created_at [Integer] The Unix timestamp, in seconds, when the provenance check was created.
31
+ #
32
+ # @param object [Symbol, OpenAI::Models::ContentProvenanceCheck::Object] The object type. Always `content_provenance_check` for this endpoint.
33
+ #
34
+ # @param results [Array<OpenAI::Models::ContentProvenanceCheck::Result::C2PA, OpenAI::Models::ContentProvenanceCheck::Result::SynthID>] The provenance results that apply to the uploaded file. Image results include C2
35
+
36
+ # The object type. Always `content_provenance_check` for this endpoint.
37
+ #
38
+ # @see OpenAI::Models::ContentProvenanceCheck#object
39
+ module Object
40
+ extend OpenAI::Internal::Type::Enum
41
+
42
+ CONTENT_PROVENANCE_CHECK = :content_provenance_check
43
+
44
+ # @!method self.values
45
+ # @return [Array<Symbol>]
46
+ end
47
+
48
+ module Result
49
+ extend OpenAI::Internal::Type::Union
50
+
51
+ discriminator :type
52
+
53
+ variant :c2pa, -> { OpenAI::ContentProvenanceCheck::Result::C2PA }
54
+
55
+ variant :synthid, -> { OpenAI::ContentProvenanceCheck::Result::SynthID }
56
+
57
+ class C2PA < OpenAI::Internal::Type::BaseModel
58
+ # @!attribute generated_at
59
+ # The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
60
+ # was generated, when available.
61
+ #
62
+ # @return [String, nil]
63
+ required :generated_at, String, nil?: true
64
+
65
+ # @!attribute issuer
66
+ # The C2PA manifest issuer, when available.
67
+ #
68
+ # @return [String, nil]
69
+ required :issuer, String, nil?: true
70
+
71
+ # @!attribute model
72
+ # The OpenAI model recorded by the provenance signal, when available.
73
+ #
74
+ # @return [String, nil]
75
+ required :model, String, nil?: true
76
+
77
+ # @!attribute outcome
78
+ # Whether a supported OpenAI C2PA provenance signal was detected. If
79
+ # `not_detected`, it means the tool did not find supported signals in the uploaded
80
+ # file. The content could still have been generated by OpenAI if the metadata was
81
+ # stripped or has evidence of tampering, the watermark was degraded, it comes from
82
+ # a legacy generation model, or it was created before provenance signals were
83
+ # available. Content could also still be AI-generated by another company's model,
84
+ # which the tool currently does not detect.
85
+ #
86
+ # @return [Symbol, OpenAI::Models::ContentProvenanceCheck::Result::C2PA::Outcome]
87
+ required :outcome, enum: -> { OpenAI::ContentProvenanceCheck::Result::C2PA::Outcome }
88
+
89
+ # @!attribute type
90
+ # The provenance signal type. Always `c2pa`.
91
+ #
92
+ # @return [Symbol, :c2pa]
93
+ required :type, const: :c2pa
94
+
95
+ # @!attribute validation_state
96
+ # The validation status of the C2PA manifest in the uploaded image.
97
+ #
98
+ # @return [Symbol, OpenAI::Models::ContentProvenanceCheck::Result::C2PA::ValidationState]
99
+ required :validation_state, enum: -> { OpenAI::ContentProvenanceCheck::Result::C2PA::ValidationState }
100
+
101
+ # @!method initialize(generated_at:, issuer:, model:, outcome:, validation_state:, type: :c2pa)
102
+ # Some parameter documentations has been truncated, see
103
+ # {OpenAI::Models::ContentProvenanceCheck::Result::C2PA} for more details.
104
+ #
105
+ # @param generated_at [String, nil] The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
106
+ #
107
+ # @param issuer [String, nil] The C2PA manifest issuer, when available.
108
+ #
109
+ # @param model [String, nil] The OpenAI model recorded by the provenance signal, when available.
110
+ #
111
+ # @param outcome [Symbol, OpenAI::Models::ContentProvenanceCheck::Result::C2PA::Outcome] Whether a supported OpenAI C2PA provenance signal was detected.
112
+ #
113
+ # @param validation_state [Symbol, OpenAI::Models::ContentProvenanceCheck::Result::C2PA::ValidationState] The validation status of the C2PA manifest in the uploaded image.
114
+ #
115
+ # @param type [Symbol, :c2pa] The provenance signal type. Always `c2pa`.
116
+
117
+ # Whether a supported OpenAI C2PA provenance signal was detected. If
118
+ # `not_detected`, it means the tool did not find supported signals in the uploaded
119
+ # file. The content could still have been generated by OpenAI if the metadata was
120
+ # stripped or has evidence of tampering, the watermark was degraded, it comes from
121
+ # a legacy generation model, or it was created before provenance signals were
122
+ # available. Content could also still be AI-generated by another company's model,
123
+ # which the tool currently does not detect.
124
+ #
125
+ # @see OpenAI::Models::ContentProvenanceCheck::Result::C2PA#outcome
126
+ module Outcome
127
+ extend OpenAI::Internal::Type::Enum
128
+
129
+ DETECTED = :detected
130
+ NOT_DETECTED = :not_detected
131
+
132
+ # @!method self.values
133
+ # @return [Array<Symbol>]
134
+ end
135
+
136
+ # The validation status of the C2PA manifest in the uploaded image.
137
+ #
138
+ # @see OpenAI::Models::ContentProvenanceCheck::Result::C2PA#validation_state
139
+ module ValidationState
140
+ extend OpenAI::Internal::Type::Enum
141
+
142
+ TRUSTED = :trusted
143
+ VALID = :valid
144
+ INVALID = :invalid
145
+ NOT_PRESENT = :not_present
146
+
147
+ # @!method self.values
148
+ # @return [Array<Symbol>]
149
+ end
150
+ end
151
+
152
+ class SynthID < OpenAI::Internal::Type::BaseModel
153
+ # @!attribute generated_at
154
+ # The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
155
+ # was generated, when available.
156
+ #
157
+ # @return [String, nil]
158
+ required :generated_at, String, nil?: true
159
+
160
+ # @!attribute model
161
+ # The OpenAI model recorded by the provenance signal, when available.
162
+ #
163
+ # @return [String, nil]
164
+ required :model, String, nil?: true
165
+
166
+ # @!attribute outcome
167
+ # Whether a supported OpenAI SynthID watermark was detected. If `not_detected`, it
168
+ # means the tool did not find supported signals in the uploaded file. The content
169
+ # could still have been generated by OpenAI if the metadata was stripped or has
170
+ # evidence of tampering, the watermark was degraded, it comes from a legacy
171
+ # generation model, or it was created before provenance signals were available.
172
+ # Content could also still be AI-generated by another company's model, which the
173
+ # tool currently does not detect.
174
+ #
175
+ # @return [Symbol, OpenAI::Models::ContentProvenanceCheck::Result::SynthID::Outcome]
176
+ required :outcome, enum: -> { OpenAI::ContentProvenanceCheck::Result::SynthID::Outcome }
177
+
178
+ # @!attribute type
179
+ # The provenance signal type. Always `synthid`.
180
+ #
181
+ # @return [Symbol, :synthid]
182
+ required :type, const: :synthid
183
+
184
+ # @!method initialize(generated_at:, model:, outcome:, type: :synthid)
185
+ # Some parameter documentations has been truncated, see
186
+ # {OpenAI::Models::ContentProvenanceCheck::Result::SynthID} for more details.
187
+ #
188
+ # @param generated_at [String, nil] The UTC RFC 3339 timestamp recorded by the provenance signal for when the asset
189
+ #
190
+ # @param model [String, nil] The OpenAI model recorded by the provenance signal, when available.
191
+ #
192
+ # @param outcome [Symbol, OpenAI::Models::ContentProvenanceCheck::Result::SynthID::Outcome] Whether a supported OpenAI SynthID watermark was detected.
193
+ #
194
+ # @param type [Symbol, :synthid] The provenance signal type. Always `synthid`.
195
+
196
+ # Whether a supported OpenAI SynthID watermark was detected. If `not_detected`, it
197
+ # means the tool did not find supported signals in the uploaded file. The content
198
+ # could still have been generated by OpenAI if the metadata was stripped or has
199
+ # evidence of tampering, the watermark was degraded, it comes from a legacy
200
+ # generation model, or it was created before provenance signals were available.
201
+ # Content could also still be AI-generated by another company's model, which the
202
+ # tool currently does not detect.
203
+ #
204
+ # @see OpenAI::Models::ContentProvenanceCheck::Result::SynthID#outcome
205
+ module Outcome
206
+ extend OpenAI::Internal::Type::Enum
207
+
208
+ DETECTED = :detected
209
+ NOT_DETECTED = :not_detected
210
+
211
+ # @!method self.values
212
+ # @return [Array<Symbol>]
213
+ end
214
+ end
215
+
216
+ # @!method self.variants
217
+ # @return [Array(OpenAI::Models::ContentProvenanceCheck::Result::C2PA, OpenAI::Models::ContentProvenanceCheck::Result::SynthID)]
218
+ end
219
+ end
220
+ end
221
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::ContentProvenanceChecks#create
6
+ class ContentProvenanceCheckCreateParams < OpenAI::Internal::Type::BaseModel
7
+ extend OpenAI::Internal::Type::RequestParameters::Converter
8
+ include OpenAI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute file
11
+ # The image or audio file to check for supported OpenAI provenance signals.
12
+ #
13
+ # @return [Pathname, StringIO, IO, String, OpenAI::FilePart]
14
+ required :file, OpenAI::Internal::Type::FileInput
15
+
16
+ # @!method initialize(file:, request_options: {})
17
+ # @param file [Pathname, StringIO, IO, String, OpenAI::FilePart] The image or audio file to check for supported OpenAI provenance signals.
18
+ #
19
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end
@@ -75,7 +75,21 @@ module OpenAI
75
75
  nil?: true
76
76
 
77
77
  # @!attribute service_tier
78
- # The service tier to use for this request.
78
+ # Specifies the processing type used for serving the request. - If set to 'auto',
79
+ # then the request will be processed with the service tier configured in the
80
+ # Project settings. Unless otherwise configured, the Project will use 'default'. -
81
+ # If set to 'default', then the request will be processed with the standard
82
+ # pricing and performance for the selected model. - If set to
83
+ # '[flex](https://platform.openai.com/docs/guides/flex-processing)', then the
84
+ # request will be processed with the Flex Processing service tier. - To opt-in to
85
+ # [Fast mode](/api/docs/guides/fast-mode) at the request level, include the
86
+ # `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat
87
+ # Completions. The response will show `service_tier=priority` regardless of if you
88
+ # specify `service_tier=fast` or `priority` in your request. - When not set, the
89
+ # default behavior is 'auto'. When the `service_tier` parameter is set, the
90
+ # response body will include the `service_tier` value based on the processing mode
91
+ # actually used to serve the request. This response value may be different from
92
+ # the value set in the parameter.
79
93
  #
80
94
  # @return [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil]
81
95
  optional :service_tier, enum: -> { OpenAI::Responses::ResponseCompactParams::ServiceTier }, nil?: true
@@ -98,7 +112,7 @@ module OpenAI
98
112
  #
99
113
  # @param prompt_cache_retention [Symbol, OpenAI::Models::Responses::ResponseCompactParams::PromptCacheRetention, nil] How long to retain a prompt cache entry created by this request.
100
114
  #
101
- # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil] The service tier to use for this request.
115
+ # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil] Specifies the processing type used for serving the request. - If set to 'auto'
102
116
  #
103
117
  # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
104
118
 
@@ -513,12 +527,27 @@ module OpenAI
513
527
  # @return [Array<Symbol>]
514
528
  end
515
529
 
516
- # The service tier to use for this request.
530
+ # Specifies the processing type used for serving the request. - If set to 'auto',
531
+ # then the request will be processed with the service tier configured in the
532
+ # Project settings. Unless otherwise configured, the Project will use 'default'. -
533
+ # If set to 'default', then the request will be processed with the standard
534
+ # pricing and performance for the selected model. - If set to
535
+ # '[flex](https://platform.openai.com/docs/guides/flex-processing)', then the
536
+ # request will be processed with the Flex Processing service tier. - To opt-in to
537
+ # [Fast mode](/api/docs/guides/fast-mode) at the request level, include the
538
+ # `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat
539
+ # Completions. The response will show `service_tier=priority` regardless of if you
540
+ # specify `service_tier=fast` or `priority` in your request. - When not set, the
541
+ # default behavior is 'auto'. When the `service_tier` parameter is set, the
542
+ # response body will include the `service_tier` value based on the processing mode
543
+ # actually used to serve the request. This response value may be different from
544
+ # the value set in the parameter.
517
545
  module ServiceTier
518
546
  extend OpenAI::Internal::Type::Enum
519
547
 
520
548
  AUTO = :auto
521
549
  DEFAULT = :default
550
+ FAST = :fast
522
551
  FLEX = :flex
523
552
  PRIORITY = :priority
524
553
 
data/lib/openai/models.rb CHANGED
@@ -95,6 +95,10 @@ module OpenAI
95
95
 
96
96
  Containers = OpenAI::Models::Containers
97
97
 
98
+ ContentProvenanceCheck = OpenAI::Models::ContentProvenanceCheck
99
+
100
+ ContentProvenanceCheckCreateParams = OpenAI::Models::ContentProvenanceCheckCreateParams
101
+
98
102
  Conversations = OpenAI::Models::Conversations
99
103
 
100
104
  CreateEmbeddingResponse = OpenAI::Models::CreateEmbeddingResponse
@@ -403,7 +403,7 @@ module OpenAI
403
403
  #
404
404
  # @param prompt_cache_retention [Symbol, OpenAI::Models::Beta::ResponseCompactParams::PromptCacheRetention, nil] Body param: How long to retain a prompt cache entry created by this request.
405
405
  #
406
- # @param service_tier [Symbol, OpenAI::Models::Beta::ResponseCompactParams::ServiceTier, nil] Body param: The service tier to use for this request.
406
+ # @param service_tier [Symbol, OpenAI::Models::Beta::ResponseCompactParams::ServiceTier, nil] Body param: Specifies the processing type used for serving the request. - If s
407
407
  #
408
408
  # @param betas [Array<Symbol, OpenAI::Models::Beta::ResponseCompactParams::Beta>] Header param: Optional beta features to enable for this request.
409
409
  #
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Resources
5
+ class ContentProvenanceChecks
6
+ # Check whether an image or audio file contains known OpenAI provenance signals.
7
+ # [Learn more about content provenance](/api/docs/guides/content-provenance).
8
+ #
9
+ # If `not_detected`, it means the tool did not find supported signals in the
10
+ # uploaded file. The content could still have been generated by OpenAI if the
11
+ # metadata was stripped or has evidence of tampering, the watermark was degraded,
12
+ # it comes from a legacy generation model, or it was created before provenance
13
+ # signals were available. Content could also still be AI-generated by another
14
+ # company's model, which the tool currently does not detect.
15
+ #
16
+ # @overload create(file:, request_options: {})
17
+ #
18
+ # @param file [Pathname, StringIO, IO, String, OpenAI::FilePart] The image or audio file to check for supported OpenAI provenance signals.
19
+ #
20
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
21
+ #
22
+ # @return [OpenAI::Models::ContentProvenanceCheck]
23
+ #
24
+ # @see OpenAI::Models::ContentProvenanceCheckCreateParams
25
+ def create(params)
26
+ parsed, options = OpenAI::ContentProvenanceCheckCreateParams.dump_request(params)
27
+ @client.request(
28
+ method: :post,
29
+ path: "content_provenance_checks",
30
+ headers: {"content-type" => "multipart/form-data"},
31
+ body: parsed,
32
+ model: OpenAI::ContentProvenanceCheck,
33
+ security: {bearer_auth: true},
34
+ options: options
35
+ )
36
+ end
37
+
38
+ # @api private
39
+ #
40
+ # @param client [OpenAI::Client]
41
+ def initialize(client:)
42
+ @client = client
43
+ end
44
+ end
45
+ end
46
+ end
@@ -511,7 +511,7 @@ module OpenAI
511
511
  #
512
512
  # @param prompt_cache_retention [Symbol, OpenAI::Models::Responses::ResponseCompactParams::PromptCacheRetention, nil] How long to retain a prompt cache entry created by this request.
513
513
  #
514
- # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil] The service tier to use for this request.
514
+ # @param service_tier [Symbol, OpenAI::Models::Responses::ResponseCompactParams::ServiceTier, nil] Specifies the processing type used for serving the request. - If set to 'auto'
515
515
  #
516
516
  # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
517
517
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.74.0"
4
+ VERSION = "0.76.0"
5
5
  end