Skip to content

Document explicit prompt caching support in ChatOpenAI#4829

Draft
langsmith-fleet[bot] wants to merge 1 commit into
mainfrom
docs/openai-explicit-prompt-caching
Draft

Document explicit prompt caching support in ChatOpenAI#4829
langsmith-fleet[bot] wants to merge 1 commit into
mainfrom
docs/openai-explicit-prompt-caching

Conversation

@langsmith-fleet

Copy link
Copy Markdown
Contributor

Fixes DOC-1363

Summary

  • Adds a new subsection "Explicit caching with breakpoints (Responses API)" to the Prompt caching section of the ChatOpenAI docs page, documenting the prompt_cache_breakpoint field on text, image, and file content blocks
  • Adds a "Request-level cache options" subsection documenting the new prompt_cache_options model parameter
  • Adds a "Cache write tokens" subsection documenting cache_creation in input_token_details usage metadata, including priority/flex service-tier variants

These features were added in langchain-ai/langchain#38762 (langchain-openai>=1.3.5, openai>=2.45.0).

Links

Verification

Cross-references checked: make check-cross-refs passed ✅. Vale not available in sandbox (brew dependency), but the content is prose-only additions with no structural changes.

Reviewers

Requested review from: Mason Daugherty (@mdrxy) (integrations owner)

@github-actions github-actions Bot added langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects external User is not a member of langchain-ai labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Mintlify preview branch generated: preview-docsop-1783712953-3d6265d

Site preview: https://langchain-5e9cc07a-preview-docsop-1783712953-3d6265d.mintlify.app

Important

Preview links may take a few minutes to start working while the deployment finishes.

Changed documentation pages (preview deep links):

### Explicit caching with breakpoints (Responses API)

<Note>
Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api).
Requires `langchain-openai>=1.3.5`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is done transitively

### Explicit caching with breakpoints (Responses API)

<Note>
Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only supported when using the Responses API.

need to verify this claim

```python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="gpt-4.1", use_responses_api=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
llm = ChatOpenAI(model="gpt-4.1", use_responses_api=True)
llm = ChatOpenAI(model="gpt-5.6-sol", use_responses_api=True)

need to verify model string

don't think 4.1 supports


```python
llm = ChatOpenAI(
model="gpt-4.1",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external User is not a member of langchain-ai langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants