langchain_openai.Chat[OI]
Native [OI] supportLangChain with a custom [OI] base URL
LangChain's [OI] integration is an [OI] client underneath. Pass base_url (Python) or configuration.baseURL (JS) and the rest of your chain is unchanged.
Base URL
https://uncensoredai.dev/v1
- 01
Python
Set base_url and api_key on Chat[OI]. Agents, tools and structured output treat it as a normal [OI] model.
pythonfrom langchain_openai import Chat[OI] llm = Chat[OI]( model="deepseek-v4.1-flash", base_url="https://uncensoredai.dev/v1", api_key="sk-ua-XXXX-XXXX-XXXX-XXXX", ) - 02
JavaScript / TypeScript
With @langchain/openai the endpoint nests under configuration.baseURL.
typescriptimport { Chat[OI] } from "@langchain/openai"; const llm = new Chat[OI]({ model: "deepseek-v4.1-flash", apiKey: process.env.UNCENSOREDAI_API_KEY, configuration: { baseURL: "https://uncensoredai.dev/v1" }, });
FAQ
Which base URL do I pass to Chat[OI]?+
https://uncensoredai.dev/v1 — the SDK appends /chat/completions automatically.
Do LangChain tools and function calling work?+
Yes on models that support the tools array. Use a reasoning tier for reliable tool loops.
