LangChain

Integration status
  • Recommended protocol: OpenAI Chat Completions
  • Configuration checked: July 15, 2026 (official LangChain OpenAI integration documentation)
  • Runtime verification: Pending
import os
from langchain_openai import ChatOpenAI

model = ChatOpenAI(
    model="MODEL_ID",
    api_key=os.environ["GETROUTER_API_KEY"],
    base_url="https://getrouter.ai/v1",
)
print(model.invoke("Say connected").content)

Validate invoke, streaming, structured output, tools, and agents in that order. When an abstraction fails, reproduce the request with the underlying SDK first.