Skip to main content

Documentation Index

Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt

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

Supported languages

Universal-3 Pro Streaming supports 6 languages with native multilingual code switching. The model automatically detects and switches between languages mid-stream.
Need more than 6 languages?If you need support beyond the 6 languages listed here, consider using the Whisper Streaming model (speech_model: "whisper-rt"), which supports 99 languages with automatic language detection. See the Whisper Streaming page for details.

Regional dialects and variants

Universal-3 Pro Streaming goes beyond standard language support with deep understanding of regional dialects and local variants. Whether your audio features Quebecois French, Mexican Spanish, or Brazilian Portuguese, the model accurately captures speech as it’s naturally spoken — including colloquial expressions, local vocabulary, and accent-specific pronunciation patterns.
Dialect supportYou do not need to specify a dialect code to get accurate dialect transcription. Universal-3 Pro automatically recognizes regional speech patterns when using the base language code (e.g., fr for all French dialects, es for all Spanish dialects).
Dialect / VariantDescription
American EnglishStandard US English, including regional variants (Southern, Midwestern, Northeastern)
British EnglishUK English, including Received Pronunciation and regional accents
Australian EnglishAustralian English with local expressions and pronunciation
Dialect / VariantDescription
Castilian SpanishStandard Peninsular Spanish as spoken in central and northern Spain
Mexican SpanishMexican Spanish with local vocabulary and pronunciation
Argentine SpanishRioplatense Spanish with distinctive voseo and pronunciation
Colombian SpanishColombian Spanish with regional speech patterns
Chilean SpanishChilean Spanish with rapid speech patterns and local slang
Caribbean SpanishCuban, Dominican, and Puerto Rican Spanish dialects
SpanglishEnglish-Spanish code-mixing common in US bilingual communities
Dialect / VariantDescription
Metropolitan FrenchStandard Parisian French
Canadian French (Quebecois)Quebec French with distinctive vocabulary, pronunciation, and expressions
Belgian FrenchBelgian French with local vocabulary and pronunciation
Dialect / VariantDescription
Brazilian PortugueseBrazilian Portuguese with local vocabulary, pronunciation, and expressions
European PortugueseStandard Lisbon Portuguese with Iberian pronunciation
Dialect / VariantDescription
Standard ItalianStandard Italian based on Tuscan-influenced speech

Configuration

Prompting can be used to guide the model toward a specific language. However, prompts should be thoroughly tested before use in production. For example, pre-pending Transcribe Spanish to your prompt has shown to perform well on Spanish audio. See the Prompting guide for more details.

Quickstart

The following examples demonstrate how to stream audio to Universal-3 Pro Streaming.
1
Install the required libraries
pip install "assemblyai>=0.54.0" pyaudio
2
Create a new file main.py and paste the code below. Replace <YOUR_API_KEY> with your API key.
3
Run with python main.py and speak into your microphone.
import logging
from typing import Type

import assemblyai as aai
from assemblyai.streaming.v3 import (
    BeginEvent,
    StreamingClient,
    StreamingClientOptions,
    StreamingError,
    StreamingEvents,
    StreamingParameters,
    TurnEvent,
    TerminationEvent,
)

api_key = "<YOUR_API_KEY>"

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

def on_begin(self: Type[StreamingClient], event: BeginEvent):
    print(f"Session started: {event.id}")

def on_turn(self: Type[StreamingClient], event: TurnEvent):
    print(f"{event.transcript} ({event.end_of_turn})")

def on_terminated(self: Type[StreamingClient], event: TerminationEvent):
    print(
        f"Session terminated: {event.audio_duration_seconds} seconds of audio processed"
    )

def on_error(self: Type[StreamingClient], error: StreamingError):
    print(f"Error occurred: {error}")

def main():
    client = StreamingClient(
        StreamingClientOptions(
            api_key=api_key,
            api_host="streaming.assemblyai.com",
        )
    )

    client.on(StreamingEvents.Begin, on_begin)
    client.on(StreamingEvents.Turn, on_turn)
    client.on(StreamingEvents.Termination, on_terminated)
    client.on(StreamingEvents.Error, on_error)

    client.connect(
        StreamingParameters(
            sample_rate=16000,
            speech_model="u3-rt-pro",
        )
    )

    try:
        client.stream(
            aai.extras.MicrophoneStream(sample_rate=16000)
        )
    finally:
        client.disconnect(terminate=True)

if __name__ == "__main__":
    main()