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
🔗

Vercel AI SDK with idapt

Found this helpful? Share it:

Set up Vercel AI SDK 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.

Vercel AI SDK

Vercel AI SDK with idapt

The OpenRouter provider package pointed at idapt: 200+ models, effort control, usage cost in the response.

  1. 1

    Install

    bash
    npm i ai @openrouter/ai-sdk-provider
  2. 2

    Point it at idapt

    ts
    import { createOpenRouter } from "@openrouter/ai-sdk-provider";
    
    const openrouter = createOpenRouter({
      apiKey: process.env.IDAPT_API_KEY,
      baseURL: "https://idapt.app/api/openrouter/v1",
    });
    
    const model = openrouter("anthropic/claude-sonnet-5");

    Model ids are catalog slugs. The provider package speaks the OpenRouter dialect, so reasoning effort and usage cost flow through natively.

  3. 3

    Streaming

    ts
    import { streamText } from "ai";
    
    const result = streamText({
      model,
      prompt: "Summarize this repo's README in three bullets.",
      providerOptions: {
        openrouter: { extraBody: { reasoning: { effort: "high" } } },
      },
    });
    for await (const chunk of result.textStream) process.stdout.write(chunk);

GOOD TO KNOW

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

MORE QUICKSTARTS

OpenAI SDK (JS)

LLM CLI

LiteLLM

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.

🔗

OpenAI SDK (JS) with idapt

Point the official OpenAI Node SDK at idapt's compatible API: a three-line change routes 200+ models through your existing code.

🔗

LangChain (JS) with idapt

Use LangChain JS with idapt: configure ChatOpenAI with a custom base URL and route any catalog model, tools included.

🔗

LiteLLM with idapt

Configure LiteLLM to route through idapt's OpenAI-compatible API: SDK call and proxy config.yaml forms, one key for 200+ models.

Up next

LangChain (JS) with idapt

Use LangChain JS with idapt: configure ChatOpenAI with a custom base URL and route any catalog model, tools included.

Was this helpful?