Skip to content
Dashboard

Model fallbacks now available in Vercel AI Gateway

import { streamText } from 'ai';
const result = streamText({
model: 'openai/gpt-oss-120b', // Primary model
prompt: 'Parse the attached PDF for tables and graphs, \
and return the highest performing categories this year',
providerOptions: {
gateway: {
models: [
'google/gemini-2.5-pro',
'anthropic/claude-sonnet-4.5',
'meta/llama-3.1-8b'
], // Fallback models
},
},
})

import { streamText } from 'ai';
const result = streamText({
model: 'openai/gpt-5-nano', // Primary model
prompt: 'Parse the attached PDF for tables and graphs, \
and return the highest performing categories this year',
providerOptions: {
gateway: {
order: ['vertex', 'cerebras'], // Provider routing order
models: [
'google/gemini-2.5-flash',
'openai/gpt-oss-120b'
], // Fallback models
},
},
})

Ready to deploy?