xAIGrok STTGrok STT is xAI's speech-to-text model. It transcribes recorded audio into text across 25 languages, available through Vercel AI Gateway with the AI SDK. Your use subject to xAI's Terms & Privacy Policies.WebsocketsUse with AI GatewayView docs1import { experimental_streamTranscribe as streamTranscribe } from 'ai';2import { createGateway, gateway } from '@ai-sdk/gateway';3import { readFile } from 'node:fs/promises';4 5const modelId = 'xai/grok-stt';6 7// Mint this on your server, then send only the short-lived token to the client.8const { token } = await gateway.experimental_transcription.getToken({9 model: modelId,10});11const clientGateway = createGateway({ apiKey: token });12 13// Raw 24 kHz, 16-bit signed little-endian mono PCM audio.14const bytes = await readFile('audio.pcm');15const audio = new ReadableStream<Uint8Array>({16 start(controller) {17 controller.enqueue(new Uint8Array(bytes));18 controller.close();19 },20});21 22const result = streamTranscribe({23 model: clientGateway.transcription(modelId),24 audio,25 inputAudioFormat: { type: 'audio/pcm', rate: 24000 },26});27 28for await (const part of result.fullStream) {29 if (part.type === 'transcript-delta') {30 process.stdout.write(part.delta);31 }32}33 34console.log('\nFinal:', await result.text);Read docsOverviewAboutProvidersSimilarFAQMore models by xAIAllTextCodeAll Use CasesColumns (13)ModelContextLatencyThroughputInputOutputCacheWeb SearchCapabilitiesProvidersZDRNo TrainingRelease Datexai/grok-4.5500K1.4s67tps$2/M$6/MRead:$0.3/MWrite:—$5/K+ input costs+307/08/2026xai/grok-build-0.1256K0.6s133tps$1/M$2/MRead:$0.2/MWrite:—$5/K+ input costs+205/20/2026xai/grok-4.31M1.0s222tps$1.25/M$2.50/MRead:$0.2/MWrite:—$5/K+ input costs+304/30/2026xai/grok-4.20-non-reasoning2M0.3s247tps$1.25/M$2.50/MRead:$0.2/MWrite:—$5/K+ input costs+203/10/2026xai/grok-4.1-fast-non-reasoning1M0.3s126tps$0.20/M$0.50/MRead:$0.05/MWrite:——+111/19/2025xai/grok-4.1-fast-reasoning1M1.4s156tps$0.20/M$0.50/MRead:$0.05/MWrite:——+211/19/2025