unstale

pypi / langchain-openai

langchain-openai

What changed in langchain-openai 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.

4 breaking5 security25 new APIs and options8 behavior and defaults60 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.1 on npm

langchain-openai 1102 changes

Breaking changes 4

  • The stream path now raises on error events.

    1.6.6release notes

  • The stop field is dropped from Responses API payloads.

    1.3.3release notes

  • The minimum required langchain-core version was bumped.

    1.1.12release notes

  • Updates the file index key name, affecting code that reads or writes this key.

    1.0.0release notes

Security 5

New APIs and options 25

  • Model profiles now declare mid-conversation support, allowing developers to identify models with this capability.

    1.7.1release notes

  • Adds support for the decisions API.

    1.7.0release notes

  • Azure workload identity is now discovered.

    1.6.7release notes

  • Added profile augmentations for Opus 5.5 and GPT-6.

    1.6.5release notes

  • Added support for async tools.

    1.6.1release notes

  • Added support for configuration_update.

    1.6.1release notes

  • Adds standard model exception types for handling model errors.

    1.6.0release notes

  • langchain-openai supports the OpenAI 3.0 SDK, allowing developers to use that SDK with the integration.

    1.5.0release notes

  • LangSmith gateway support is available through an environment variable.

    1.4.1release notes

  • Adds reasoning_effort as a standard chat model parameter.

    1.4.0release notes

  • Adds support for explicit prompt caching.

    1.3.5release notes

  • Adds package version tracking to tracing metadata and renames the package version trace metadata.

    1.3.1release notes

  • Support the apply_patch built-in tool.

    1.3.0release notes

  • Content-block-centric streaming (v2) was added.

    1.2.1release notes

  • The OpenAI integration now supports the phase parameter.

    1.1.12release notes

  • OpenRouter adds support for streaming token usage.

    1.1.11release notes

  • Tool search is now supported.

    1.1.11release notes

  • Support was added for automatic server-side compaction.

    1.1.10release notes

  • Adds ContextOverflowError, which is raised in OpenAI when context overflows.

    1.1.9release notes

  • Adds text_inputs to model profiles.

    1.1.9release notes

  • Adds text_outputs to model profiles.

    1.1.9release notes

  • Adds a strict flag to structured output.

    1.1.2release notes

  • Adds the missing tools parameter to ChatOpenAI.with_structured_output.

    1.1.2release notes

  • Adds OpenAI moderation middleware.

    1.0.0release notes

  • OpenAI service tier token details are now populated.

    1.0.0release notes

Behavior and default changes 8

  • Tool changes can now be made on SystemMessage instances mid-conversation.

    1.6.5release notes

  • Gateway metadata is extracted from response headers when available.

    1.5.2release notes

  • The model token mapping was extended through gpt-5.2 for modelname_to_contextsize.

    1.1.10release notes

  • Model profiles were updated, which may affect model capability information used by the package.

    1.1.8release notes

  • Maximum input token limits were updated for the gpt-5 series.

    1.1.6release notes

  • Uses the responses API when the model is gpt-5.2-pro.

    1.1.3release notes

  • The openai_api_key parameter now supports callable values.

    1.0.1release notes

  • Enables stream_usage when using the default base URL and client.

    1.0.0release notes

