Text, image, and video. Route to hundreds of AI models through a centralized interface.
import { streamText } from 'ai'
const result = streamText({
model: 'openai/gpt-5.5',
prompt: 'Why is the sky blue?'
})Use it with
Routing, billing, and observability in one place
Use a single API key and dashboard to access models, track spend, and keep workloads resilient.
Unified billing and observability across your entire AI stack, with text, image, and video models.
Automatic fallbacks during provider outages so your app stays up even when a model goes down.
Pay exactly what providers charge with no platform fees.
OpenAI
Vercel is a cloud platform for deploying and hosting websites, apps, and serverless functions with speed, scalability, and simplicity. It gives teams one workflow from development to global delivery, so products ship faster while keeping reliability and performance high across every request. With robust developer tooling and seamless integrations, Vercel enables engineering teams to collaborate efficiently and manage code from preview to production. Its edge network and automatic scaling help you serve users globally with minimal latency and maximum uptime, so you can focus on building great products while Vercel handles infrastructure, deployments, and optimizations to ensure a fast, consistent user experience at scale.
Vercel is a cloud platform for deploying and hosting websites, apps, and serverless functions with speed, scalability, and simplicity. It gives teams one workflow from development to global delivery, so products ship faster while keeping reliability and performance high across every request. With robust developer tooling and seamless integrations, Vercel enables engineering teams to collaborate efficiently and manage code from preview to production. Its edge network and automatic scaling help you serve users globally with minimal latency and maximum uptime, so you can focus on building great products while Vercel handles infrastructure, deployments, and optimizations to ensure a fast, consistent user experience at scale.
xAI
Vercel is a cloud platform for deploying and hosting websites, apps, and serverless functions with speed, scalability, and simplicity. It gives teams one workflow from development to global delivery, so products ship faster while keeping reliability and performance high across every request. With robust developer tooling and seamless integrations, Vercel enables engineering teams to collaborate efficiently and manage code from preview to production. Its edge network and automatic scaling help you serve users globally with minimal latency and maximum uptime, so you can focus on building great products while Vercel handles infrastructure, deployments, and optimizations to ensure a fast, consistent user experience at scale.
OpenAI
Vercel is a cloud platform for deploying and hosting websites, apps, and serverless functions with speed, scalability, and simplicity. It gives teams one workflow from development to global delivery, so products ship faster while keeping reliability and performance high across every request. With robust developer tooling and seamless integrations, Vercel enables engineering teams to collaborate efficiently and manage code from preview to production. Its edge network and automatic scaling help you serve users globally with minimal latency and maximum uptime, so you can focus on building great products while Vercel handles infrastructure, deployments, and optimizations to ensure a fast, consistent user experience at scale.
This quickstart walks you through making your first text generation request with AI Gateway.
Set Up Your Project
mkdir ai-text-democd ai-text-demopnpm initInstall Dependencies
npm install ai dotenv @types/node tsx typescriptSet Up Your API Key
Create a .env.local file and save your API Key.
AI_GATEWAY_API_KEY=your_ai_gateway_api_keyCreate and Run Your Script
index.ts file.import { streamText } from 'ai';import 'dotenv/config';
async function main() { const result = streamText({ model: 'openai/gpt-5.5', prompt: 'Invent a new holiday and describe its traditions.', });
for await (const textPart of result.textStream) { process.stdout.write(textPart); }
console.log(); console.log('Token usage:', await result.usage); console.log('Finish reason:', await result.finishReason);}
main().catch(console.error);Run your script.
pnpm tsx index.tsYou should see the AI model’s response stream to your terminal.
Next Steps
Yes! When you sign up for a Vercel account, you get $5 of credits every 30 days to try out any model from our model list. We don’t restrict access to premium models.
Note: After you make your first payment, you are considered a paid customer and will no longer receive the free credits.
We offer tokens at list price from the upstream providers with no markup.
If you bring your own key, we will not add any markup to your token price (0%).
You are responsible for any payment processing fees.
While the upstream providers may have limits, Vercel doesn’t place any rate limits on your queries.
We are constantly working with the upstream providers to get you the maximum limits, throughput and reliability.
We have over a hundred models from a range of providers to give you the maximum flexibility.
See the full model list here.
Ready to deploy? Start building with a free account. Speak to an expert for your Pro or Enterprise needs.
Trial Vercel with higher execution, increased app bandwidth, Speed Insights, team features, and more.