End-to-end examples
Copy-paste pipelines that combine multiple AssemblyAI products in a single script.
Overview
Each example below is a self-contained script that wires together several AssemblyAI products into a working pipeline. Run one, see the polished output, and customize from there.
Every example uses placeholder API keys (YOUR_API_KEY). Replace them with your actual key from the AssemblyAI dashboard.
Pre-recorded pipelines
These pipelines transcribe an existing audio file, then enrich the transcript with Speech Understanding features and LLM Gateway analysis.
Pipeline 1 — Meeting notetaker
Transcribe a meeting recording with speaker labels and automatic language detection, identify speakers by name, then send the transcript to LLM Gateway for a formatted summary with action items.
Products used: Pre-recorded STT + speaker diarization + Speaker Identification + language detection + LLM Gateway
Model selection: This example uses both universal-3-pro and universal-2 for broad language coverage across 99 languages. If your meetings are English-only, you can use universal-3-pro alone for the highest accuracy.
Python
JavaScript
Example output
Speaker Identification maps generic labels like “Speaker A” to real names. You can pass a list of known_values to guide identification, or omit it to let the model infer names from the conversation. Learn more in the Speaker Identification guide.
Pipeline 2 — Sales call intelligence
Transcribe a sales call with speaker labels and sentiment analysis, identify speakers by role, then use LLM Gateway to generate a coaching scorecard with talk/listen ratio and sentiment insights.
Products used: Pre-recorded STT + speaker diarization + Speaker Identification + sentiment analysis + LLM Gateway
Model selection: Uses universal-3-pro for the highest English accuracy. For multilingual sales teams, add universal-2 as a fallback.
Python
JavaScript
Example output
Pipeline 3 — Medical scribe
Transcribe a clinical encounter using Medical Mode with speaker labels and entity detection, identify speakers by role, then use LLM Gateway to generate a structured SOAP note.
Products used: Pre-recorded STT + Medical Mode + speaker diarization + Speaker Identification + entity detection + LLM Gateway
Model selection: Uses universal-3-pro-medical for purpose-built accuracy on medical terminology, drug names, and clinical language.
Medical Mode requires a signed BAA with AssemblyAI. Contact sales@assemblyai.com for access.
Python
JavaScript
Example output
For more on building clinical documentation apps, see the Medical Scribe Best Practices guide.
Pipeline 4 — Content repurposing
Transcribe a podcast or webinar, extract key phrases, then use LLM Gateway to generate a blog post draft with highlights.
Products used: Pre-recorded STT + key phrases + LLM Gateway
Model selection: Uses universal-3-pro with universal-2 fallback for multilingual content. If your content is English-only, universal-3-pro alone gives the best results.
Python
JavaScript
Example output
Streaming pipelines
These pipelines use the Streaming STT API to transcribe audio in real time from a microphone, with optional LLM Gateway integration for live analysis.
Pipeline 5 — Real-time meeting assistant
Stream audio from your microphone with speaker diarization and LLM Gateway to get live transcription and automatic summaries after each speaker turn.
Products used: Streaming STT + Universal-3 Pro + LLM Gateway
Model selection: Uses u3-rt-pro (Universal-3 Pro Streaming) for the lowest latency (~300ms) with the highest streaming accuracy.
Python
JavaScript
Example output
Pipeline 6 — Real-time live captioner
Stream audio from your microphone with keyterms prompting for domain-specific accuracy, ideal for live events, accessibility, and broadcast captioning.
Products used: Streaming STT + Universal-3 Pro + keyterms prompting
Model selection: Uses u3-rt-pro for sub-300ms latency with format_turns enabled for clean, readable captions.
Python
JavaScript
Example output
Customize and extend
Each pipeline above is a starting point. Here are common ways to build on them:
- Swap LLM models — Change the
modelparameter in LLM Gateway requests to use any of the 20+ supported models (Claude, GPT, Gemini, and more). - Add structured output — Use Structured Outputs to constrain LLM responses to a JSON schema for easier downstream processing.
- Add PII redaction — Enable PII Redaction to automatically mask sensitive information before it reaches the LLM.
- Use Speaker Identification — Replace generic speaker labels with real names using Speaker Identification.
- Add Translation — Translate transcripts into 20+ languages using Translation.
- Use webhooks — Replace polling with webhooks for production workloads so your server gets notified when transcription completes.
Next steps
- Pre-recorded STT quickstart — Step-by-step guide for your first transcription
- Streaming STT quickstart — Set up real-time transcription
- LLM Gateway overview — Explore all available models and features
- Use case guides — In-depth guides for meeting notetakers, medical scribes, voice agents, and more