From 97d036d1a0ac17048bbf574eb41362005a05b407 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jul 2026 18:39:57 +0000 Subject: [PATCH 1/3] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 24895ee467..d9b63f0de9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 271 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-356010b9b9fd6228b457b8fcfa376cf4928a8f3bd4728e7ba5e4b6b5ef4f5843.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-39637fc9365e6f80f12424e7c87179553f157b96b47c599b96d5a02f6966d3da.yml openapi_spec_hash: 885864ae98a443166f585f856c464fb2 -config_hash: 1f1e3b4050e2cb4bc780ce0b70e2b3e6 +config_hash: b40012963b4619be8229fcca0105b627 From f589d04bf9f377ecb1f54335ab3ab9d825b5dfee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 23:58:51 +0000 Subject: [PATCH 2/3] feat(api): add owner_project_access to APIKeyListParams --- .stats.yml | 4 +- .../admin/organization/projects/api_keys.py | 18 ++++++++ src/openai/resources/webhooks/api.md | 1 - .../projects/api_key_list_params.py | 11 ++++- .../organization/projects/project_api_key.py | 3 ++ .../beta/beta_response_reasoning_item.py | 7 +-- .../beta_response_reasoning_item_param.py | 7 +-- .../responses/response_reasoning_item.py | 7 +-- .../response_reasoning_item_param.py | 7 +-- src/openai/types/webhooks/__init__.py | 3 -- ...safety_identifier_blocked_webhook_event.py | 46 ------------------- .../types/webhooks/unwrap_webhook_event.py | 2 - .../organization/projects/test_api_keys.py | 2 + 13 files changed, 51 insertions(+), 67 deletions(-) delete mode 100644 src/openai/types/webhooks/safety_identifier_blocked_webhook_event.py diff --git a/.stats.yml b/.stats.yml index d9b63f0de9..b0a41f8128 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 271 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-39637fc9365e6f80f12424e7c87179553f157b96b47c599b96d5a02f6966d3da.yml -openapi_spec_hash: 885864ae98a443166f585f856c464fb2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-ae4c1a92306e31f05678c3de72efbf1903b5c09924dacd42a555cc5ccc0e5eb1.yml +openapi_spec_hash: 0973932f9a3f0b46a0933b143878f9fe config_hash: b40012963b4619be8229fcca0105b627 diff --git a/src/openai/resources/admin/organization/projects/api_keys.py b/src/openai/resources/admin/organization/projects/api_keys.py index 1517d213e0..407bb6b485 100644 --- a/src/openai/resources/admin/organization/projects/api_keys.py +++ b/src/openai/resources/admin/organization/projects/api_keys.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..... import _legacy_response @@ -89,6 +91,7 @@ def list( *, after: str | Omit = omit, limit: int | Omit = omit, + owner_project_access: Literal["active", "inactive", "any"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -108,6 +111,12 @@ def list( limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + owner_project_access: Filter API keys by whether the owner currently has effective access to the + project. Use `active` for owners with access, `inactive` for owners without + access, or `any` for all enabled project API keys. If omitted, the endpoint + applies its existing membership-based visibility rules, which may exclude some + enabled keys. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -130,6 +139,7 @@ def list( { "after": after, "limit": limit, + "owner_project_access": owner_project_access, }, api_key_list_params.APIKeyListParams, ), @@ -256,6 +266,7 @@ def list( *, after: str | Omit = omit, limit: int | Omit = omit, + owner_project_access: Literal["active", "inactive", "any"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -275,6 +286,12 @@ def list( limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + owner_project_access: Filter API keys by whether the owner currently has effective access to the + project. Use `active` for owners with access, `inactive` for owners without + access, or `any` for all enabled project API keys. If omitted, the endpoint + applies its existing membership-based visibility rules, which may exclude some + enabled keys. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -297,6 +314,7 @@ def list( { "after": after, "limit": limit, + "owner_project_access": owner_project_access, }, api_key_list_params.APIKeyListParams, ), diff --git a/src/openai/resources/webhooks/api.md b/src/openai/resources/webhooks/api.md index 8efcc3e33e..8e3c312eb0 100644 --- a/src/openai/resources/webhooks/api.md +++ b/src/openai/resources/webhooks/api.md @@ -19,7 +19,6 @@ from openai.types.webhooks import ( ResponseCompletedWebhookEvent, ResponseFailedWebhookEvent, ResponseIncompleteWebhookEvent, - SafetyIdentifierBlockedWebhookEvent, UnwrapWebhookEvent, ) ``` diff --git a/src/openai/types/admin/organization/projects/api_key_list_params.py b/src/openai/types/admin/organization/projects/api_key_list_params.py index 422a28518e..b83f655a1b 100644 --- a/src/openai/types/admin/organization/projects/api_key_list_params.py +++ b/src/openai/types/admin/organization/projects/api_key_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict __all__ = ["APIKeyListParams"] @@ -22,3 +22,12 @@ class APIKeyListParams(TypedDict, total=False): Limit can range between 1 and 100, and the default is 20. """ + + owner_project_access: Literal["active", "inactive", "any"] + """ + Filter API keys by whether the owner currently has effective access to the + project. Use `active` for owners with access, `inactive` for owners without + access, or `any` for all enabled project API keys. If omitted, the endpoint + applies its existing membership-based visibility rules, which may exclude some + enabled keys. + """ diff --git a/src/openai/types/admin/organization/projects/project_api_key.py b/src/openai/types/admin/organization/projects/project_api_key.py index 7e5e6949eb..ba08335b39 100644 --- a/src/openai/types/admin/organization/projects/project_api_key.py +++ b/src/openai/types/admin/organization/projects/project_api_key.py @@ -74,5 +74,8 @@ class ProjectAPIKey(BaseModel): owner: Owner + owner_project_access: Literal["active", "inactive"] + """Whether the API key's owner currently has effective access to the project.""" + redacted_value: str """The redacted value of the API key""" diff --git a/src/openai/types/beta/beta_response_reasoning_item.py b/src/openai/types/beta/beta_response_reasoning_item.py index 57bed79f63..14d3c5abe7 100644 --- a/src/openai/types/beta/beta_response_reasoning_item.py +++ b/src/openai/types/beta/beta_response_reasoning_item.py @@ -59,9 +59,10 @@ class BetaResponseReasoningItem(BaseModel): """Reasoning text content.""" encrypted_content: Optional[str] = None - """ - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + """The encrypted content of the reasoning item. + + This is populated by default for reasoning items returned by + `POST /v1/responses` and WebSocket `response.create` requests. """ status: Optional[Literal["in_progress", "completed", "incomplete"]] = None diff --git a/src/openai/types/beta/beta_response_reasoning_item_param.py b/src/openai/types/beta/beta_response_reasoning_item_param.py index 8a91128af8..608a31189f 100644 --- a/src/openai/types/beta/beta_response_reasoning_item_param.py +++ b/src/openai/types/beta/beta_response_reasoning_item_param.py @@ -59,9 +59,10 @@ class BetaResponseReasoningItemParam(TypedDict, total=False): """Reasoning text content.""" encrypted_content: Optional[str] - """ - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + """The encrypted content of the reasoning item. + + This is populated by default for reasoning items returned by + `POST /v1/responses` and WebSocket `response.create` requests. """ status: Literal["in_progress", "completed", "incomplete"] diff --git a/src/openai/types/responses/response_reasoning_item.py b/src/openai/types/responses/response_reasoning_item.py index 1a22eb60cc..7f24ef2c57 100644 --- a/src/openai/types/responses/response_reasoning_item.py +++ b/src/openai/types/responses/response_reasoning_item.py @@ -49,9 +49,10 @@ class ResponseReasoningItem(BaseModel): """Reasoning text content.""" encrypted_content: Optional[str] = None - """ - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + """The encrypted content of the reasoning item. + + This is populated by default for reasoning items returned by + `POST /v1/responses` and WebSocket `response.create` requests. """ status: Optional[Literal["in_progress", "completed", "incomplete"]] = None diff --git a/src/openai/types/responses/response_reasoning_item_param.py b/src/openai/types/responses/response_reasoning_item_param.py index 40320b72e1..e4cbc884e3 100644 --- a/src/openai/types/responses/response_reasoning_item_param.py +++ b/src/openai/types/responses/response_reasoning_item_param.py @@ -49,9 +49,10 @@ class ResponseReasoningItemParam(TypedDict, total=False): """Reasoning text content.""" encrypted_content: Optional[str] - """ - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + """The encrypted content of the reasoning item. + + This is populated by default for reasoning items returned by + `POST /v1/responses` and WebSocket `response.create` requests. """ status: Literal["in_progress", "completed", "incomplete"] diff --git a/src/openai/types/webhooks/__init__.py b/src/openai/types/webhooks/__init__.py index dcb4f3dec4..8b9e55653b 100644 --- a/src/openai/types/webhooks/__init__.py +++ b/src/openai/types/webhooks/__init__.py @@ -22,6 +22,3 @@ from .fine_tuning_job_succeeded_webhook_event import ( FineTuningJobSucceededWebhookEvent as FineTuningJobSucceededWebhookEvent, ) -from .safety_identifier_blocked_webhook_event import ( - SafetyIdentifierBlockedWebhookEvent as SafetyIdentifierBlockedWebhookEvent, -) diff --git a/src/openai/types/webhooks/safety_identifier_blocked_webhook_event.py b/src/openai/types/webhooks/safety_identifier_blocked_webhook_event.py deleted file mode 100644 index 04472727ac..0000000000 --- a/src/openai/types/webhooks/safety_identifier_blocked_webhook_event.py +++ /dev/null @@ -1,46 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["SafetyIdentifierBlockedWebhookEvent", "Data"] - - -class Data(BaseModel): - """Event data payload.""" - - safety_category: str - """The safety category that triggered the block, such as `bio` or `cyber`.""" - - safety_identifier: str - """The stable safety identifier associated with the blocked request.""" - - model: Optional[str] = None - """The model used for the blocked request, if available.""" - - project_id: Optional[str] = None - """The project associated with the blocked request, if available.""" - - request_id: Optional[str] = None - """The OpenAI request ID for the blocked request, if available.""" - - -class SafetyIdentifierBlockedWebhookEvent(BaseModel): - """Sent when a request associated with a safety identifier has been blocked.""" - - id: str - """The unique ID of the event.""" - - created_at: int - """The Unix timestamp (in seconds) of when the request was blocked.""" - - data: Data - """Event data payload.""" - - type: Literal["safety_identifier.blocked"] - """The type of the event. Always `safety_identifier.blocked`.""" - - object: Optional[Literal["event"]] = None - """The object of the event. Always `event`.""" diff --git a/src/openai/types/webhooks/unwrap_webhook_event.py b/src/openai/types/webhooks/unwrap_webhook_event.py index 20b77c493f..952383c049 100644 --- a/src/openai/types/webhooks/unwrap_webhook_event.py +++ b/src/openai/types/webhooks/unwrap_webhook_event.py @@ -19,7 +19,6 @@ from .realtime_call_incoming_webhook_event import RealtimeCallIncomingWebhookEvent from .fine_tuning_job_cancelled_webhook_event import FineTuningJobCancelledWebhookEvent from .fine_tuning_job_succeeded_webhook_event import FineTuningJobSucceededWebhookEvent -from .safety_identifier_blocked_webhook_event import SafetyIdentifierBlockedWebhookEvent __all__ = ["UnwrapWebhookEvent"] @@ -40,7 +39,6 @@ ResponseCompletedWebhookEvent, ResponseFailedWebhookEvent, ResponseIncompleteWebhookEvent, - SafetyIdentifierBlockedWebhookEvent, ], PropertyInfo(discriminator="type"), ] diff --git a/tests/api_resources/admin/organization/projects/test_api_keys.py b/tests/api_resources/admin/organization/projects/test_api_keys.py index f9aef44216..b2717c59d2 100644 --- a/tests/api_resources/admin/organization/projects/test_api_keys.py +++ b/tests/api_resources/admin/organization/projects/test_api_keys.py @@ -79,6 +79,7 @@ def test_method_list_with_all_params(self, client: OpenAI) -> None: project_id="project_id", after="after", limit=0, + owner_project_access="active", ) assert_matches_type(SyncConversationCursorPage[ProjectAPIKey], api_key, path=["response"]) @@ -228,6 +229,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> N project_id="project_id", after="after", limit=0, + owner_project_access="active", ) assert_matches_type(AsyncConversationCursorPage[ProjectAPIKey], api_key, path=["response"]) From b0e11d996e5e208572e7e0b7fef1ad2775d1b3bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 23:59:45 +0000 Subject: [PATCH 3/3] release: 2.46.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/openai/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e39a142b9e..7336785395 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.45.0" + ".": "2.46.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 32b95dda50..6f4e32cbbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.46.0 (2026-07-13) + +Full Changelog: [v2.45.0...v2.46.0](https://github.com/openai/openai-python/compare/v2.45.0...v2.46.0) + +### Features + +* **api:** add owner_project_access to APIKeyListParams ([f589d04](https://github.com/openai/openai-python/commit/f589d04bf9f377ecb1f54335ab3ab9d825b5dfee)) + ## 2.45.0 (2026-07-09) Full Changelog: [v2.44.0...v2.45.0](https://github.com/openai/openai-python/compare/v2.44.0...v2.45.0) diff --git a/pyproject.toml b/pyproject.toml index 423289c26e..2ac8884511 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "2.45.0" +version = "2.46.0" description = "The official Python library for the openai API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openai/_version.py b/src/openai/_version.py index b9f16d5834..a827c30678 100644 --- a/src/openai/_version.py +++ b/src/openai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openai" -__version__ = "2.45.0" # x-release-please-version +__version__ = "2.46.0" # x-release-please-version