LangChain (JS) with idapt
ChatOpenAI against idapt's compatible API: one configuration block, 200+ models.
- 1
Install
bashnpm i @langchain/openai - 2
Point it at idapt
tsimport { ChatOpenAI } from "@langchain/openai"; const model = new ChatOpenAI({ model: "openai/gpt-6-astra", apiKey: process.env.IDAPT_API_KEY, configuration: { baseURL: "https://idapt.app/api/openai/v1" }, }); - 3
Going further
tsconst 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.
GOOD TO KNOW
API keys and scopesOpenAI-compatible API referenceOpenRouter-compatible API referenceRate limits and errors