Skip to main content
idapt
HomeAI ModelsExploreResourcesPricing
Sign inUse for Free
HomeDevelopersAI Gateway quickstartsOpenAI SDK (JS)

OpenAI SDK (JS) with idapt

The canonical three-line diff: baseURL, key, model id.

  1. 1

    Install

    bash
    npm i openai
  2. 2

    Point it at idapt

    ts
    import OpenAI from "openai";
    
    const client = new OpenAI({
      baseURL: "https://idapt.app/api/openai/v1",
      apiKey: process.env.IDAPT_API_KEY,
    });
    
    const reply = await client.chat.completions.create({
      model: "deepseek/deepseek-v4-flash",
      messages: [{ role: "user", content: "Three facts about ravens." }],
    });
  3. 3

    Streaming

    ts
    const stream = await client.chat.completions.create({
      model: "deepseek/deepseek-v4-flash",
      messages: [{ role: "user", content: "Stream a haiku." }],
      stream: true,
    });
    for await (const part of stream) {
      process.stdout.write(part.choices[0]?.delta?.content ?? "");
    }

GOOD TO KNOW

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

MORE QUICKSTARTS

OpenAI SDK (Python)

Vercel AI SDK

Vercel AI SDK

curl

curl

  • 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