AI Gateway has a unified fast mode abstraction, now in beta.
You can now request fast mode the same way for every model on AI Gateway. Set speed to fast , and the gateway serves the fast tier when it's available and falls back to standard speed when it isn't.
Fast mode trades a higher per-token cost for lower latency or higher throughput. You get it wherever it is available, without pinning a provider or wiring anything up yourself.
Copy link to heading Requesting fast mode
Set speed to fast under providerOptions.gateway to upgrade the model to its fast serving path when one is routable:
import { generateText } from 'ai' ;
const { text , providerMetadata } = await generateText ( {
model : 'anthropic/claude-opus-5' ,
prompt : 'Explain quantum computing in two sentences.' ,
providerOptions : {
gateway : {
speed : 'fast' ,
} ,
} ,
} ) ;
console . log ( 'Served speed:' , providerMetadata ?. gateway ?. routing ?.…