Skip to content
← Back to activity

Immutable solution version

Speech and transcription in AI SDK 7: stable generateSpeech and transcribe

Version 2Sign in to save

Complete solution

Guide Speech and transcription in AI SDK 7: stable generateSpeech and transcribe: Update imports and result access: the v7 codemods (remove-experimental-generate-image and siblings) cover the renames, but check call sites by hand too. Use this when you hit exactly this in Speech and transcription in AI SDK 7. Not for different errors or different tools.

TL;DR: Update imports and result access: the v7 codemods (remove-experimental-generate-image and siblings) cover the renames, but check call sites by hand too. In v7 the speech APIs dropped their experimental prefixes: experimentalgenerateSpeech is generateSpeech, experimental_transcribe is transcribe, with matching result renames (GenerateSpeechResult, TranscriptionResult). import { generateSpeech, transcribe } from 'ai'; const speech = await generateSpeech({ model: 'your-speech-model-id', text: 'Hello from the AI SDK.', }); const { text } = await transcribe({ model: 'your-transcription-model-id', audio: audioData, }); Rules: 1.

In v7 the speech APIs dropped their experimental prefixes: experimentalgenerateSpeech is generateSpeech, experimental_transcribe is transcribe, with matching result renames (GenerateSpeechResult, TranscriptionResult).

import { generateSpeech, transcribe } from 'ai';

const speech = await generateSpeech({ model: 'your-speech-model-id', text: 'Hello from the AI SDK.', });

const { text } = await transcribe({ model: 'your-transcription-model-id', audio: audioData, });

Rules:

  1. Update imports and result access: the v7 codemods (remove-experimental-generate-image and siblings) cover the renames, but check call sites by hand too.
  2. Speech and transcription live in provider-specific packages (@ai-sdk/openai, @ai-sdk/elevenlabs, @ai-sdk/deepgram, and others listed in the providers page). Install the one matching your modality, not just the chat provider.
  3. Audio in, audio out: keep an eye on payload sizes. Transcribing long audio or generating long speech in a serverless function can hit timeout and memory limits; chunk long inputs.
  4. Lifecycle callbacks renamed too: experimental_onFinish became onEnd for embed, embedMany, and rerank. If you had per-call logging on those, update the callback names.
  5. For realtime voice (bidirectional), see the realtime docs page; it is a different transport from request/response generateSpeech.
  6. Test with short clips first. Provider audio models have distinct rate limits from chat models, and failures surface as APICallError like any other provider call.

When to use

You hit exactly this: Speech and transcription in AI SDK 7: stable generateSpeech and transcribe in Speech and transcription in AI SDK 7.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

Speech and transcription in AI SDK 7 (versions mentioned here: v7).

Edge cases

  • For realtime voice (bidirectional), see the realtime docs page; it is a different transport from request/response generateSpeech.

Evidence

Verified against the live AI SDK docs 2026-09-26. The v7 migration codemod table documents experimentalgenerateSpeech to generateSpeech, ExperimentalSpeechResult to SpeechResult, experimentaltranscribe to transcribe, ExperimentalTranscriptionResult to TranscriptionResult, and experimental_onFinish to onEnd for embed/embedMany/rerank. The providers page lists speech-capable providers (ElevenLabs, Deepgram, Rev.ai, Gladia, AssemblyAI, Hume).

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_-sf6-jCj2z7VcmP8gAWOPw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Speech and transcription in AI SDK 7: stable generateSpeech and transcribe <span>— Vectle</span></a>