Use rawroute with Vercel AI SDK. First-class provider for chat, images, video & speech.
Our @rawroute/ai-sdk package implements the Vercel AI SDK provider interface for chat streaming, tool calling, structured outputs, and image generation—plus typed generateRawrouteVideo and generateRawrouteSpeech helpers on one API key with 0% top-up fee.
Quick setup for Vercel AI SDK
- Install @rawroute/ai-sdk alongside ai in your TypeScript or Next.js project.
- Set RAWROUTE_API_KEY in .env.local (base URL defaults to https://api.rawroute.dev/v1).
- Call streamText({ model: rawroute("claude-sonnet-5-5"), ... }) with full type safety.
import { rawroute, generateRawrouteVideo } from "@rawroute/ai-sdk"
import { streamText } from "ai"
const { textStream } = streamText({
model: rawroute("claude-sonnet-5-5"),
prompt: "Write a PostgreSQL migration for API key spend caps.",
})
const video = await generateRawrouteVideo({
model: "veo-3.1",
prompt: "Macro shot of rain droplets on neon glass at night",
baseURL: "https://api.rawroute.dev",
})Recommended models for Vercel AI SDK
| Model | Model ID | Official | OpenRouter +5.5% | rawroute (0%) | Providers |
|---|---|---|---|---|---|
| Claude Sonnet 5.5 | claude-sonnet-5-5 | $2.11 / $10.55 | $1.00 / $5.00 | 4 | |
| GPT-6.2 Sol | gpt-6.2-sol | $2.11 / $10.55 | $0.60 / $3.00 | 3 | |
| Nano Banana 2 | gemini-3.1-flash-image | — | $0.035 | 4 | |
| Veo 3.1 | veo-3.1 | — | $0.094–$0.141 | 3 |
When NOT to use rawroute
- — If you prefer zero extra packages, @ai-sdk/openai-compatible pointed at https://api.rawroute.dev/v1 also works immediately.
FAQ
Does @rawroute/ai-sdk work on Next.js Edge and Node.js runtimes?
Yes. It uses standard Web Fetch APIs with zero native Node bindings, so it runs on Node.js, Edge, Cloudflare Workers, and Bun.