# What changed in @langchain/openai

> 89 changes in @langchain/openai 0.3 to 1 from its official release notes, upgrade guides and advisories: 2 breaking, 3 security, 31 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/@langchain/openai/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @langchain/openai 1

### Breaking changes

- Applies per-call options before modelKwargs, then the constructor field; on Chat Completions, modelKwargs values are no longer dropped and take precedence over the constructor field. (1.6.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.6.0)
- Applies per-call options before modelKwargs, then the constructor field; on Chat Completions, modelKwargs values are no longer dropped and take precedence over the constructor field. (1.6.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.6.0)

### Security

- LangChain: MongoDBChatMessageHistory query injection can allow cross-session access (1.3.1) — [security advisory](https://github.com/advisories/GHSA-M6RX-H84Q-8R95)
- Encrypted reasoning is now included in the input for zero-data-retention (ZDR) responses. (1.2.5) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.5)

### New APIs and options

- Responses API accepts an additional_tools block on a SystemMessage and sends it as a top-level input item preceding the message. It throws if used with Chat Completions or on a non-SystemMessage, except assistant messages. (1.6.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.6.2)
- ModelProfile now includes fileMimeTypes so models can advertise accepted MIME types for generic file inputs; OpenAI Responses API models report the types supported by input_file. (1.6.1) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.6.1)
- Adds support for content-block breakpoints. (1.6.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.6.0)
- Supports explicit prompt cache options. (1.6.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.6.0)
- Supports configuration_update content blocks for changing reasoning effort mid-conversation without invalidating the cached prompt prefix. (1.5.12) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.12)
- OpenAI chat models can now use LangSmith Gateway environment configuration. (1.5.6) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.6)
- Adds native event converters for streamEvents. (1.5.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.0)
- Responses API messages now support phase on text content blocks, including streaming events, and round-trip it through raw provider and standard content paths. (1.4.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.0)
- Propagates defer_loading from LangChain tool extras through bindTools() into the Responses API payload, enabling on-demand tool discovery. (1.3.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.3.0)
- Adds a factory for the OpenAI Responses API tool_search built-in tool, supporting server-executed and client-executed modes. (1.3.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.3.0)
- Added gpt-5.4 to profiles, making it available to developers using the package. (1.2.13) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.13)
- Structured output now supports Standard Schema, allowing developers to use Standard Schema schemas for structured output. (1.2.12) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.12)
- File input conversion supports docx, pptx, xlsx, and csv document types. (1.2.11) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.11)
- OpenAI now raises ContextOverflowError for context overflow, giving callers a specific error to handle. (1.2.8) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.8)
- Adds support for codex 5.3. (1.2.5) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.5)
- The image generation tool accepts an action option with generate, edit, and auto choices. (1.2.5) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.5)
- Adds local_shell_call support to the streaming converter and input reconstruction. (1.2.5) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.5)
- Adds shell_call support to the streaming converter and input reconstruction. (1.2.5) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.5)
- Adds a deprecated call-option shorthand for reasoning.effort; reasoning.effort takes precedence when both are provided. (1.2.4) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.4)
- Adds support for the apply patch tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for the code interpreter tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for the computer use tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for the file search tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for the image generation tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for the local shell tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for the MCP connector tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds moderateContent to ChatOpenAI for content moderation. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for prompt cache retention. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for the shell tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Adds support for the web search tool. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- apiKey now supports a callable function. (1.1.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.1.2)

### Performance

- Stream chunk aggregation was optimized and redundant sorting was removed. (1.2.3) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.3)

### Behavior and default changes

- The v0 default replay path reuses response_metadata.output directly, preserving every reasoning item's id and encrypted_content in original order under Zero Data Retention. (1.5.13) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.13)
- Timeouts and rate limits are marked retryable; aborts, context overflow, invalid tool results, bad credentials, and unknown models are marked non-retryable. Other errors remain unmarked and retry as before. (1.5.8) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.8)
- Strict tools are decoupled from strict structured output responses, so their behavior is no longer tied together. (1.5.3) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.3)
- Built-in tool progress events are now streamed. (1.5.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.2)
- Standard URL file blocks are now routed to native input_file in the Responses API. (1.5.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.2)
- Runnable traces now include package version metadata, making version information available in LangSmith trace metadata. (1.2.11) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.11)
- Stores response.output in response_metadata to support reasoning model round-trips. (1.2.7) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.7)
- Codex models, including codex-mini-latest and gpt-5-codex variants, are automatically routed to the Responses API. (1.2.5) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.5)
- OpenAI image generation outputs are now returned as proper image content blocks. (1.2.3) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.3)
- Prefers the Responses API for 5.2 pro. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)

### Fixes and other changes

