Skip to content
rawroute

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

  1. Install @rawroute/ai-sdk alongside ai in your TypeScript or Next.js project.
  2. Set RAWROUTE_API_KEY in .env.local (base URL defaults to https://api.rawroute.dev/v1).
  3. 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

ModelModel IDOfficialOpenRouter +5.5%rawroute (0%)Providers
Claude Sonnet 5.5claude-sonnet-5-5$2.00 / $10.00$2.11 / $10.55$1.00 / $5.004
GPT-6.2 Solgpt-6.2-sol$2.00 / $10.00$2.11 / $10.55$0.60 / $3.003
Nano Banana 2gemini-3.1-flash-image$0.067—$0.0354
Veo 3.1veo-3.1$0.40—$0.094–$0.1413

When NOT to use rawroute

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.