Skip to content
Dashboard

Grok STT

Grok 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.

Websockets
index.ts
import { experimental_streamTranscribe as streamTranscribe } from 'ai';
import { createGateway, gateway } from '@ai-sdk/gateway';
import { readFile } from 'node:fs/promises';
const modelId = 'xai/grok-stt';
// Mint this on your server, then send only the short-lived token to the client.
const { token } = await gateway.experimental_transcription.getToken({
model: modelId,
});
const clientGateway = createGateway({ apiKey: token });
// Raw 24 kHz, 16-bit signed little-endian mono PCM audio.
const bytes = await readFile('audio.pcm');
const audio = new ReadableStream<Uint8Array>({
start(controller) {
controller.enqueue(new Uint8Array(bytes));
controller.close();
},
});
const result = streamTranscribe({
model: clientGateway.transcription(modelId),
audio,
inputAudioFormat: { type: 'audio/pcm', rate: 24000 },
});
for await (const part of result.fullStream) {
if (part.type === 'transcript-delta') {
process.stdout.write(part.delta);
}
}
console.log('\nFinal:', await result.text);

More models by xAI

Model
Context
Latency
Throughput
Input
Output
Cache
Web Search
Capabilities
Providers
ZDR
No Training
Release Date
500K
1.9s
57tps
$2/M
$6/M
Read:
$0.3/M
Write:
$5/K
+ input costs
+3
xai logo
07/08/2026
256K
0.5s
129tps
$1/M
$2/M
Read:
$0.2/M
Write:
$5/K
+ input costs
+2
xai logo
05/20/2026
1M
0.9s
121tps
$1.25/M
$2.50/M
Read:
$0.2/M
Write:
$5/K
+ input costs
+3
vertex logo
xai logo
04/30/2026
2M
0.3s
63tps
$1.25/M
$2.50/M
Read:
$0.2/M
Write:
$5/K
+ input costs
+2
vertex logo
xai logo
03/10/2026
1M
0.5s
179tps
$0.20/M
$0.50/M
Read:$0.05/M
Write:
+1
vertex logo
11/19/2025
1M
1.7s
49tps
$0.20/M
$0.50/M
Read:$0.05/M
Write:
+2
vertex logo
11/19/2025