Feature Request: Support OpenAI GPT-5.6 Explicit Prompt Cache Breakpoints in @langchain/openai
Summary
OpenAI GPT-5.6 introduces explicit prompt cache breakpoints, allowing applications to precisely control which parts of a prompt become cached. This can significantly reduce costs for agentic workloads with large, stable prompt prefixes.
Currently, @langchain/openai supports promptCacheKey, but I couldn’t find a way to use OpenAI’s explicit prompt caching features exposed by the native SDK.
It would be great if LangChain.js exposed this functionality.
Use case
I’m building a LangGraph.js agent that performs evaluations repeatedly throughout the day.
Each evaluation consists of multiple cases, and each case performs several LLM → tool → LLM iterations.
Across all runs, a large portion of the prompt remains identical:
-
tool definitions
-
system prompt
-
shared evaluation instructions
-
few-shot examples
OpenAI’s explicit prompt caching is designed exactly for this scenario and can substantially reduce input token costs.
While promptCacheKey already improves cache hit rates, it doesn’t expose explicit cache breakpoints, which provide much finer control over what gets cached.
Current behavior
Today I can configure:
const model = new ChatOpenAI({
model: "gpt-5.6",
promptCacheKey: "evaluation-v1",
});
However, I don’t see a way to express the native OpenAI request fields described here:
Specifically:
-
prompt_cache_options -
prompt_cache_breakpoint
Expected behavior
It should be possible to configure OpenAI explicit prompt caching through ChatOpenAI without dropping down to the raw OpenAI SDK.
I don’t have a strong opinion on the public API, as long as the OpenAI functionality is fully accessible.
Possible approaches include:
-
exposing the native OpenAI fields directly
-
provider-specific metadata
-
another LangChain abstraction if that’s preferred
The important part is that the adapter forwards OpenAI’s prompt caching configuration unchanged.
Why this matters
This is especially valuable for:
-
LangGraph agents
-
evaluation pipelines
-
repeated benchmark runs
-
tool-heavy agents
-
applications with large static prompt prefixes
These workloads often execute hundreds of nearly identical requests where only the latest user message differs.
Without explicit cache breakpoints, applications cannot fully leverage the prompt caching capabilities offered by GPT-5.6.
Questions
-
Is this functionality already available through an undocumented passthrough?
-
If not, would the maintainers be open to adding support?
-
If this feature would be accepted, I’d be happy to help test or contribute an implementation.