Guides Python code using Deepgram Conversational STT v2/Flux for turn-aware streaming transcription, covering listen.v2.connect, Flux models, and end-of-turn detection.
Ships in deepgram-python-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Turn-aware streaming STT at /v2/listen — optimized for conversational audio (end-of-turn detection, eager EOT, barge-in scenarios).
Use a different skill when:
deepgram-python-speech-to-text.deepgram-python-voice-agent.deepgram-python-audio-intelligence.import os
from dotenv import load_dotenv
load_dotenv()
from deepgram import DeepgramClient
client = DeepgramClient(api_key=os.environ["DEEPGRAM_API_KEY"])
Header: Authorization: Token <api_key>. WSS only — no REST path on v2.
import threading, time
from pathlib import Path
from deepgram.core.events import EventType
from deepgram.listen.v2.types import (
ListenV2CloseStream,
ListenV2Connected,
ListenV2FatalError,
ListenV2TurnInfo,
)
with client.listen.v2.connect(
model="flux-general-en",
encoding="linear16",
sample_rate="16000",
) as conn:
def on_message(m):
if isinstance(m, ListenV2TurnInfo):
print(f"turn {m.turn_index} [{m.event}] {m.transcript}")
elif isinstance(m, dict): # untyped fallback
if m.get("type") == "TurnInfo":
print(f"turn {m.get('turn_index')} [{m.get('event')}] {m.get('transcript')}")
else:
print(f"event: {getattr(m, 'type', type(m).__name__)}")
conn.on(EventType.OPEN, lambda _: print("open"))
conn.on(EventType.MESSAGE, on_message)
conn.on(EventType.CLOSE, lambda _: print("close"))
conn.on(EventType.ERROR, lambda e: print(f"err: {type(e).__name__}: {e}"))
def send_audio():
for chunk in mic_chunks(): # 80ms recommended
conn.send_media(chunk)
time.sleep(0.01)
conn.send_close_stream(ListenV2CloseStream(type="CloseStream"))
threading.Thread(target=send_audio, daemon=True).start()
conn.start_listening()
| Param | Notes |
|---|---|
model | flux-general-en (English) or flux-general-multi (multilingual) — REQUIRED, must be a Flux model |
encoding | linear16, mulaw, etc. Omit for containerized audio |
sample_rate | String in the SDK signature, e.g. "16000" |
eager_eot_threshold | Fire end-of-turn early at this confidence |
eot_threshold | Primary end-of-turn confidence; set to "1.0" to suppress confidence-based endings |
eot_timeout_ms | Time-based fallback turn end; still applies when eot_threshold="1.0" |
keyterm | Bias for domain keywords |
mip_opt_out, tag | Metadata / privacy flags |
language_hint | ONLY for flux-general-multi |
authorization, request_options | Override auth or request options |
No language parameter on v2 — language is implied by model (flux-general-en) or hinted via language_hint on multi.
For application-controlled turns, use eot_threshold="1.0" with a sufficiently large eot_timeout_ms, then call conn.send_force_end_turn() for the active turn. ForceEndTurn is available on Deepgram-hosted deployments, including EU and AU. On self-hosted deployments, it requires the 2026-09-15 release or later with listen_v2 = true and listen_v2_force_end_turn = true under [features]; see examples/16-transcription-force-end-turn.py.
ListenV2Connected — connection establishedListenV2ConfigureSuccess / ListenV2ConfigureFailure — mid-session config changesListenV2TurnInfo — per-turn transcript + event (Update, EndOfTurn, EagerEndOfTurn, ...) + turn_indexListenV2FatalError — terminal errorClient messages: ListenV2Media, ListenV2Configure, ListenV2ForceEndTurn, ListenV2CloseStream.
from deepgram import AsyncDeepgramClient
client = AsyncDeepgramClient()
async with client.listen.v2.connect(model="flux-general-en", ...) as conn:
# same .on(...) handlers, then:
await conn.start_listening()
reference.md — "Listen V2 Connect"./llmstxt/developers_deepgram_llms_txt./v2/listen, not /v1/listen. Different route, different client path (listen.v2 vs listen.v1).nova-3, base, etc. will be rejected. Use flux-general-en or flux-general-multi.language parameter. Language is set by model choice. Use language_hint on flux-general-multi.sample_rate is a STRING in the SDK (e.g. "16000").send_close_stream(ListenV2CloseStream(type="CloseStream")) — not send_finalize (that's v1).construct_type for unknowns. Handle both branches (see socket_client.py patch in .fernignore).socket_client.py is patched / frozen (see .fernignore → src/deepgram/listen/v2/socket_client.py). Don't overwrite that manual patch during regeneration; treat other listen/v2 files as generated unless the regen workflow says otherwise.encoding/sample_rate for containerized audio (WAV, OGG, etc.) — the server detects them from the container.examples/14-transcription-live-websocket-v2.pytests/manual/listen/v2/connect/main.pydeepgram-python-speech-to-text — v1 general-purpose STT (REST + WSS)deepgram-python-voice-agent — full interactive assistantFor cross-language Deepgram product knowledge — the consolidated API reference, documentation finder, focused runnable recipes, third-party integration examples, and MCP setup — install the central skills:
npx skills add deepgram/skills
This SDK ships language-idiomatic code skills; deepgram/skills ships cross-language product knowledge (see api, docs, recipes, examples, starters, setup-mcp).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/deepgram-deepgram-python-sdk:deepgram-python-conversational-sttfrom deepgram-python-sdk
Claude Code refuses to install this plugin
This plugin's marketplace entry is invalid: skills.0: Invalid string: must start with "./", skills.1: Invalid string: must start with "./", skills.2: Invalid string: must start with "./" (+4 more)
This plugin's marketplace entry is invalid: skills.0: Invalid string: must start with "./", skills.1: Invalid string: must start with "./", skills.2: Invalid string: must start with "./" (+4 more)
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
7 skills in this plugin
/deepgram-python-audio-intelligenceUse when writing or reviewing Python code in this repo that calls Deepgram audio analytics overlays on `/v1/listen` - summarize, topics, intents, sentiment, diarize, redact, detect_language, entity detection. Same endpoint as plain STT but with analytics params. Covers both REST (`client.listen.v1.media.transcribe_url`/`transcribe_file`) and the WSS-supported subset (`client.listen.v1.connect`). Use `deepgram-python-speech-to-text` for plain transcription, `deepgram-python-text-intelligence` for analytics on already-transcribed text. Triggers include "diarize", "summarize audio", "sentiment from audio", "redact PII", "topic detection audio", "audio intelligence", "detect language audio"./deepgram-python-management-apiUse when writing or reviewing Python code in this repo that calls Deepgram Management APIs - projects, API keys, members, invites, usage, billing, models, and reusable Voice Agent configurations. Covers `client.manage.v1.projects`, project-scoped resources under `client.manage.v1.projects.*` (keys, members, members.invites, usage, billing, models, requests), global `client.manage.v1.models`, think-model discovery at `client.agent.v1.settings.think.models`, and `client.voice_agent.configurations.*`. Use `deepgram-python-voice-agent` when you want to run an agent interactively, this skill to PERSIST/LIST agent configs. Triggers include "management API", "list projects", "API keys", "members", "usage stats", "billing", "list models", "agent configurations", "manage.v1".Other plugins' skills for the same job