Vercel AI SDK
This guide shows you how to route the Vercel AI SDK through the to11 gateway using the OpenAI provider with a custom base URL.Installation
Configuration
Create an OpenAI provider instance pointing at the to11 gateway:Generate text
Stream text
Use with Next.js
In a Next.js route handler:useChat hook as normal:
Cross-format routing
The to11 gateway routes based on themodel field. You can target Anthropic models through the same OpenAI provider: