assemblyai-python-sdk CLAUDE.md

Instructions and reference material for the AssemblyAI Python SDK, a library for turning audio into text and analysing recorded or live speech. It covers setup, authentication, transcription, speakers, and key classes.

In plain words
What is it for?
Building Python features for pre-recorded transcription, real-time audio, speaker labels, transcript management, and audio analysis.
Why use it?
It shows an AI assistant the supported SDK patterns, reducing errors when writing code that uploads audio, starts transcriptions, or reads results.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/assemblyai/assemblyai-python-sdk/claude-md
Clone the repo
git clone --depth 1 https://github.com/AssemblyAI/assemblyai-python-sdk
Per session 5,541 This file is loaded in full into every session.
When invoked 5,541 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.05541 $0.05541
Opus 5 $0.02771 $0.02771
Sonnet 5 $0.01108 $0.01108
Haiku 4.5 $0.00554 $0.00554

Measured yesterday against content hash 65fa8e9a67c1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

assemblyai-python-sdk CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 433 lines

How it starts

The opening of the file, as written. The whole thing — 433 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AssemblyAI Python SDK

Speech-to-text and audio intelligence SDK. Supports pre-recorded transcription, real-time streaming, and audio analysis features.

Quick start

pip install -U assemblyai
import os
import assemblyai as aai

aai.settings.api_key = os.environ["ASSEMBLYAI_API_KEY"]

transcript = aai.Transcriber().transcribe(
    "https://example.com/audio.mp3",
    config=aai.TranscriptionConfig(
        speech_models=["universal-3-5-pro", "universal-2"],
        speaker_labels=True,
    ),
)

print(transcript.text)
for utterance in transcript.utterances:
    print(f"Speaker {utterance.speaker}: {utterance.text}")

Auth

Set ASSEMBLYAI_API_KEY as an environment variable, or:

aai.settings.api_key = "your-key"

Key classes

  • aai.Transcriber — Transcribe files, URLs, or streams. Methods: transcribe(), transcribe_async(), submit(), list_transcripts()
  • aai.AsyncTranscriber — Asyncio counterpart of Transcriber. Same options, every API call a coroutine. Methods: transcribe(), submit(), transcribe_group(), get_by_id(), delete_by_id(), list_transcripts(), upload_file()
  • aai.AsyncTranscript — What AsyncTranscriber returns. Same fields as Transcript, coroutine methods
  • aai.AsyncClient — Shared httpx.AsyncClient pool for one or more AsyncTranscribers
  • assemblyai.prerecorded.v2 — Canonical module for both transcribers, matching the /v2/transcript API. The top-level aai.* names re-export it
  • aai.TranscriptionConfig — All transcription options: speech_models, speaker_labels, sentiment_analysis, entity_detection, auto_chapters, content_safety, language_detection, summarization, word_boost, disfluencies
  • aai.Transcript — Result object with .text, .status, .utterances, .words, .chapters, .entities, .sentiment_analysis. Methods: get_sentences(), get_paragraphs(), export_subtitles_srt(), export_subtitles_vtt()
  • aai.SyncTranscriber — Synchronous pre-recorded transcription: audio in, transcript out, one request (no polling). Methods: transcribe(), transcribe_async()
  • aai.AsyncSyncTranscriber — Asyncio counterpart of SyncTranscriber. Same input types, config, result, and errors; transcribe() and warm() are coroutines. Owns an HTTP pool: use async with or await aclose(), or pass an aai.AsyncClient to share one
  • aai.SyncTranscriptionConfig — Sync options: model (default universal-3-5-pro), prompt, keyterms_prompt, conversation_context, language_codes, timestamps, sample_rate, channels
  • aai.SyncTranscriptResponse — Sync result: .text, .words (SyncWord with confidence always, start/end only when timestamps=True), .confidence, .audio_duration_ms, .session_id, .request_time_ms
  • assemblyai.streaming.v3.RealTimeTranscriber — Real-time streaming with event-based API (threaded)
  • assemblyai.streaming.v3.AsyncRealTimeTranscriber — Asyncio-native counterpart; same options/events

Read the full file on GitHub · 433 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 433 lines · 5,541 tokens per session scan A 65fa8e9a67c1

Subscribe to this mod's changes

assemblyai-python-sdk CLAUDE.md is an instructions file published in the GitHub repository AssemblyAI/assemblyai-python-sdk (208 stars, last pushed 17d ago), licensed MIT. It adds 5,541 tokens to every session, about $0.0277 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.