Files
langchain/libs/partners/openrouter
Mason Daugherty 57c83d44bc fix(openrouter): strip Responses reasoning IDs (#38383)
Closes #37777

---

OpenRouter can return OpenAI Responses reasoning item IDs such as `rs_*`
in assistant reasoning details. Those IDs are not reliably resolvable on
a later OpenRouter turn, so replaying them can make otherwise-valid
multi-turn conversations fail with a provider 404.

This keeps the useful reasoning payload while removing only the
ephemeral Responses item IDs before serializing `reasoning_details` back
into request history. Non-Responses IDs and reasoning text are left
intact.
2026-06-23 12:26:24 -04:00
..
2026-06-22 23:42:48 -04:00

langchain-openrouter

PyPI - Version PyPI - License PyPI - Downloads Twitter

Quick Install

uv add langchain-openrouter

🤔 What is this?

This package contains the LangChain integration with OpenRouter, a unified API for hundreds of AI models across many providers.

📖 Documentation

For full documentation, see the API reference. For conceptual guides, tutorials, and examples on using these classes, see the LangChain Docs.

📕 Releases & Versioning

See our Releases and Versioning policies.

💁 Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

For detailed information on how to contribute, see the Contributing Guide.

Resources

  • LangChain Academy — comprehensive, free courses on LangChain libraries and products, made by the LangChain team
  • Code of Conduct — community guidelines and standards