AssemblyAI Universal-3 Pro·续
</details>
<details>
<summary>Speaker Diarization — Identify different speakers in the audio</summary>
const response = await env.AI.run(
'assemblyai/universal-3-pro',
{ audio_url: 'https://cdn.openai.com/API/docs/audio/onyx.wav', speaker_labels: true },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "assemblyai/universal-3-pro",
"input": {
"audio_url": "https://cdn.openai.com/API/docs/audio/onyx.wav",
"speaker_labels": true
}
}'
The train chugged along the tracks, carrying passengers to their destinations. The rhythmic sound of the wheels on the rails was soothing.
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"confidence": 0.99781793,
"language_code": "en",
"language_confidence": 0.9906,
"text": "The train chugged along the tracks, carrying passengers to their destinations. The rhythmic sound of the wheels on the rails was soothing.",
"utterances": [
{
"confidence": 0.99781793,
"end": 7719,
"speaker": "A",
"start": 32,
"text": "The train chugged along the tracks, carrying passengers to their destinations. The rhythmic sound of the wheels on the rails was soothing."
}
],
"words": [
{
"confidence": 0.9742124,
"end": 113,
"speaker": "A",
"start": 32,
"text": "The"
},
{
"confidence": 0.99997795,
"end": 403,
"speaker": "A",
"start": 177,
"text": "train"
},
{
"confidence": 0.99713653,
"end": 904,
"speaker": "A",
"start": 516,
"text": "chugged"
},
{
"confidence": 0.9999881,
"end": 1130,
"speaker": "A",
"start": 904,
"text": "along"
},
{
"confidence": 0.9999676,
"end": 1308,
"speaker": "A",
"start": 1227,
"text": "the"
},
{
"confidence": 0.9995983,
"end": 1808,
"speaker": "A",
"start": 1308,
"text": "tracks,"
},
{
"confidence": 0.9998933,
"end": 2341,
"speaker": "A",
"start": 2131,
"text": "carrying"
},
{
"confidence": 0.999992,
"end": 3068,
"speaker": "A",
"start": 2454,
"text": "passengers"
},
{
"confidence": 0.99999034,
"end": 3229,
"speaker": "A",
"start": 3100,
"text": "to"
},
{
"confidence": 0.9999908,
"end": 3423,
"speaker": "A",
"start": 3262,
"text": "their"
},
{
"confidence": 0.9992286,
"end": 4198,
"speaker": "A",
"start": 3423,
"text": "destinations."
},
{
"confidence": 0.99871373,
"end": 5119,
"speaker": "A",
"start": 5038,
"text": "The"
},
{
"confidence": 0.9999517,
"end": 5523,
"speaker": "A",
"start": 5184,
"text": "rhythmic"
},
{
"confidence": 0.99993813,
"end": 5926,
"speaker": "A",
"start": 5523,
"text": "sound"
},
{
"confidence": 0.99991894,
"end": 6007,
"speaker": "A",
"start": 5926,
"text": "of"
},
{
"confidence": 0.99993825,
"end": 6088,
"speaker": "A",
"start": 6007,
"text": "the"
},
{
"confidence": 0.99995935,
"end": 6459,
"speaker": "A",
"start": 6169,
"text": "wheels"
},
{
"confidence": 0.99997675,
"end": 6605,
"speaker": "A",
"start": 6556,
"text": "on"
},
{
"confidence": 0.99999475,
"end": 6718,
"speaker": "A",
"start": 6637,
"text": "the"
},
{
"confidence": 0.9999932,
"end": 7105,
"speaker": "A",
"start": 6718,
"text": "rails"
},
{
"confidence": 0.999851,
"end": 7299,
"speaker": "A",
"start": 7138,
"text": "was"
},
{
"confidence": 0.98378325,
"end": 7719,
"speaker": "A",
"start": 7299,
"text": "soothing."
}
]
},
"state": "Completed"
}
</details>
Parameters
audio_url
stringThe URL of the audio file to transcribe. Can be a publicly accessible URL or a data URI (data:audio/...;base64,...). For data URIs, the audio will be uploaded to AssemblyAI automatically. Required for pre-recorded transcription (when stream is false or not set).
websocket
booleanEnable real-time WebSocket streaming for live audio transcription. When true, a WebSocket connection is established instead of submitting a pre-recorded transcription job. Cannot be used with audio_url.
language_code
stringThe language code for the audio file (e.g., "en", "es", "fr"). Defaults to automatic language detection.
language_detection
booleanEnable automatic language detection. When enabled with speech_models, the system will automatically select the best model for the detected language.
prompt
stringA custom prompt to guide transcription style, formatting, and output characteristics. Maximum 1,500 words.
▶keyterms_prompt[]
arrayAn array of up to 1,000 words or phrases (max 6 words per phrase) to improve transcription accuracy. Cannot be used with the prompt parameter.
temperature
numberminimum: 0maximum: 1Controls randomness in model output (0.0-1.0). Lower values make output more deterministic. Default is 0.0.
speaker_labels
booleanEnable speaker diarization to identify different speakers in the audio.
speakers_expected
integerminimum: 1maximum: 9007199254740991Expected number of speakers for speaker diarization.
auto_chapters
booleanEnable automatic chapter detection.
entity_detection
booleanEnable detection of entities like names, organizations, and locations.
sentiment_analysis
booleanEnable sentiment analysis for each sentence.
auto_highlights
booleanEnable automatic extraction of key phrases and highlights.
content_safety
booleanEnable content safety detection for sensitive content.
iab_categories
booleanEnable IAB (Interactive Advertising Bureau) content taxonomy classification.
▶custom_spelling[]
arrayCustom spelling rules to replace specific words or phrases in the transcription output.
disfluencies
booleanInclude filler words like "um", "uh", etc. in the transcript.
multichannel
booleanProcess each audio channel separately for multi-channel audio files.
dual_channel
booleanProcess audio as dual-channel (stereo) for better accuracy.
webhook_url
stringformat: uriURL to receive webhook notifications when transcription is complete.
audio_start_from
integerminimum: 0maximum: 9007199254740991Timestamp (in milliseconds) to start transcription from.
audio_end_at
integerminimum: 0maximum: 9007199254740991Timestamp (in milliseconds) to end transcription at.
▶word_boost[]
arrayArray of words to boost recognition accuracy (legacy - use keyterms_prompt instead).
boost_param
stringenum: low, default, highHow much to boost the words in word_boost.
filter_profanity
booleanFilter profanity from the transcription.
redact_pii
booleanRedact personally identifiable information.
redact_pii_audio
booleanGenerate a redacted audio file with PII removed.
▶redact_pii_policies[]
arraySpecific PII policies to apply for redaction.
redact_pii_sub
stringenum: entity_name, hashStrategy for substituting redacted PII.
speech_threshold
numberminimum: 0maximum: 1Confidence threshold for speech detection.
domain
stringenum: medical-v1Domain-specific transcription mode. "medical-v1" enables medical terminology optimization.
text
stringThe transcribed text.
words
array | nullWord-level timestamps and confidence scores.
utterances
array | nullSpeaker-separated utterances (when speaker_labels is enabled).
confidence
numberOverall confidence score for the transcription.
language_code
stringDetected or specified language code.
language_confidence
numberConfidence score for language detection.
API Schemas (Raw)
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ai/models/assemblyai/universal-3-pro/#page","headline":"AssemblyAI Universal-3 Pro","description":"AssemblyAI's Universal 3 Pro speech recognition model for high-accuracy transcription.","url":"https://developers.cloudflare.com/ai/models/assemblyai/universal-3-pro/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: AssemblyAI's Universal-3.5 Pro speech recognition model for fast, high-accuracy transcription. title: AssemblyAI Universal-3.5 Pro image: https://developers.cloudflare.com/og-docs.png
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/llms.txt
Use this file to discover all available pages before exploring further.