- Wrapped configuration_update and mcp_approval_response blocks are now hoisted as Responses API input items, including blocks on messages built with contentBlocks. Chat Completions sends a non_standard block's payload rather than its wrapper. (1.6.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.6.2)
- Sends the in-memory retention value as in_memory because the API rejects the hyphenated value. (1.6.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.6.0)
- The v1 contentBlocks replay path preserves every reasoning item's id and encrypted_content in original order under Zero Data Retention. (1.5.13) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.13)
- Fixes base URL deserialization. (1.5.12) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.12)
- Routes gpt-5.6-sol to the Responses API so function tools work with reasoning. (1.5.12) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.12)
- Streaming now resolves encrypted_content from the canonical payload on the final done event, and it propagates without needing an include call option. (1.5.11) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.11)
- Tool-call-only v1 assistant messages now send content as null instead of an empty array. (1.5.10) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.10)
- OpenAI cache_write_tokens are mapped to cache_creation in usage_metadata.input_token_details instead of being silently dropped. (1.5.9) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.9)
- Gemini-native functionCall content blocks are dropped when converting messages to Chat Completions API params, preventing requests from failing during cross-provider handoffs. (1.5.9) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.9)
- A per-call maxRetries is forwarded to the retry loop so a surrounding retry loop can take over instead of multiplying retries. (1.5.8) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.8)
- Includes usage in response_metadata when system_fingerprint is absent. (1.5.7) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.7)
- Content blocks rejected by the chat completions API are filtered out of input. (1.5.5) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.5)
- tool_call content blocks are dropped from chat completions input. (1.5.5) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.5)
- Assistant content in responses input now emits output_text. (1.5.4) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.4)
- The converter no longer forwards content on reasoning input items, which only carry summary, avoiding a Responses API error. (1.5.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.2)
- When replaying reasoning items as Responses API input, the converter now omits id when it is absent, avoiding an OpenAI 400 error. (1.5.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.2)
- Responses API stream iteration errors are now wrapped with existing OpenAI client error handling. (1.5.1) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.5.1)
- AI messages preserve top-level Responses API ids. (1.4.7) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.7)
- Custom tool calls are streamed through Responses API chunks. (1.4.7) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.7)
- Handles JSON parsing failures caused by trailing non-whitespace characters without terminating the streaming response; the structured-output pipeline handles the typed failure. (1.4.6) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.6)
- Preserves v1 assistant tool calls. (1.4.6) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.6)
- Adds an index to streaming reasoning content blocks so chunks merge properly. (1.4.4) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.4)
- Preserves plain string responses content. (1.4.3) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.3)
- Placeholder filenames are supplied for OpenAI file inputs. (1.4.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.2)
- Preserves reasoning_content in ChatOpenAICompletions. (1.4.1) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.4.1)
- DeepSeek 400 errors containing maximum context length are now recognized as ContextOverflowError, allowing downstream code to handle context overflow correctly. (1.3.1) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.3.1)
- Guard JSON.parse in streaming json_schema when the text is empty. (1.3.1) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.3.1)
- Streaming and non-streaming converters handle tool_search_call and tool_search_output response items; core block translation maps them to server_tool_call and server_tool_call_result. (1.3.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.3.0)
- Fixes type narrowing for the new union type. (1.2.11) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.11)
- The Completions API streaming path now calls the callback for the final usage chunk, so callback-based consumers receive the usage_metadata chunk. (1.2.10) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.10)
- Passes service_tier to the API when using the Responses API. (1.2.7) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.7)
- Chat model invoke and streaming operations now check and propagate abort signals, enabling cancellation and allowing fallback chains to proceed after an abort. (1.2.4) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.4)
- Validation now allows file_url and file_id without filename metadata and avoids sending filename when it is not allowed. (1.2.4) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.4)
- ChatOpenAI now passes runManager to responses._generate. (1.2.4) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.4)
- A fix was made to OpenAI reasoning. (1.2.3) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.3)
- Reasoning tokens are now properly elevated. (1.2.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.2)
- The responses API now passes runManager to _streamResponseChunks. (1.2.1) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.1)
- Provider-native content in ToolMessage is passed through without stringification, preserving its original form. (1.2.1) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.1)
- Fixes content in AIMessage for tool and function calls. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Fixes filename and base64 conversions in OpenAI completions converters. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Allows setting the strict tag manually in providerStrategy. (1.2.0) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.2.0)
- Fix missing and inconsistent user agent headers. (1.1.2) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/%40langchain/openai%401.1.2)

## @langchain/openai 0.3

### Security

- Fixes CVE 2025 12735. (0.3.58) — [release notes](https://github.com/langchain-ai/langchainjs/releases/tag/0.3.58)
