Use Vercel AI SDK with the LLM gateway
The Vercel AI SDK lets you ship streaming AI features in minutes. Plug it into the
gateway and the same generateText,
streamText, and tool calls fan out across
providers, at the lowest possible cost.
4 models routed through the gateway over the last 30 days.
Why use the Vercel AI SDK with the gateway
The Vercel AI SDK accepts any OpenAI-compatible endpoint via
createOpenAI. The gateway is that endpoint,
but instead of one provider, it gives you many, with smart routing and one bill.
- Drop-in: a single createOpenAI call
- Streaming, tool calls, and structured output all pass through unchanged
- Use "auto" to let the gateway pick the right model
- Or pin a specific model when you need consistency
- Per-app and per-feature spend caps from the gateway dashboard
- Cost, latency, and token tracking out of the box
Setup in 60 seconds
Initialize the SDK with the gateway baseURL
and API key. The rest of your Vercel AI SDK code stays the same.
Install the SDK and create an OpenAI-compatible client pointing at the gateway:
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";
const manifest = createOpenAI({
baseURL: "https://api.manifest.build/v1",
apiKey: "mnfst_YOUR_KEY",
});
const { text } = await generateText({
model: manifest("auto"),
prompt: "Hello",
});
Install the Python AI SDK and wire it to the gateway endpoint:
# pip install ai-sdk
from ai_sdk import AIClient
client = AIClient(
base_url="https://api.manifest.build/v1",
api_key="mnfst_YOUR_KEY",
)
response = client.generate_text(
model="auto",
prompt="Hello",
)
https://api.manifest.build/v1
mnfst_YOUR_KEY
auto
Vercel AI SDK tokens processed by the gateway
Models in use
# Model |
Auth type | Tokens / last 30 days |
|---|---|---|
1.Deepseek V4 Flash | API Key | 456 K |
2.Kilo Auto Free | API Key | 16 K |
3.Claude Sonnet 4 6 | Subscription | 12 K |
4.Claude Haiku 4 5 20251001 | Subscription | 4 K |