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.51.0"
".": "2.52.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: 278
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-44d4add500460ed21ac9ae1d6dd4047a32a79d3b4c3a9d9754f6ecf8cbdb9eec.yml
openapi_spec_hash: 8a34ba094583f56e975067493574fa69
config_hash: ca12d10f1dbe101a81cd0376f868c674
configured_endpoints: 279
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-31fcc3c97e5c432754bf0b72c5d5abbe1493573f0ca888af914baf81188b453e.yml
openapi_spec_hash: f867849a0c2a9c9b838d21f1c720a9e3
config_hash: fce3820c4f95b555e486349bc7d297d8
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 2.52.0 (2026-07-31)

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

### Features

* **api:** content provenance checks ([1d6c118](https://github.com/openai/openai-python/commit/1d6c1180f8eaa71bfd45cae67360987b2bea3656))


### Bug Fixes

* **client:** honor Retry-After delays up to two minutes ([#3555](https://github.com/openai/openai-python/issues/3555)) ([7fa7946](https://github.com/openai/openai-python/commit/7fa7946485b5ecbadd0ebf8624c574e2c9e3370c))


### Documentation

* add API-key mTLS HTTP client recipes ([#3552](https://github.com/openai/openai-python/issues/3552)) ([7a3d5e4](https://github.com/openai/openai-python/commit/7a3d5e46b61cb36109dc4e7fd6d4ab70cc6d6c0f))

## 2.51.0 (2026-07-30)

Full Changelog: [v2.50.0...v2.51.0](https://github.com/openai/openai-python/compare/v2.50.0...v2.51.0)
Expand Down
12 changes: 12 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ Methods:
- <code title="post /images/edits">client.images.<a href="./src/openai/resources/images.py">edit</a>(\*\*<a href="src/openai/types/image_edit_params.py">params</a>) -> <a href="./src/openai/types/images_response.py">ImagesResponse</a></code>
- <code title="post /images/generations">client.images.<a href="./src/openai/resources/images.py">generate</a>(\*\*<a href="src/openai/types/image_generate_params.py">params</a>) -> <a href="./src/openai/types/images_response.py">ImagesResponse</a></code>

# ContentProvenanceChecks

Types:

```python
from openai.types import ContentProvenanceCheck
```

Methods:

- <code title="post /content_provenance_checks">client.content_provenance_checks.<a href="./src/openai/resources/content_provenance_checks.py">create</a>(\*\*<a href="src/openai/types/content_provenance_check_create_params.py">params</a>) -> <a href="./src/openai/types/content_provenance_check.py">ContentProvenanceCheck</a></code>

# Audio

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.51.0"
version = "2.52.0"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions src/openai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,4 +470,5 @@ def _reset_client() -> None: # type: ignore[reportUnusedFunction]
moderations as moderations,
conversations as conversations,
vector_stores as vector_stores,
content_provenance_checks as content_provenance_checks,
)
38 changes: 38 additions & 0 deletions src/openai/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
moderations,
conversations,
vector_stores,
content_provenance_checks,
)
from .resources.files import Files, AsyncFiles
from .resources.images import Images, AsyncImages
Expand All @@ -85,6 +86,7 @@
from .resources.responses.responses import Responses, AsyncResponses
from .resources.containers.containers import Containers, AsyncContainers
from .resources.fine_tuning.fine_tuning import FineTuning, AsyncFineTuning
from .resources.content_provenance_checks import ContentProvenanceChecks, AsyncContentProvenanceChecks
from .resources.conversations.conversations import Conversations, AsyncConversations
from .resources.vector_stores.vector_stores import VectorStores, AsyncVectorStores

Expand Down Expand Up @@ -319,6 +321,12 @@ def images(self) -> Images:

return Images(self)

@cached_property
def content_provenance_checks(self) -> ContentProvenanceChecks:
from .resources.content_provenance_checks import ContentProvenanceChecks

return ContentProvenanceChecks(self)

@cached_property
def audio(self) -> Audio:
from .resources.audio import Audio
Expand Down Expand Up @@ -919,6 +927,12 @@ def images(self) -> AsyncImages:

return AsyncImages(self)

@cached_property
def content_provenance_checks(self) -> AsyncContentProvenanceChecks:
from .resources.content_provenance_checks import AsyncContentProvenanceChecks

return AsyncContentProvenanceChecks(self)

@cached_property
def audio(self) -> AsyncAudio:
from .resources.audio import AsyncAudio
Expand Down Expand Up @@ -1359,6 +1373,12 @@ def images(self) -> images.ImagesWithRawResponse:

return ImagesWithRawResponse(self._client.images)

@cached_property
def content_provenance_checks(self) -> content_provenance_checks.ContentProvenanceChecksWithRawResponse:
from .resources.content_provenance_checks import ContentProvenanceChecksWithRawResponse

return ContentProvenanceChecksWithRawResponse(self._client.content_provenance_checks)

@cached_property
def audio(self) -> audio.AudioWithRawResponse:
from .resources.audio import AudioWithRawResponse
Expand Down Expand Up @@ -1510,6 +1530,12 @@ def images(self) -> images.AsyncImagesWithRawResponse:

return AsyncImagesWithRawResponse(self._client.images)

@cached_property
def content_provenance_checks(self) -> content_provenance_checks.AsyncContentProvenanceChecksWithRawResponse:
from .resources.content_provenance_checks import AsyncContentProvenanceChecksWithRawResponse

return AsyncContentProvenanceChecksWithRawResponse(self._client.content_provenance_checks)

@cached_property
def audio(self) -> audio.AsyncAudioWithRawResponse:
from .resources.audio import AsyncAudioWithRawResponse
Expand Down Expand Up @@ -1661,6 +1687,12 @@ def images(self) -> images.ImagesWithStreamingResponse:

return ImagesWithStreamingResponse(self._client.images)

@cached_property
def content_provenance_checks(self) -> content_provenance_checks.ContentProvenanceChecksWithStreamingResponse:
from .resources.content_provenance_checks import ContentProvenanceChecksWithStreamingResponse

return ContentProvenanceChecksWithStreamingResponse(self._client.content_provenance_checks)

@cached_property
def audio(self) -> audio.AudioWithStreamingResponse:
from .resources.audio import AudioWithStreamingResponse
Expand Down Expand Up @@ -1812,6 +1844,12 @@ def images(self) -> images.AsyncImagesWithStreamingResponse:

return AsyncImagesWithStreamingResponse(self._client.images)

@cached_property
def content_provenance_checks(self) -> content_provenance_checks.AsyncContentProvenanceChecksWithStreamingResponse:
from .resources.content_provenance_checks import AsyncContentProvenanceChecksWithStreamingResponse

return AsyncContentProvenanceChecksWithStreamingResponse(self._client.content_provenance_checks)

@cached_property
def audio(self) -> audio.AsyncAudioWithStreamingResponse:
from .resources.audio import AsyncAudioWithStreamingResponse
Expand Down
8 changes: 8 additions & 0 deletions src/openai/_module_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from .resources.responses.responses import Responses
from .resources.containers.containers import Containers
from .resources.fine_tuning.fine_tuning import FineTuning
from .resources.content_provenance_checks import ContentProvenanceChecks
from .resources.conversations.conversations import Conversations
from .resources.vector_stores.vector_stores import VectorStores

Expand Down Expand Up @@ -165,6 +166,12 @@ def __load__(self) -> Conversations:
return _load_client().conversations


class ContentProvenanceChecksProxy(LazyProxy["ContentProvenanceChecks"]):
@override
def __load__(self) -> ContentProvenanceChecks:
return _load_client().content_provenance_checks


chat: Chat = ChatProxy().__as_proxied__()
beta: Beta = BetaProxy().__as_proxied__()
files: Files = FilesProxy().__as_proxied__()
Expand All @@ -187,3 +194,4 @@ def __load__(self) -> Conversations:
fine_tuning: FineTuning = FineTuningProxy().__as_proxied__()
vector_stores: VectorStores = VectorStoresProxy().__as_proxied__()
conversations: Conversations = ConversationsProxy().__as_proxied__()
content_provenance_checks: ContentProvenanceChecks = ContentProvenanceChecksProxy().__as_proxied__()
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.51.0" # x-release-please-version
__version__ = "2.52.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/openai/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@
VectorStoresWithStreamingResponse,
AsyncVectorStoresWithStreamingResponse,
)
from .content_provenance_checks import (
ContentProvenanceChecks,
AsyncContentProvenanceChecks,
ContentProvenanceChecksWithRawResponse,
AsyncContentProvenanceChecksWithRawResponse,
ContentProvenanceChecksWithStreamingResponse,
AsyncContentProvenanceChecksWithStreamingResponse,
)

__all__ = [
"Completions",
Expand Down Expand Up @@ -176,6 +184,12 @@
"AsyncImagesWithRawResponse",
"ImagesWithStreamingResponse",
"AsyncImagesWithStreamingResponse",
"ContentProvenanceChecks",
"AsyncContentProvenanceChecks",
"ContentProvenanceChecksWithRawResponse",
"AsyncContentProvenanceChecksWithRawResponse",
"ContentProvenanceChecksWithStreamingResponse",
"AsyncContentProvenanceChecksWithStreamingResponse",
"Audio",
"AsyncAudio",
"AudioWithRawResponse",
Expand Down
36 changes: 32 additions & 4 deletions src/openai/resources/beta/responses/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ def compact(
prompt_cache_key: Optional[str] | Omit = omit,
prompt_cache_options: Optional[response_compact_params.PromptCacheOptions] | Omit = omit,
prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "priority"]] | Omit = omit,
service_tier: Optional[Literal["auto", "default", "fast", "flex", "priority"]] | Omit = omit,
betas: List[Literal["responses_multi_agent=v1"]] | 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.
Expand Down Expand Up @@ -1902,7 +1902,21 @@ def compact(

prompt_cache_retention: How long to retain a prompt cache entry created by this request.

service_tier: The service tier to use for this request.
service_tier: Specifies the processing type used for serving the request. - If set to 'auto',
then the request will be processed with the service tier configured in the
Project settings. Unless otherwise configured, the Project will use 'default'. -
If set to 'default', then the request will be processed with the standard
pricing and performance for the selected model. - If set to
'[flex](https://platform.openai.com/docs/guides/flex-processing)', then the
request will be processed with the Flex Processing service tier. - To opt-in to
[Fast mode](/api/docs/guides/fast-mode) at the request level, include the
`service_tier=fast` or `service_tier=priority` parameter for Responses or Chat
Completions. The response will show `service_tier=priority` regardless of if you
specify `service_tier=fast` or `priority` in your request. - When not set, the
default behavior is 'auto'. When the `service_tier` parameter is set, the
response body will include the `service_tier` value based on the processing mode
actually used to serve the request. This response value may be different from
the value set in the parameter.

extra_headers: Send extra headers

Expand Down Expand Up @@ -3745,7 +3759,7 @@ async def compact(
prompt_cache_key: Optional[str] | Omit = omit,
prompt_cache_options: Optional[response_compact_params.PromptCacheOptions] | Omit = omit,
prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "priority"]] | Omit = omit,
service_tier: Optional[Literal["auto", "default", "fast", "flex", "priority"]] | Omit = omit,
betas: List[Literal["responses_multi_agent=v1"]] | 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.
Expand Down Expand Up @@ -3796,7 +3810,21 @@ async def compact(

prompt_cache_retention: How long to retain a prompt cache entry created by this request.

service_tier: The service tier to use for this request.
service_tier: Specifies the processing type used for serving the request. - If set to 'auto',
then the request will be processed with the service tier configured in the
Project settings. Unless otherwise configured, the Project will use 'default'. -
If set to 'default', then the request will be processed with the standard
pricing and performance for the selected model. - If set to
'[flex](https://platform.openai.com/docs/guides/flex-processing)', then the
request will be processed with the Flex Processing service tier. - To opt-in to
[Fast mode](/api/docs/guides/fast-mode) at the request level, include the
`service_tier=fast` or `service_tier=priority` parameter for Responses or Chat
Completions. The response will show `service_tier=priority` regardless of if you
specify `service_tier=fast` or `priority` in your request. - When not set, the
default behavior is 'auto'. When the `service_tier` parameter is set, the
response body will include the `service_tier` value based on the processing mode
actually used to serve the request. This response value may be different from
the value set in the parameter.

extra_headers: Send extra headers

Expand Down
Loading
Loading