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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.47.0"
".": "2.48.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: 272
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-8ed7dcb0d163e7f5205dbe172d6ad5b7ce367b23c20629830e39a0aee920a029.yml
openapi_spec_hash: 011cdae0c67909fb80a4a5eb54ca5bca
config_hash: 896f0f71bc7d1ee09435813cdef97523
configured_endpoints: 278
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-0650ebae454b4200491980d7663cb7ceabcff90dcb3ed9f67c3bca3e861a2bf6.yml
openapi_spec_hash: e9576bced964246b7e685a5ad30afffa
config_hash: 43e311595bcc4fb6b32eba0684de48d8
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.48.0 (2026-07-23)

Full Changelog: [v2.47.0...v2.48.0](https://github.com/openai/openai-python/compare/v2.47.0...v2.48.0)

### Features

* **api:** accept `None` for prompt_cache_key/safety_identifier ([36820e6](https://github.com/openai/openai-python/commit/36820e69ba6cf1dc3f8d411e48a36e56084fbbc4))
* **api:** add support for `spend_limit` admin apis ([1ff13af](https://github.com/openai/openai-python/commit/1ff13afb6e831394036686a1c352bbec6d704c68))

## 2.47.0 (2026-07-21)

Full Changelog: [v2.46.0...v2.47.0](https://github.com/openai/openai-python/compare/v2.46.0...v2.47.0)
Expand Down
28 changes: 28 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,20 @@ Methods:
- <code title="get /organization/data_retention">client.admin.organization.data_retention.<a href="./src/openai/resources/admin/organization/data_retention.py">retrieve</a>() -> <a href="./src/openai/types/admin/organization/organization_data_retention.py">OrganizationDataRetention</a></code>
- <code title="post /organization/data_retention">client.admin.organization.data_retention.<a href="./src/openai/resources/admin/organization/data_retention.py">update</a>(\*\*<a href="src/openai/types/admin/organization/data_retention_update_params.py">params</a>) -> <a href="./src/openai/types/admin/organization/organization_data_retention.py">OrganizationDataRetention</a></code>

### SpendLimit

Types:

```python
from openai.types.admin.organization import OrganizationSpendLimit, OrganizationSpendLimitDeleted
```

Methods:

- <code title="get /organization/spend_limit">client.admin.organization.spend_limit.<a href="./src/openai/resources/admin/organization/spend_limit.py">retrieve</a>() -> <a href="./src/openai/types/admin/organization/organization_spend_limit.py">OrganizationSpendLimit</a></code>
- <code title="post /organization/spend_limit">client.admin.organization.spend_limit.<a href="./src/openai/resources/admin/organization/spend_limit.py">update</a>(\*\*<a href="src/openai/types/admin/organization/spend_limit_update_params.py">params</a>) -> <a href="./src/openai/types/admin/organization/organization_spend_limit.py">OrganizationSpendLimit</a></code>
- <code title="delete /organization/spend_limit">client.admin.organization.spend_limit.<a href="./src/openai/resources/admin/organization/spend_limit.py">delete</a>() -> <a href="./src/openai/types/admin/organization/organization_spend_limit_deleted.py">OrganizationSpendLimitDeleted</a></code>

### SpendAlerts

Types:
Expand Down Expand Up @@ -1347,6 +1361,20 @@ Methods:
- <code title="get /organization/projects/{project_id}/data_retention">client.admin.organization.projects.data_retention.<a href="./src/openai/resources/admin/organization/projects/data_retention.py">retrieve</a>(project_id) -> <a href="./src/openai/types/admin/organization/projects/project_data_retention.py">ProjectDataRetention</a></code>
- <code title="post /organization/projects/{project_id}/data_retention">client.admin.organization.projects.data_retention.<a href="./src/openai/resources/admin/organization/projects/data_retention.py">update</a>(project_id, \*\*<a href="src/openai/types/admin/organization/projects/data_retention_update_params.py">params</a>) -> <a href="./src/openai/types/admin/organization/projects/project_data_retention.py">ProjectDataRetention</a></code>

#### SpendLimit

Types:

```python
from openai.types.admin.organization.projects import ProjectSpendLimit, ProjectSpendLimitDeleted
```

Methods:

- <code title="get /organization/projects/{project_id}/spend_limit">client.admin.organization.projects.spend_limit.<a href="./src/openai/resources/admin/organization/projects/spend_limit.py">retrieve</a>(project_id) -> <a href="./src/openai/types/admin/organization/projects/project_spend_limit.py">ProjectSpendLimit</a></code>
- <code title="post /organization/projects/{project_id}/spend_limit">client.admin.organization.projects.spend_limit.<a href="./src/openai/resources/admin/organization/projects/spend_limit.py">update</a>(project_id, \*\*<a href="src/openai/types/admin/organization/projects/spend_limit_update_params.py">params</a>) -> <a href="./src/openai/types/admin/organization/projects/project_spend_limit.py">ProjectSpendLimit</a></code>
- <code title="delete /organization/projects/{project_id}/spend_limit">client.admin.organization.projects.spend_limit.<a href="./src/openai/resources/admin/organization/projects/spend_limit.py">delete</a>(project_id) -> <a href="./src/openai/types/admin/organization/projects/project_spend_limit_deleted.py">ProjectSpendLimitDeleted</a></code>

#### SpendAlerts

Types:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "2.47.0"
version = "2.48.0"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/openai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openai"
__version__ = "2.47.0" # x-release-please-version
__version__ = "2.48.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/openai/resources/admin/organization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
AuditLogsWithStreamingResponse,
AsyncAuditLogsWithStreamingResponse,
)
from .spend_limit import (
SpendLimit,
AsyncSpendLimit,
SpendLimitWithRawResponse,
AsyncSpendLimitWithRawResponse,
SpendLimitWithStreamingResponse,
AsyncSpendLimitWithStreamingResponse,
)
from .certificates import (
Certificates,
AsyncCertificates,
Expand Down Expand Up @@ -146,6 +154,12 @@
"AsyncDataRetentionWithRawResponse",
"DataRetentionWithStreamingResponse",
"AsyncDataRetentionWithStreamingResponse",
"SpendLimit",
"AsyncSpendLimit",
"SpendLimitWithRawResponse",
"AsyncSpendLimitWithRawResponse",
"SpendLimitWithStreamingResponse",
"AsyncSpendLimitWithStreamingResponse",
"SpendAlerts",
"AsyncSpendAlerts",
"SpendAlertsWithRawResponse",
Expand Down
32 changes: 32 additions & 0 deletions src/openai/resources/admin/organization/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
AuditLogsWithStreamingResponse,
AsyncAuditLogsWithStreamingResponse,
)
from .spend_limit import (
SpendLimit,
AsyncSpendLimit,
SpendLimitWithRawResponse,
AsyncSpendLimitWithRawResponse,
SpendLimitWithStreamingResponse,
AsyncSpendLimitWithStreamingResponse,
)
from .users.users import (
Users,
AsyncUsers,
Expand Down Expand Up @@ -130,6 +138,10 @@ def roles(self) -> Roles:
def data_retention(self) -> DataRetention:
return DataRetention(self._client)

@cached_property
def spend_limit(self) -> SpendLimit:
return SpendLimit(self._client)

@cached_property
def spend_alerts(self) -> SpendAlerts:
return SpendAlerts(self._client)
Expand Down Expand Up @@ -196,6 +208,10 @@ def roles(self) -> AsyncRoles:
def data_retention(self) -> AsyncDataRetention:
return AsyncDataRetention(self._client)

@cached_property
def spend_limit(self) -> AsyncSpendLimit:
return AsyncSpendLimit(self._client)

@cached_property
def spend_alerts(self) -> AsyncSpendAlerts:
return AsyncSpendAlerts(self._client)
Expand Down Expand Up @@ -265,6 +281,10 @@ def roles(self) -> RolesWithRawResponse:
def data_retention(self) -> DataRetentionWithRawResponse:
return DataRetentionWithRawResponse(self._organization.data_retention)

@cached_property
def spend_limit(self) -> SpendLimitWithRawResponse:
return SpendLimitWithRawResponse(self._organization.spend_limit)

@cached_property
def spend_alerts(self) -> SpendAlertsWithRawResponse:
return SpendAlertsWithRawResponse(self._organization.spend_alerts)
Expand Down Expand Up @@ -315,6 +335,10 @@ def roles(self) -> AsyncRolesWithRawResponse:
def data_retention(self) -> AsyncDataRetentionWithRawResponse:
return AsyncDataRetentionWithRawResponse(self._organization.data_retention)

@cached_property
def spend_limit(self) -> AsyncSpendLimitWithRawResponse:
return AsyncSpendLimitWithRawResponse(self._organization.spend_limit)

@cached_property
def spend_alerts(self) -> AsyncSpendAlertsWithRawResponse:
return AsyncSpendAlertsWithRawResponse(self._organization.spend_alerts)
Expand Down Expand Up @@ -365,6 +389,10 @@ def roles(self) -> RolesWithStreamingResponse:
def data_retention(self) -> DataRetentionWithStreamingResponse:
return DataRetentionWithStreamingResponse(self._organization.data_retention)

@cached_property
def spend_limit(self) -> SpendLimitWithStreamingResponse:
return SpendLimitWithStreamingResponse(self._organization.spend_limit)

@cached_property
def spend_alerts(self) -> SpendAlertsWithStreamingResponse:
return SpendAlertsWithStreamingResponse(self._organization.spend_alerts)
Expand Down Expand Up @@ -415,6 +443,10 @@ def roles(self) -> AsyncRolesWithStreamingResponse:
def data_retention(self) -> AsyncDataRetentionWithStreamingResponse:
return AsyncDataRetentionWithStreamingResponse(self._organization.data_retention)

@cached_property
def spend_limit(self) -> AsyncSpendLimitWithStreamingResponse:
return AsyncSpendLimitWithStreamingResponse(self._organization.spend_limit)

@cached_property
def spend_alerts(self) -> AsyncSpendAlertsWithStreamingResponse:
return AsyncSpendAlertsWithStreamingResponse(self._organization.spend_alerts)
Expand Down
14 changes: 14 additions & 0 deletions src/openai/resources/admin/organization/projects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
RateLimitsWithStreamingResponse,
AsyncRateLimitsWithStreamingResponse,
)
from .spend_limit import (
SpendLimit,
AsyncSpendLimit,
SpendLimitWithRawResponse,
AsyncSpendLimitWithRawResponse,
SpendLimitWithStreamingResponse,
AsyncSpendLimitWithStreamingResponse,
)
from .certificates import (
Certificates,
AsyncCertificates,
Expand Down Expand Up @@ -152,6 +160,12 @@
"AsyncDataRetentionWithRawResponse",
"DataRetentionWithStreamingResponse",
"AsyncDataRetentionWithStreamingResponse",
"SpendLimit",
"AsyncSpendLimit",
"SpendLimitWithRawResponse",
"AsyncSpendLimitWithRawResponse",
"SpendLimitWithStreamingResponse",
"AsyncSpendLimitWithStreamingResponse",
"SpendAlerts",
"AsyncSpendAlerts",
"SpendAlertsWithRawResponse",
Expand Down
32 changes: 32 additions & 0 deletions src/openai/resources/admin/organization/projects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
RateLimitsWithStreamingResponse,
AsyncRateLimitsWithStreamingResponse,
)
from .spend_limit import (
SpendLimit,
AsyncSpendLimit,
SpendLimitWithRawResponse,
AsyncSpendLimitWithRawResponse,
SpendLimitWithStreamingResponse,
AsyncSpendLimitWithStreamingResponse,
)
from .users.users import (
Users,
AsyncUsers,
Expand Down Expand Up @@ -145,6 +153,10 @@ def roles(self) -> Roles:
def data_retention(self) -> DataRetention:
return DataRetention(self._client)

@cached_property
def spend_limit(self) -> SpendLimit:
return SpendLimit(self._client)

@cached_property
def spend_alerts(self) -> SpendAlerts:
return SpendAlerts(self._client)
Expand Down Expand Up @@ -454,6 +466,10 @@ def roles(self) -> AsyncRoles:
def data_retention(self) -> AsyncDataRetention:
return AsyncDataRetention(self._client)

@cached_property
def spend_limit(self) -> AsyncSpendLimit:
return AsyncSpendLimit(self._client)

@cached_property
def spend_alerts(self) -> AsyncSpendAlerts:
return AsyncSpendAlerts(self._client)
Expand Down Expand Up @@ -782,6 +798,10 @@ def roles(self) -> RolesWithRawResponse:
def data_retention(self) -> DataRetentionWithRawResponse:
return DataRetentionWithRawResponse(self._projects.data_retention)

@cached_property
def spend_limit(self) -> SpendLimitWithRawResponse:
return SpendLimitWithRawResponse(self._projects.spend_limit)

@cached_property
def spend_alerts(self) -> SpendAlertsWithRawResponse:
return SpendAlertsWithRawResponse(self._projects.spend_alerts)
Expand Down Expand Up @@ -847,6 +867,10 @@ def roles(self) -> AsyncRolesWithRawResponse:
def data_retention(self) -> AsyncDataRetentionWithRawResponse:
return AsyncDataRetentionWithRawResponse(self._projects.data_retention)

@cached_property
def spend_limit(self) -> AsyncSpendLimitWithRawResponse:
return AsyncSpendLimitWithRawResponse(self._projects.spend_limit)

@cached_property
def spend_alerts(self) -> AsyncSpendAlertsWithRawResponse:
return AsyncSpendAlertsWithRawResponse(self._projects.spend_alerts)
Expand Down Expand Up @@ -912,6 +936,10 @@ def roles(self) -> RolesWithStreamingResponse:
def data_retention(self) -> DataRetentionWithStreamingResponse:
return DataRetentionWithStreamingResponse(self._projects.data_retention)

@cached_property
def spend_limit(self) -> SpendLimitWithStreamingResponse:
return SpendLimitWithStreamingResponse(self._projects.spend_limit)

@cached_property
def spend_alerts(self) -> SpendAlertsWithStreamingResponse:
return SpendAlertsWithStreamingResponse(self._projects.spend_alerts)
Expand Down Expand Up @@ -977,6 +1005,10 @@ def roles(self) -> AsyncRolesWithStreamingResponse:
def data_retention(self) -> AsyncDataRetentionWithStreamingResponse:
return AsyncDataRetentionWithStreamingResponse(self._projects.data_retention)

@cached_property
def spend_limit(self) -> AsyncSpendLimitWithStreamingResponse:
return AsyncSpendLimitWithStreamingResponse(self._projects.spend_limit)

@cached_property
def spend_alerts(self) -> AsyncSpendAlertsWithStreamingResponse:
return AsyncSpendAlertsWithStreamingResponse(self._projects.spend_alerts)
Expand Down
Loading
Loading