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
🧭

OpenRouter client with idapt

Found this helpful? Share it:

Set up OpenRouter client 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.

OpenRouter SDK

OpenRouter client with idapt

Change one URL: OpenRouter request shapes, provider routing, and model fallbacks keep working.

  1. 1

    Point it at idapt

    ts
    const reply = await fetch("https://idapt.app/api/openrouter/v1/chat/completions", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.IDAPT_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        model: "z-ai/glm-5.2",
        messages: [{ role: "user", content: "Three facts about ravens." }],
      }),
    }).then((r) => r.json());

    OpenRouter client libraries are plain HTTP clients: point theirs, or any fetch call, at the idapt path.

  2. 2

    Streaming

    ts
    body: JSON.stringify({
      model: "z-ai/glm-5.2",
      models: ["z-ai/glm-5.2", "qwen/qwen3.7-max"], // ordered fallback
      provider: { sort: "price", allow_fallbacks: true },
      messages: [{ role: "user", content: "Stream a haiku." }],
      stream: true,
    })

    models[] is an ordered fallback list; provider routing and suffixes ride on top of the OpenAI shape. Responses carry usage.cost.

  3. 3

    Going further

    ts
    body: JSON.stringify({
      model: "z-ai/glm-5.2:nitro", // speed-priority routing suffix
      messages: [{ role: "user", content: "Three facts about ravens." }],
    })

    Suffixes (:nitro, :floor, :online, :free, :thinking, :extended) change routing; key, credits, and keys endpoints manage keys with USD caps.

GOOD TO KNOW

API keys and scopesOpenAI-compatible API referenceOpenRouter-compatible API referenceRate limits and errorsSwitch from OpenRouter

MORE QUICKSTARTS

curl

curl

OpenAI SDK (JS)

Anthropic SDK

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.

🧭

OpenRouter-compatible API

Point OpenRouter client code at idapt: same wire shape, provider routing, model fallbacks, and key management included.

🔁

Switch from OpenRouter

Swap the OpenRouter base URL for idapt's. Provider routing, model fallbacks, and key management work the same way.

⚡

curl with idapt

curl examples for idapt's three compatible APIs: OpenAI chat completions, Anthropic messages, and OpenRouter completions with one key.

🔗

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.

🤖

Anthropic SDK with idapt

Point the Anthropic SDK (JS or Python) at idapt's Anthropic-compatible API and keep your Messages API code unchanged.

Up next

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.

Was this helpful?