vercel/ai · error · Error
Google Generative AI API key is required for streaming trans
Error message
Google Generative AI API key is required for streaming transcription.
What it means
Error "Google Generative AI API key is required for streaming transcription." thrown in vercel/ai.
Source
Thrown at packages/google/src/transcription/google-transcription-model.ts:269
const warnings: SharedV4Warning[] = [];
const googleOptions = await this.parseOptions(options.providerOptions);
validateLiveInputAudioFormat(options.inputAudioFormat);
const headers = combineHeaders(
this.config.headers ? await resolve(this.config.headers) : undefined,
options.headers,
);
// last case-variant wins: combineHeaders keeps case-distinct keys and
// spreads per-call headers after configuration headers
let apiKey: string | undefined;
for (const [key, value] of Object.entries(headers)) {
if (key.toLowerCase() === 'x-goog-api-key' && value != null) {
apiKey = value;
}
}
if (apiKey == null) {
throw new Error(
'Google Generative AI API key is required for streaming transcription.',
);
}
const webSocketHeaders = Object.fromEntries(
Object.entries(headers).filter(
([key]) => key.toLowerCase() !== 'x-goog-api-key',
),
);
// NOTE: Google's GA announcement shows the setup with
// `generationConfig: { responseModalities: ['TEXT'] }`, but sending it
// suppresses the final `inputTranscription` segments on the current
// endpoint (only interim partials arrive). Omit generationConfig — the
// empirically working shape — until the endpoint honors the documented
// form.
const setup = {
model: getModelPath(this.modelId),
inputAudioTranscription:View on GitHub (pinned to 69428b1f8b)
When it happens
Trigger: Thrown at packages/google/src/transcription/google-transcription-model.ts:269 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/5bbb753fc87027b6.
Report an issue: GitHub.