Skip to main content
The AI SDK gives you a single, unified transcribe() API that works across speech-to-text providers. The @ai-sdk/assemblyai provider — maintained by Vercel in the vercel/ai repo — plugs AssemblyAI’s speech models into that API, so you can transcribe audio in any TypeScript or JavaScript project without calling the AssemblyAI API directly.

Quickstart

Install the AI SDK core package along with the AssemblyAI provider:
You’ll need an AssemblyAI account and an API key from your dashboard. The provider reads it from the ASSEMBLYAI_API_KEY environment variable:
Then transcribe a local file with transcribe():
transcribe is a stable export as of AI SDK v7, which is what npm install ai installs today. The examples on this page target v7.
Using AI SDK v6? The examples on this page require v7. AI SDK v6 (and v5) export only experimental_transcribeimport { transcribe } from 'ai' throws on those versions — and the latest provider (@ai-sdk/assemblyai 3.x) is built for v7, so it won’t work against v6. If your project is on v6 (for example, an existing project or a registry policy that hasn’t picked up v7 yet), install the v6-compatible packages and alias the experimental export:
Everything else on this page — the providerOptions, model IDs, and result shape — is the same.

Configuring the provider

The default assemblyai instance reads your key from ASSEMBLYAI_API_KEY. To pass the key explicitly — for example, from a secret manager or in a multi-tenant setup — or to add custom headers or a custom fetch implementation, create your own provider instance with createAssemblyAI:

Choosing a speech model

universal-3-5-pro is the recommended default. universal-2 is also supported. Pass the model ID to assemblyai.transcription():
For a breakdown of each model’s accuracy, latency, and language support, see Select the speech model.

Using AssemblyAI features

AssemblyAI’s diarization and audio-intelligence features are enabled through providerOptions.assemblyai. Option keys are the camelCase equivalents of the API’s snake_case parameters (for example, speaker_labelsspeakerLabels, redact_piiredactPii):
Annotating the options object with satisfies AssemblyAITranscriptionModelOptions gives you editor autocomplete and type-checking for the full option set, so you don’t have to memorize parameter names or hunt through docs.
The table below reflects @ai-sdk/assemblyai 3.0.5. For the always-current list — including any options added in newer releases — see the @ai-sdk/assemblyai provider reference, which lives alongside the provider code and is the canonical source.

Transcription options

Every option below is optional and passed under providerOptions.assemblyai. Types and behavior follow the AssemblyAI transcription API.

Getting the full results back

transcribe() returns a provider-agnostic result, but AssemblyAI’s richer output — utterances, entities, sentiment, and more — is preserved, so you don’t lose anything by going through the AI SDK:
  • Top-level fields like result.text, result.segments, and result.durationInSeconds are normalized across providers.
  • result.providerMetadata.assemblyai holds AssemblyAI-specific results such as utterances, entities, and sentimentAnalysisResults.
  • result.response.body is the complete, raw AssemblyAI transcript object.
Timestamps use different units depending on where you read them. The top-level result.segments are in seconds (the AI SDK’s normalized format), while every timing inside result.providerMetadata.assemblyai and result.response.body is in milliseconds (AssemblyAI’s native format). Convert accordingly when you combine the two.

Additional resources