Skip to main content
idapt
AccueilModèles IATarifs
Sign inStart free

OpenAI SDK (JS) with idapt

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

Last reviewed 2026-07-17

Install

bash
npm i openai

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." }],
});

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 ?? "");
}

Pitfalls

Everything else stays the same

Responses, embeddings, images, and audio ride the same compatible surface; only the base URL and model ids change.

References

  • API keys and scopes
  • OpenAI-compatible API reference
  • Rate limits and errors

More quickstarts

OpenAI SDK (Python)Vercel AI SDKcurl
  • Accueil
  • Tarifs
  • Modèles IA
  • Modèles d'image
  • Modèles de voix
  • Modèles vidéo
  • Classements
  • New models
  • Model status
  • Multi-Model Chat
  • Voice Mode
  • Voice HUD
  • Web Search
  • Image Generation
  • Video Generation
  • Audio Generation
  • Transcription
  • Drive
  • Secrets
  • Sharing
  • Workspaces
  • Tasks
  • Memory
  • Agents
  • Subagents
  • Automations
  • Skills
  • Code Execution
  • Computers
  • Computer Use
  • Cloud Computers
  • Local AI
  • AI Gateway
  • API & SDK
  • CLI
  • MCP
  • Tunnels
  • All features →
  • Blog
  • Cas d'usage
  • Comparisons
  • Best of
  • Learn
  • Free tools
  • Prompts
  • Templates
  • Changelog
  • Centre d'aide
  • FAQ
  • Confidentialité
  • Comparer tous les modèles
  • Support
  • Développeurs
  • Quickstarts
  • Référence API
  • Tarifs API
  • CLI
  • MCP
  • Downloads
  • Desktop
  • Badges and embeds
© idapt[email protected]ConditionsPolitique de confidentialitéMentions légalesSignaler un contenu
X (Twitter)