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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/openai-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/openai-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
name: lint
permissions:
contents: read
runs-on: ${{ github.repository == 'stainless-sdks/openai-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
Expand All @@ -83,7 +83,7 @@ jobs:
name: test (ruby ${{ matrix.ruby-version }})
permissions:
contents: read
runs-on: ${{ github.repository == 'stainless-sdks/openai-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the aggregate test job on the Depot runner

For stainless-sdks/<repo> other than stainless-sdks/openai-ruby, this line moves the matrix tests to depot-ubuntu-24.04, but the downstream aggregate test job still uses the old exact-repo runs-on check and therefore schedules on ubuntu-latest. That leaves the final test status on a different runner in the private-production repo case this change is adding, and can queue or fail even after the matrix succeeds when those repos are configured to use Depot runners; update the aggregate job's runner expression as well.

Useful? React with 👍 / 👎.

if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.71.0"
".": "0.72.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 271
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-8ed7dcb0d163e7f5205dbe172d6ad5b7ce367b23c20629830e39a0aee920a029.yml
openapi_spec_hash: 011cdae0c67909fb80a4a5eb54ca5bca
config_hash: 896f0f71bc7d1ee09435813cdef97523
configured_endpoints: 277
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-0650ebae454b4200491980d7663cb7ceabcff90dcb3ed9f67c3bca3e861a2bf6.yml
openapi_spec_hash: e9576bced964246b7e685a5ad30afffa
config_hash: 43e311595bcc4fb6b32eba0684de48d8
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.72.0 (2026-07-23)

Full Changelog: [v0.71.0...v0.72.0](https://github.com/openai/openai-ruby/compare/v0.71.0...v0.72.0)

### Features

* **api:** accept `None` for prompt_cache_key/safety_identifier ([dcff6be](https://github.com/openai/openai-ruby/commit/dcff6bee4daca61b24dd03096f4772c3d276c93d))
* **api:** add support for `spend_limit` admin apis ([06dff48](https://github.com/openai/openai-ruby/commit/06dff483232e08e59be550cf4432d319a36ede11))
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([da769b4](https://github.com/openai/openai-ruby/commit/da769b419c0d1d51af2ad471ac63fdf18705be5b))

## 0.71.0 (2026-07-17)

Full Changelog: [v0.70.0...v0.71.0](https://github.com/openai/openai-ruby/compare/v0.70.0...v0.71.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
openai (0.71.0)
openai (0.72.0)
base64
cgi
connection_pool
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "openai", "~> 0.71.0"
gem "openai", "~> 0.72.0"
```

<!-- x-release-please-end -->
Expand Down
12 changes: 12 additions & 0 deletions lib/openai.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@
require_relative "openai/models/admin/organization/organization_data_retention"
require_relative "openai/models/admin/organization/organization_spend_alert"
require_relative "openai/models/admin/organization/organization_spend_alert_deleted"
require_relative "openai/models/admin/organization/organization_spend_limit"
require_relative "openai/models/admin/organization/organization_spend_limit_deleted"
require_relative "openai/models/admin/organization/organization_user"
require_relative "openai/models/admin/organization/project"
require_relative "openai/models/admin/organization/project_archive_params"
Expand Down Expand Up @@ -193,6 +195,8 @@
require_relative "openai/models/admin/organization/projects/project_service_account"
require_relative "openai/models/admin/organization/projects/project_spend_alert"
require_relative "openai/models/admin/organization/projects/project_spend_alert_deleted"
require_relative "openai/models/admin/organization/projects/project_spend_limit"
require_relative "openai/models/admin/organization/projects/project_spend_limit_deleted"
require_relative "openai/models/admin/organization/projects/project_user"
require_relative "openai/models/admin/organization/projects/rate_limit_list_rate_limits_params"
require_relative "openai/models/admin/organization/projects/rate_limit_update_rate_limit_params"
Expand All @@ -216,6 +220,9 @@
require_relative "openai/models/admin/organization/projects/spend_alert_list_params"
require_relative "openai/models/admin/organization/projects/spend_alert_retrieve_params"
require_relative "openai/models/admin/organization/projects/spend_alert_update_params"
require_relative "openai/models/admin/organization/projects/spend_limit_delete_params"
require_relative "openai/models/admin/organization/projects/spend_limit_retrieve_params"
require_relative "openai/models/admin/organization/projects/spend_limit_update_params"
require_relative "openai/models/admin/organization/projects/user_create_params"
require_relative "openai/models/admin/organization/projects/user_delete_params"
require_relative "openai/models/admin/organization/projects/user_delete_response"
Expand Down Expand Up @@ -243,6 +250,9 @@
require_relative "openai/models/admin/organization/spend_alert_list_params"
require_relative "openai/models/admin/organization/spend_alert_retrieve_params"
require_relative "openai/models/admin/organization/spend_alert_update_params"
require_relative "openai/models/admin/organization/spend_limit_delete_params"
require_relative "openai/models/admin/organization/spend_limit_retrieve_params"
require_relative "openai/models/admin/organization/spend_limit_update_params"
require_relative "openai/models/admin/organization/usage_audio_speeches_params"
require_relative "openai/models/admin/organization/usage_audio_speeches_response"
require_relative "openai/models/admin/organization/usage_audio_transcriptions_params"
Expand Down Expand Up @@ -1169,10 +1179,12 @@
require_relative "openai/resources/admin/organization/projects/service_accounts"
require_relative "openai/resources/admin/organization/projects/service_accounts/api_keys"
require_relative "openai/resources/admin/organization/projects/spend_alerts"
require_relative "openai/resources/admin/organization/projects/spend_limit"
require_relative "openai/resources/admin/organization/projects/users"
require_relative "openai/resources/admin/organization/projects/users/roles"
require_relative "openai/resources/admin/organization/roles"
require_relative "openai/resources/admin/organization/spend_alerts"
require_relative "openai/resources/admin/organization/spend_limit"
require_relative "openai/resources/admin/organization/usage"
require_relative "openai/resources/admin/organization/users"
require_relative "openai/resources/admin/organization/users/roles"
Expand Down
151 changes: 151 additions & 0 deletions lib/openai/models/admin/organization/organization_spend_limit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# frozen_string_literal: true

module OpenAI
module Models
module Admin
module Organization
# @see OpenAI::Resources::Admin::Organization::SpendLimit#retrieve
class OrganizationSpendLimit < OpenAI::Internal::Type::BaseModel
# @!attribute currency
# The currency for the threshold amount. Currently, only `USD` is supported.
#
# @return [String, Symbol, OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Currency]
required :currency, union: -> { OpenAI::Admin::Organization::OrganizationSpendLimit::Currency }

# @!attribute enforcement
# The current enforcement state of the hard spend limit.
#
# @return [OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement]
required :enforcement, -> { OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement }

# @!attribute interval
# The time interval for evaluating spend against the threshold. Currently, only
# `month` is supported.
#
# @return [String, Symbol, OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Interval]
required :interval, union: -> { OpenAI::Admin::Organization::OrganizationSpendLimit::Interval }

# @!attribute object
# The object type, which is always `organization.spend_limit`.
#
# @return [Symbol, :"organization.spend_limit"]
required :object, const: :"organization.spend_limit"

# @!attribute threshold_amount
# The hard spend limit amount, in cents.
#
# @return [Integer]
required :threshold_amount, Integer

# @!method initialize(currency:, enforcement:, interval:, threshold_amount:, object: :"organization.spend_limit")
# Some parameter documentations has been truncated, see
# {OpenAI::Models::Admin::Organization::OrganizationSpendLimit} for more details.
#
# Represents a hard spend limit configured at the organization level.
#
# @param currency [String, Symbol, OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Currency] The currency for the threshold amount. Currently, only `USD` is supported.
#
# @param enforcement [OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement] The current enforcement state of the hard spend limit.
#
# @param interval [String, Symbol, OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Interval] The time interval for evaluating spend against the threshold. Currently, only `m
#
# @param threshold_amount [Integer] The hard spend limit amount, in cents.
#
# @param object [Symbol, :"organization.spend_limit"] The object type, which is always `organization.spend_limit`.

# The currency for the threshold amount. Currently, only `USD` is supported.
#
# @see OpenAI::Models::Admin::Organization::OrganizationSpendLimit#currency
module Currency
extend OpenAI::Internal::Type::Union

variant String

variant const: -> { OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Currency::USD }

# @!method self.variants
# @return [Array(String, Symbol)]

define_sorbet_constant!(:Variants) do
T.type_alias { T.any(String, OpenAI::Admin::Organization::OrganizationSpendLimit::Currency::TaggedSymbol) }
end

# @!group

USD = :USD

# @!endgroup
end

# @see OpenAI::Models::Admin::Organization::OrganizationSpendLimit#enforcement
class Enforcement < OpenAI::Internal::Type::BaseModel
# @!attribute status
# Whether the hard spend limit is currently enforcing.
#
# @return [String, Symbol, OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::Status]
required :status, union: -> { OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status }

# @!method initialize(status:)
# The current enforcement state of the hard spend limit.
#
# @param status [String, Symbol, OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::Status] Whether the hard spend limit is currently enforcing.

# Whether the hard spend limit is currently enforcing.
#
# @see OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement#status
module Status
extend OpenAI::Internal::Type::Union

variant String

variant const: -> { OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::INACTIVE }

variant const: -> { OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::ENFORCING }

# @!method self.variants
# @return [Array(String, Symbol)]

define_sorbet_constant!(:Variants) do
T.type_alias { T.any(String, OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement::Status::TaggedSymbol) }
end

# @!group

INACTIVE = :inactive
ENFORCING = :enforcing

# @!endgroup
end
end

# The time interval for evaluating spend against the threshold. Currently, only
# `month` is supported.
#
# @see OpenAI::Models::Admin::Organization::OrganizationSpendLimit#interval
module Interval
extend OpenAI::Internal::Type::Union

variant String

variant const: -> { OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Interval::MONTH }

# @!method self.variants
# @return [Array(String, Symbol)]

define_sorbet_constant!(:Variants) do
T.type_alias { T.any(String, OpenAI::Admin::Organization::OrganizationSpendLimit::Interval::TaggedSymbol) }
end

# @!group

MONTH = :month

# @!endgroup
end
end
end

OrganizationSpendLimit = Organization::OrganizationSpendLimit
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

module OpenAI
module Models
module Admin
module Organization
# @see OpenAI::Resources::Admin::Organization::SpendLimit#delete
class OrganizationSpendLimitDeleted < OpenAI::Internal::Type::BaseModel
# @!attribute deleted
# Whether the hard spend limit was deleted.
#
# @return [Boolean]
required :deleted, OpenAI::Internal::Type::Boolean

# @!attribute object
# The object type, which is always `organization.spend_limit.deleted`.
#
# @return [Symbol, :"organization.spend_limit.deleted"]
required :object, const: :"organization.spend_limit.deleted"

# @!method initialize(deleted:, object: :"organization.spend_limit.deleted")
# Confirmation payload returned after deleting an organization hard spend limit.
#
# @param deleted [Boolean] Whether the hard spend limit was deleted.
#
# @param object [Symbol, :"organization.spend_limit.deleted"] The object type, which is always `organization.spend_limit.deleted`.
end
end

OrganizationSpendLimitDeleted = Organization::OrganizationSpendLimitDeleted
end
end
end
Loading