You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Expose optional prompt cache comparison diagnostics across the stable
and beta Responses APIs. Clarify how Fast and Priority service tier
requests resolve for different models.
## Changes
- Add the optional `comparison_response_id` prompt cache option to
response creation parameters and client events.
- Add `prompt_cache_diagnostics` to response models with typed cache
hit, cache miss, comparison-not-found, and unavailable outcomes.
- Expose cache miss reasons, affected token estimates, and
reusable-prefix token counts in diagnostic results.
- Include the comparison response ID in returned prompt cache options
when supplied.
- Clarify that Fast or Priority requests resolve to `fast` for models
with a dedicated Fast tier and to `priority` for other models.
Co-authored-by: apcha-oai <228803254+apcha-oai@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/openai/types/beta/beta_responses_client_event.py
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,13 @@ class ResponseCreatePromptCacheOptions(BaseModel):
110
110
Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details.
111
111
"""
112
112
113
+
comparison_response_id: Optional[str] =None
114
+
"""The ID of a response to compare when diagnosing prompt cache reuse.
115
+
116
+
Supplying this field requests prompt cache diagnostics when the feature is
Copy file name to clipboardExpand all lines: src/openai/types/beta/beta_responses_client_event_param.py
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,13 @@ class ResponseCreatePromptCacheOptions(TypedDict, total=False):
110
110
Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details.
111
111
"""
112
112
113
+
comparison_response_id: Optional[str]
114
+
"""The ID of a response to compare when diagnosing prompt cache reuse.
115
+
116
+
Supplying this field requests prompt cache diagnostics when the feature is
117
+
enabled.
118
+
"""
119
+
113
120
mode: Literal["implicit", "explicit"]
114
121
"""Controls whether OpenAI automatically creates an implicit cache breakpoint.
Copy file name to clipboardExpand all lines: src/openai/types/beta/response_create_params.py
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -509,6 +509,13 @@ class PromptCacheOptions(TypedDict, total=False):
509
509
Supported for `gpt-5.6` and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is currently the only supported value. See the [prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching) for current details.
510
510
"""
511
511
512
+
comparison_response_id: Optional[str]
513
+
"""The ID of a response to compare when diagnosing prompt cache reuse.
514
+
515
+
Supplying this field requests prompt cache diagnostics when the feature is
516
+
enabled.
517
+
"""
518
+
512
519
mode: Literal["implicit", "explicit"]
513
520
"""Controls whether OpenAI automatically creates an implicit cache breakpoint.
0 commit comments