Menu

1 / 3

xAI Grok audio models now available on Vercel AI Gateway - Vercel

Vercel News·Kevin Dawkins·5 days ago
#TcbnrN1q
#vercel#gateway#voice#grok#token
Reading 0:00
15s threshold

xAI's audio models are now live on AI Gateway. Realtime voice, text to speech, and speech to text are all available through the AI SDK with the same routing, observability, and spend controls as your other models.

These capabilities are available on the AI SDK 7 release.

npm install ai @ai-sdk/react @ai-sdk/gateway

Copy link to heading Available models

Copy link to heading Realtime

A voice agent has two pieces: a server route that mints a short-lived token, so your API key never reaches the client, and a browser component that connects with it.

Add the token route: this example sets model to xai/grok-voice-think-fast-1.0 :

app/api/realtime/token/route.ts

import { gateway } from '@ai-sdk/gateway' ;

export async function POST ( ) {

const { token , url } = await gateway . experimental_realtime . getToken ( {

model : 'xai/grok-voice-think-fast-1.0' ,

} ) ;

return Response . json ( { token , url , tools : [ ] } ) ;

}

Then connect from the browser.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.