Fixes and other changes 60

  • Responses stream items stay on one block when output_index drifts.

    1.7.2release notes

  • Request constraints are supported for GPT-6.

    1.6.3release notes

  • Inferred Responses API routing is exposed at initialization.

    1.6.3release notes

  • Adds GPT-6 Astra reasoning effort support.

    1.6.2release notes

  • Fixed support for Azure AD authentication with OpenAI 3.8.

    1.6.1release notes

  • Corrected the reasoning_effort_levels for gpt-5 and gpt-5.1 profiles.

    1.6.1release notes

  • Corrected routing for gpt-5.6-sol to use the Responses API.

    1.6.1release notes

  • Raises a clear error when _create_chat_result receives an unexpected response type.

    1.6.0release notes

  • Supports o-series models when counting tokens from messages.

    1.5.2release notes

  • Reasoning item boundaries are preserved.

    1.5.2release notes

  • Invalid tool calls are filtered from content.

    1.4.3release notes

  • Filters LangChain-generated content block IDs.

    1.4.2release notes

  • Handles ContextWindowExceededError.

    1.4.2release notes

  • Preserves Responses text options.

    1.4.2release notes

  • Corrected the profile for this model.

    1.4.1release notes

  • Suppresses a Pydantic serializer warning on the structured output parsed field.

    1.3.4release notes

  • Tools are only set to strict=True for OpenAI-compatible models.

    1.3.3release notes

  • Response item IDs are dropped when store is false.

    1.3.3release notes

  • Normalizes v1 streamed tool calls.

    1.3.1release notes

  • Broadens the condition for ContextOverflowError to accommodate other providers.

    1.2.2release notes

  • Guards httpx finalizers to prevent errors during finalization.

    1.2.2release notes

  • The Responses API check now includes gpt-5.5 pro.

    1.2.1release notes

  • Prevents silent streaming hangs in ChatOpenAI.

    1.2.0release notes

  • Streaming now tolerates prompt_cache_retention drift.

    1.1.16release notes

  • Azure chat profiles are now inferred from the model name.

    1.1.15release notes

  • Model profile data was refreshed.

    1.1.15release notes

  • Streaming now accommodates dict response items.

    1.1.15release notes

  • Placeholder filenames are imputed for OpenAI file inputs.

    1.1.13release notes

  • Responses API conversion now handles content blocks that lack a type key.

    1.1.13release notes

  • Usage metadata token extraction now uses is-not-None checks.

    1.1.13release notes

  • A user-provided User-Agent can override the Azure default.

    1.1.13release notes

  • Missing ModelProfile fields were added, and schema drift now produces a warning.

    1.1.12release notes

  • Streaming function_call chunks now preserve the namespace field.

    1.1.12release notes

  • Responses API input items now include type: message.

    1.1.12release notes

  • PIL Image handles are closed during token counting to prevent a file descriptor leak.

    1.1.12release notes

  • Valid responses that are falsy at runtime are now accepted.

    1.1.11release notes

  • File URL inputs accommodate breaking changes, with CSV called out in the change.

    1.1.11release notes

  • Model detection for the Responses API is updated to handle pro and codex models.

    1.1.11release notes

  • Structured output avoids PydanticSerializationUnexpectedValue.

    1.1.11release notes

  • The error message for non-OpenAI embedding providers was enhanced.

    1.1.10release notes

  • A model property was added.

    1.1.10release notes

  • The error message for null choices in OpenAI-compatible APIs was improved.

    1.1.10release notes

  • The gpt-5.2-pro Model Profile structured_output key was fixed.

    1.1.10release notes

  • Codex models are now detected for Responses API preference.

    1.1.8release notes

  • Structured output refusals now raise the proper OpenAIRefusalError.

    1.1.7release notes

  • The Responses API now handles empty assistant content.

    1.1.7release notes

  • Token counting now handles function_call content.

    1.1.7release notes

  • Token counting now filters function_call blocks.

    1.1.7release notes

  • Relies on langchain-core for setting chunk_position.

    1.1.5release notes

  • Reverts the switch from nano to mini when using flex.

    1.1.4release notes

  • Corrects the aspect ratio caps used when resizing images.

    1.1.3release notes

  • Handles responses API content blocks that lack a text key.

    1.1.3release notes

  • Allows temperature when reasoning is set to the string 'none'.

    1.1.2release notes

  • Fixes an error when using the Responses API with built-in tools and custom tools.

    1.1.1release notes

  • GPT-5 temperature validation is now case-insensitive.

    1.1.0release notes

  • create_agent and response_format are fixed for the Responses API.

    1.0.3release notes

  • Embedding requests respect the API's 300k token limit.

    1.0.3release notes

  • Backward compatibility for response_format is fixed.

    1.0.3release notes

  • The response.incomplete event is handled when using stream_mode=['messages'].

    1.0.3release notes

  • Conditionally skips stream_usage in chat completions when OPENAI_BASE_URL is set.

    1.0.0release notes