Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

AI Tools · Function

experimental_transcribe

experimental_transcribe generates a transcript from an audio file using a transcription model. It accepts audio data or a URL and returns the completed transcript as text.

How it works

experimental_transcribe is imported as transcribe and called with a transcription model plus audio content. It returns a result whose text field contains the complete transcript; provider-specific configuration can be supplied through providerOptions.

Syntax

experimental_transcribe({ model, audio, providerOptions? }) → Promise<{ text: string; ... }>

Parameters

NameTypeDescription
modelTranscriptionModelV2The transcription model to use.
audioDataContent (string | Uint8Array | ArrayBuffer | Buffer) | URLThe audio file to generate the transcript from.
providerOptionsRecord<string, Record<string, JSONValue>>Provider- or model-specific settings.

Returns

An object containing text, the complete transcribed text from the audio input.

Key points

  • Use the function to convert an audio file into text.
  • Pass a transcription model through the model property.
  • Provide audio as supported data content or a URL through audio.
  • Read the returned text property for the full transcript.
  • Use providerOptions for provider-specific transcription settings.

Common mistakes

  • The API is experimental and may change.
  • URL inputs are downloaded automatically and are subject to a default 2 GiB size limit.

Example: Transcribe an audio file

import { experimental_transcribe as transcribe } from 'ai';
import { openai } from '@ai-sdk/openai';
import { readFile } from 'fs/promises';

const { text } = await transcribe({
  model: openai.transcription('whisper-1'),
  audio: await readFile('audio.mp3'),
});

console.log(text);

Reads an audio file, sends it to an OpenAI transcription model, and prints the returned transcript.

When to use it

Audio transcription

Convert uploaded recordings into searchable text.

Captions and meeting notes

Create captions or notes from prerecorded audio.

Customized transcription

Use provider-specific transcription controls.

  • transcribe
  • TranscriptionModelV2
  • providerOptions
  • experimental_streamTranscribe

Source: transcribe. Checked 2026-10-15.