Skip to main content
idapt
HomeAI ModelsExploreResourcesPricing
Sign inUse for Free
  • Home
  • Pricing
  • AI Models
  • Skills
  • Image models
  • Voice models
  • Video models
  • Rankings
  • Multi-Model Chat
  • Agents
  • Computers
  • Drive
  • Automations
  • AI Gateway
  • All features →
  • Blog
  • About
  • Comparisons
  • Benchmarks
  • Model Match
  • Demos
  • Help center
  • FAQ
  • Privacy
  • Support
  • Developers
  • Quickstarts
  • API reference
  • API pricing
  • CLI
  • MCP
  • Migrate
  • Downloads
  • Desktop
© idapt[email protected]TermsPrivacy PolicyLegal noticeReport content
X (Twitter)Discord
Help Center
🔗

LangChain (JS) with idapt

Found this helpful? Share it:

Set up LangChain (JS) against idapt's compatible APIs with the steps below. This article and the AI Gateway quickstarts lander render the same shared steps, so they never drift.

LangChain (JS)

LangChain (JS) with idapt

ChatOpenAI against idapt's compatible API: one configuration block, 200+ models.

  1. 1

    Install

    bash
    npm i @langchain/openai
  2. 2

    Point it at idapt

    ts
    import { 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. 3

    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.

GOOD TO KNOW

API keys and scopesOpenAI-compatible API referenceOpenRouter-compatible API referenceRate limits and errors

MORE QUICKSTARTS

LangChain (Python)

LangChain (Python)

Vercel AI SDK

Vercel AI SDK

LlamaIndex

Related articles

🔑

API keys and scopes

Create a key, choose its scopes, pin it to an API version, rotate it, and cap what it can spend.

🚦

Rate limits and errors

Every error shape the API returns, what each rate limit is, and how to handle a wall in code.

🛡️

Cap what an API key spends

Give every Gateway API key a lifetime, monthly, or daily USD cap, and what a capped-out key returns.

🔗

OpenAI-compatible API

Use idapt's 200+ models from any app that speaks the OpenAI API format.

🔗

LangChain (Python) with idapt

Use LangChain Python with idapt's OpenAI-compatible API: base_url configuration for ChatOpenAI with any catalog model.

🔗

Vercel AI SDK with idapt

Use the Vercel AI SDK with idapt's OpenAI-compatible API: provider setup, streaming, and tool calls with one base-URL swap.

🔗

LlamaIndex with idapt

Use LlamaIndex with idapt: configure the OpenAI-like client with a custom base URL and run retrieval pipelines on any catalog model.

Up next

LangChain (Python) with idapt

Use LangChain Python with idapt's OpenAI-compatible API: base_url configuration for ChatOpenAI with any catalog model.

Was this helpful?