Vercel AI SDK with idapt
The OpenRouter provider package pointed at idapt: 200+ models, effort control, usage cost in the response.
- 1
Install
bashnpm i ai @openrouter/ai-sdk-provider - 2
Point it at idapt
tsimport { 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
Streaming
tsimport { 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