LangChain (JS) with idapt
ChatOpenAI against idapt's compatible API: one configuration block, 200+ models.
Last reviewed 2026-07-17
Install
bash
npm i @langchain/openaiPoint it at idapt
ts
import { ChatOpenAI } from "@langchain/openai";
const model = new ChatOpenAI({
model: "openai/gpt-5.6-sol",
apiKey: process.env.IDAPT_API_KEY,
configuration: { baseURL: "https://idapt.app/api/openai/v1" },
});Going further
ts
const withTools = model.bindTools([myTool]);
const reply = await withTools.invoke("What is 23 * 17? Use the calculator.");Tool calling passes through for every tool-capable catalog model.
Pitfalls
baseURL goes inside configuration
ChatOpenAI nests the base URL under the configuration object; a top-level baseURL field is silently ignored.