Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/phpaisdk/fal/llms.txt

Use this file to discover all available pages before exploring further.

FalTranscriptionModel sends audio to {baseUrl}/{modelId} (defaulting to https://fal.run/{modelId}) as either a remote URL or a base64-encoded data URI, and returns a TranscriptionResponse containing the transcript text. The provider inspects the audio source automatically — if the source is a URL it is forwarded directly; if it is inline data it is encoded as a data URI — so both input types use the same audio_url field in the request body.

Transcribe from URL

use AiSdk\Generate;
use AiSdk\Fal;

$result = Generate::transcription()
    ->model(Fal::model('fal-ai/wizper'))
    ->audioUrl('https://example.com/sample.mp3')
    ->run();

echo $result->transcript->text;

Transcribe from a Data URI

When the audio source is inline base64 data (a data URI), the SDK encodes it appropriately and sends it as the same audio_url field. No change is required in the way you call run() — the provider handles the difference transparently:
$result = Generate::transcription()
    ->model(Fal::model('fal-ai/wizper'))
    ->audioData($rawAudioBytes, 'audio/mp3')
    ->run();

echo $result->transcript->text;

Request Parameters

The following fields are sent as JSON to the fal.ai endpoint:
FieldTypeDescription
audio_urlstringThe remote URL or the base64 data URI of the audio to transcribe.
Additional fields from $request->providerOptionsFor('fal') are merged into the body, allowing you to pass model-specific parameters such as language hints or timestamps settings.
$result = Generate::transcription()
    ->model(Fal::model('fal-ai/wizper'))
    ->audioUrl('https://example.com/sample.mp3')
    ->providerOptions('fal', ['language' => 'en', 'task' => 'transcribe'])
    ->run();

Response

transcribe() returns a TranscriptionResponse with a transcript property of type TranscriptData:
  • text (string) — the full transcript text, taken from the text field of the fal.ai response body.
$result = Generate::transcription()
    ->model(Fal::model('fal-ai/wizper'))
    ->audioUrl('https://example.com/sample.mp3')
    ->run();

echo $result->transcript->text;
Transcription is synchronousFalTranscriptionModel performs a single POST request and returns the result immediately with no polling loop. The transcriptionPollTimeoutMs property exists in FalOptions but is not used by the current FalTranscriptionModel implementation. See Configuration Options for the full list of available options.

Build docs developers (and LLMs) love