AI SDK OpenAI 3.0.141 Update: Structured Outputs and Prompt Caching Improvements

AI SDK's OpenAI provider releases a patch fixing cache and reasoning reuse when structured output schemas change.
`@ai-sdk/openai@3.0.141` is a low-key patch-level release centered on Responses API structured outputs and prompt caching. It supports anchored format updates so that prior reasoning content is preserved and prompt cache reused when JSON Schema changes; adds a stable request-level text format override for clearer per-call format control; and exposes prompt cache comparison diagnostics for both generation and streaming results. Together, these push schema iteration from a high-cost operation toward a routine one, especially valuable for Agent and data pipeline scenarios with frequent output format adjustments. The release does not provide specific performance numbers, so actual benefits need to be assessed using the diagnostic information.
A Low-Key but Critical Minor Release
The OpenAI provider package for AI SDK has released patch version @ai-sdk/openai@3.0.141. Judging from the release notes, this isn't a flashy feature expansion but rather an underlying fix targeting Responses API structured outputs and prompt cache reuse. For developers relying on structured outputs in production for data extraction or Agent tool calls, this kind of change is often more noteworthy than a new API.

This release was automatically built and signed by GitHub Actions and is a routine patch change (Patch Changes). The release notes contain only one core change entry, but it's information-dense.
Core Change: Keeping Context When Switching Structured Output Schemas
Preserving Reasoning and Prompt Cache
According to the release notes, this patch "supports anchored Responses API format updates, so that changes to a structured output schema preserve prior reasoning content and reuse the prompt cache."
The key here is the "schema change" scenario. In practice, structured outputs often need iteration—today you adjust a JSON Schema field, tomorrow you add an enum constraint to some property. Under the old behavior, once the schema changed, the request format changed with it, the model-side prompt cache could be invalidated, and prior reasoning content was hard to carry forward. In effect, every schema change incurred a full cost of rebuilding context.
The new version makes these format updates "anchorable," thereby preserving two things as the schema evolves: previously generated reasoning content and the already-established prompt cache. For teams that repeatedly tune output structure, this directly affects call cost and response latency.
Prompt Caching is a cost and latency optimization mechanism offered by model providers: when multiple requests share the same prompt prefix (such as system instructions, long documents, or tool definitions), the server caches the computed results for that portion, and subsequent requests reuse it directly without recomputation. OpenAI's automatic caching typically triggers once the prompt exceeds a certain length (about 1024 tokens), and on a hit it can significantly reduce input token billing and shorten time-to-first-token. Caching assumes an "exact prefix match," so subtle changes in request body formatting—even just a different order of tool definitions or a different JSON Schema structure—can cause a prefix mismatch and invalidate the cache. This is exactly why the schema changes described in this article cause cost fluctuations.
The Responses API is OpenAI's next-generation interface introduced alongside Chat Completions, unifying text generation, tool calls, built-in tools, and multi-turn state management, and supporting cross-turn continuation via mechanisms such as previous_response_id. Structured outputs are declared on it in the form of text.format (e.g., json_schema).
Request-Level Text Format Override
The patch also adds a "stable request-level text format override" capability. This amounts to an explicit format control switch at the individual request level, allowing developers to specify the text format used for a given call more definitively rather than relying entirely on default inference. Combined with the cache preservation logic above, this override mechanism makes format switching controllable and predictable.
Structured Outputs refers to constraining model output via JSON Schema so that it strictly conforms to a given structure, as opposed to the looser approach of merely "hoping" the model outputs JSON through prompting. OpenAI's implementation includes a strict: true mode, where decoding-stage constraints guarantee schema compliance, but this also requires the schema to satisfy a series of restrictions (such as all fields being listed in required and certain keywords not being supported). Because the schema participates directly in request encoding, any change to it alters the request fingerprint, which in turn affects caching and reasoning continuity—this is the premise for understanding the value of this patch.
Cache Comparison Diagnostics
Another notable point is "exposing prompt cache comparison diagnostics for both generation and streaming results." This means developers can obtain diagnostic information about prompt cache hits and comparisons in both regular generation and streaming call modes. For troubleshooting questions like "why didn't this call hit the cache" and "how effective is cache reuse," diagnostic information is the first step.
What These Changes Mean
Looking at the three points together, the intent of this patch becomes clear: to decouple the structured output iteration process from the caching mechanism so they no longer interfere with each other.
In the past, schema adjustments were often treated as "breaking changes," and teams would try to batch up changes and release them together to amortize the cost of cache invalidation. With anchorable format updates, request-level overrides, and cache diagnostics, this combination pushes schema iteration from a "high-cost operation" toward a "routine operation." This is especially valuable for Agent applications and data pipeline scenarios that frequently adjust output formats.
It should be noted that the release notes do not provide specific performance numbers or cache hit rate data, so actual benefits still depend on the call mode and the magnitude of schema changes. Developers can use the newly added diagnostic information to assess this themselves.
Reasoning content is generated by reasoning models (such as the o series and GPT-5 series) to record the thought process leading up to an answer. When using the Responses API for multi-turn or tool-calling scenarios, these reasoning items can be passed back with the context to help the model maintain a consistent line of thought; if a change in request format prevents reasoning items from continuing, the model must "think" again, which both increases token consumption and affects result stability. Therefore, "preserving prior reasoning content" is especially critical for Agent scenarios that rely on reasoning models.
Upgrade Recommendations
This is a patch-level release with no described breaking API changes, so the risk is low. The following types of projects are recommended to upgrade first:
- Projects that are frequently iterating on structured output schemas;
- Production services that are sensitive to prompt caching costs and need to diagnose cache behavior;
- AI applications that use both generation and streaming call modes.
After upgrading, you can first use the newly added cache comparison diagnostics to observe for a period of time, confirm that cache reuse behavior in schema change scenarios meets expectations, and then roll it out to production traffic at scale.
Summary
The value of @ai-sdk/openai@3.0.141 lies not in "what new features were added" but in "making existing capabilities run more cost-effectively." Structured outputs and prompt caching are two main threads for AI SDK users, and this patch specifically addresses the coupling conflict between them—a typical infrastructure-level minor release that is worth following.
Related articles

How to Review a 22,505-Line PR? Matt Pocock's Stacked PRs and Ratchet Rules
Matt Pocock split a 22,505-line agent PR into 9 stacked PRs, used a two-way/one-way door framework to isolate the DB change, and enforced ratcheted lint rules and retro.

Codex from Beginner to Practitioner: A Complete Analysis of AI Coding Agents
An analysis of OpenAI's coding agent Codex: its positioning, its key difference from ChatGPT (talking vs doing), and why developers should learn it, covering setup, multitasking, automation, and MCP.

Claude Code in Practice: Multi-Model Comparison and Token Cost Control
Based on a public course, this article covers Claude Code's local installation, project-level context understanding, and auto-debugging, compares coding assistants like Copilot, Cursor, and Trae, and discusses multi-model configuration and token cost control.