assemblyai-python-sdk: Instructions file for Claude Code

CLAUDE.md

assemblyai-python-sdk CLAUDE.md is an instructions file for Claude Code from AssemblyAI/assemblyai-python-sdk. It costs 9,655 tokens per session, scanned A, original, MIT.

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 for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is AssemblyAI/assemblyai-python-sdk's own configuration. It tells Claude Code how to work on assemblyai-python-sdk itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything assemblyai-python-sdk configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AssemblyAI/assemblyai-python-sdk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AssemblyAI/assemblyai-python-sdk/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/AssemblyAI/assemblyai-python-sdk

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for assemblyai-python-sdk CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/assemblyai/assemblyai-python-sdk/claude-md/github.svg)](https://agentmods.dev/instructions/assemblyai/assemblyai-python-sdk/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/assemblyai/assemblyai-python-sdk/claude-md"><img src="https://agentmods.dev/badge/instructions/assemblyai/assemblyai-python-sdk/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for assemblyai-python-sdk CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/assemblyai/assemblyai-python-sdk/claude-md"><img src="https://agentmods.dev/badge/instructions/assemblyai/assemblyai-python-sdk/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9,655 This file is loaded in full into every session.
When invoked 9,655 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.09655 $0.09655
Opus 5.5 $0.03862 $0.03862
Sonnet 5.5 $0.01931 $0.01931
Haiku 4.5 $0.00966 $0.00966

Measured 10d ago against content hash 2d2ccb052404, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 10d ago.

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 · 652 lines

How it starts

The opening of the file, as written. The whole thing — 652 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, audio analysis features, and LLM access through AssemblyAI's LLM Gateway.

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://assembly.ai/wildfires.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_live(), open_live(), transcribe_async(), warm()
  • aai.AsyncSyncTranscriber — Asyncio counterpart of SyncTranscriber. Same input types, config, result, and errors; transcribe(), transcribe_live() and warm() are coroutines; open_live() returns an AsyncLiveSession. 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
  • aai.DictationTranscriber — Dictation API: audio uploaded as it is spoken over one live request, transcript (and optional LLM pass) out. Methods: open_live() (push-style DictationLiveSession: write()/close()/result()/abort()), transcribe_live() (iterable, file object, bytes or path), warm(). There is no buffered transcribe(): every entry point posts to /v1/transcribe/live
  • aai.AsyncDictationTranscriber — Asyncio counterpart of DictationTranscriber; open_live() returns an AsyncDictationLiveSession. Owns an HTTP pool: use async with or await aclose()
  • aai.DictationConfig — Dictation options: sample_rate, channels, language_codes, keyterms_prompt, llm_instruction, rewrite_mode (aai.DictationRewriteMode.fast default | smart). Rejects unknown fields
  • aai.DictationResponse — Dictation result: .text, .words (DictationWord with text + confidence), .confidence, .llm_response, .llm_error, .audio_duration_ms, .session_id, .request_time_ms, .sync_time_ms, and .final_text (the LLM rewrite, falling back to .text)
  • aai.TextToSpeech — Text-to-Speech HTTP API: one text per request, audio out. Methods: synthesize() (complete audio as a TTSResponse), stream() (a TTSStream context manager yielding bytes as the API generates them), close() / with for a client built from api_key=. Host from aai.settings.tts_base_url (https://tts.us.assemblyai.com; set https://tts.eu.assemblyai.com for the EU zone). Requests use the client's own TTS pool (client.tts_http_client, built when the TextToSpeech is), which keeps idle connections 120 s by default (aai.settings.tts_keepalive_expiry; unset, a shorter keepalive_expiry applies), so consecutive sentences reuse one connection. Every TTS pool shares one process-wide TLS context. A passed client= stays the caller's: client.close() closes both pools
  • aai.AsyncTextToSpeech — Asyncio counterpart of TextToSpeech; synthesize() is a coroutine and stream() returns an AsyncTTSStream. Owns an HTTP pool: use async with or await aclose()
  • aai.TTSSession — Text-to-Speech WebSocket session: one connection, text in as it is written, audio out. with connects and waits for Begin (session.begin); speak(text) yields one request's audio; generate(text) / flush() -> flush_id / audio(flush_id) for streamed-in text and pipelining (audio() with no id follows the request being written, from another thread); cancel() for barge-in (ends the iteration at once); keep_alive(); on(TTSEvents.X, handler(event)) for Begin, Audio (switches audio from pull to push), FlushDone, WordBoundaries, Cancelled, Termination, Error. Exit sends Terminate and sets session.termination (None after a failure). Refusals and failures raise TTSError (status_code None, request_id = session id). Raw PCM/G.711 only; 2,000 chars per generate unless Begin reports another limits.max_generate_text_length; ~100 chars/s sustained. token= for temporary tokens
  • aai.AsyncTTSSession — Asyncio counterpart: async with, coroutine sends, async for chunk in session.speak(text)
  • aai.TTSConfig — Text-to-Speech options: voice_id (a library voice such as aai-jane, or a cloned voice by UUID or slug), model_id (assemblyai-tts-1), language, sample_rate, encoding (aai.TTSEncoding: pcm_s16le default | pcm_mulaw | pcm_alaw | mp3), container (aai.TTSContainer: raw default | wav), bit_rate, extend_biometric_consent (owner-only consent renewal of a cloned voice). Rejects unknown fields
  • aai.TTSResponse — Text-to-Speech result: .audio (bytes) plus the response headers: .request_id, .region, .model, .voice_id, .language, .encoding, .sample_rate, .container, .bit_rate, .content_type, .voice_expires_at, .billed_characters, .audio_duration_ms. TTSStream.info carries the same fields without audio; audio_duration_ms is None on a stream with audio (0 when the text had nothing to speak)
  • aai.TTSError — Raised on any Text-to-Speech refusal: .status_code, .error_code (stable API code; biometric_terms_not_accepted 403 until the account accepts the biometric data terms in the dashboard, auth_unavailable 503 retryable; on a session these arrive as close 3006 and 1011, with status_code None, the close code in .body["close_code"] and .retryable from the API's Error frame), .param, .request_id, .retryable, .retry_after, .errors, .body (the whole envelope)
  • assemblyai.streaming.v3.RealTimeTranscriber — Real-time streaming with event-based API (threaded)
  • assemblyai.streaming.v3.AsyncRealTimeTranscriber — Asyncio-native counterpart; same options/events
  • aai.LLMGateway — LLM Gateway client. Resources: models.list(), chat.completions.create() (incl. stream=True), understanding.create()/.validate()
  • aai.AsyncLLMGateway — Asyncio counterpart of LLMGateway. Same resources, every API call a coroutine; owns an HTTP pool (async with or await aclose())
  • assemblyai.llm_gateway.v1 — Canonical module for both gateways, matching the gateway's /v1 API. The top-level aai.* names re-export it
  • aai.LLMGatewayMessageParam — TypedDict for a chat message; pass plain dicts ({"role": "user", "content": "..."})

Read the full file on GitHub · 652 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. 10d ago Changed · +2 lines · +133 tokens per session 2d2ccb052404
  2. 15d ago Changed · +9 lines · +422 tokens per session 9e5a68bbbf25
  3. 16d ago Changed · +29 lines · +907 tokens per session c9952a690eca
  4. 21d ago Changed · +18 tokens per session cac22e44d54b
  5. 1mo ago Changed · +87 tokens per session 06e150a7af69
  6. 1mo ago Changed · +141 lines · +1,761 tokens per session 8f423b16a866
  7. 1mo ago Changed · +2 tokens per session a50a67c3ef44
  8. 1mo ago Changed · +38 lines · +784 tokens per session b6d2f16a17a9
  9. 2mo ago 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 (213 stars, last pushed yesterday), licensed MIT. It adds 9,655 tokens to every session, about $0.0386 per session on Opus 5.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.

Related

assemblyai-python-sdk CLAUDE.md compared with instructions from other repositories

assemblyai-python-sdk CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
assemblyai-python-sdk CLAUDE.mdAssemblyAI/assemblyai-python-sdkInstructions file213yesterdayMITA9,655Claude Code
graftcode graftcode-python.instructions.mdgrft-dev/graftcodeInstructions file9671mo agononeA4,639GitHub Copilot
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot