deepgram-pack
Complete Deepgram integration skill pack with 24 skills covering speech-to-text, real-time transcription, voice intelligence, and audio processing. Flagship tier vendor pack.
Installation
Open Claude Code and run this command:
/plugin install deepgram-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
What It Does
> Speech-to-text, text-to-speech, and audio intelligence for Claude Code. 24 skills covering the full Deepgram platform: Nova-3/Nova-2 transcription, Aura-2 TTS, live streaming WebSocket, diarization, summarization, and enterprise deployment.
SDK: @deepgram/sdk (TypeScript) / deepgram-sdk (Python) API: createClient() (v3/v4) or new DeepgramClient() (v5) Models: Nova-3 (best accuracy), Nova-2 (proven), Base (fastest), Whisper (multilingual)
Skills (24) plugin-local skills
Configure Deepgram CI/CD integration for automated testing and deployment.
Deepgram CI Integration
Examples
Run unit/schema tests on every pull request with mocked Deepgram responses. Execute one trusted protected-branch integration test against a development project using a short licensed fixture and a scoped secret; retain redacted status/metrics on failure and never inject the key into forked or untrusted CI workflows.
Overview
Set up CI/CD pipelines for Deepgram integrations with GitHub Actions. Includes unit tests with mocked SDK, integration tests against the real API, smoke tests, automated key rotation, and deployment gates.
Prerequisites
- GitHub repository with Actions enabled
DEEPGRAM_API_KEYstored as repository secret@deepgram/sdkandvitestinstalled- Test fixtures committed (or downloaded in CI)
Instructions
Step 1: GitHub Actions Workflow
# .github/workflows/deepgram-ci.yml
name: Deepgram CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
NODE_VERSION: '20'
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm test -- --reporter=verbose
# Unit tests use mocked SDK — no API key needed
integration-tests:
runs-on: ubuntu-latest
needs: unit-tests
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run test:integration
env:
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
timeout-minutes: 5
smoke-test:
runs-on: ubuntu-latest
needs: integration-tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci && npm run build
- name: Smoke test
run: npx tsx scripts/smoke-test.ts
env:
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
timeout-minutes: 2
Step 2: Integration Test Suite
// tests/integration/deepgram.test.ts
import { describe, it, expect, beforeAll } from 'vitest';
import { createClient, DeepgramClient } from '@deepgram/sdk';
const SAMPLE_URL = 'https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav';
describe('Deepgram Integration', () => {
let client: DeepgramClient;
beforeAll(() => {
const key = process.env.DEEPGRAM_API_KEY;
ifDiagnose and fix common Deepgram errors and issues.
Deepgram Common Errors
Examples
For a failed transcription request, record its opaque correlation ID, environment, model, status class, and redacted timing. Check media format, credentials, timeout, and rate-limit state with a non-sensitive fixture; if the condition remains, escalate with the minimal redacted bundle rather than attaching customer audio or transcript text.
Overview
Comprehensive error reference for Deepgram API integration. Covers HTTP error codes, WebSocket errors, transcription quality issues, SDK-specific problems, and audio format debugging with real diagnostic commands.
Prerequisites
- Deepgram API key configured
curlavailable for API testing- Access to application logs
Instructions
Step 1: Quick Diagnostic
# Test API key validity
curl -s -w "\nHTTP %{http_code}\n" \
'https://api.deepgram.com/v1/projects' \
-H "Authorization: Token $DEEPGRAM_API_KEY"
# Test transcription endpoint
curl -s -w "\nHTTP %{http_code}\n" \
-X POST 'https://api.deepgram.com/v1/listen?model=nova-3&smart_format=true' \
-H "Authorization: Token $DEEPGRAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav"}'
Step 2: HTTP Error Reference
| Code | Error | Cause | Solution |
|---|---|---|---|
| 400 | Bad Request | Invalid audio format, bad params | Check audio headers, validate query params |
| 401 | Unauthorized | Invalid/expired API key | Regenerate in Console > API Keys |
| 403 | Forbidden | Key lacks scope | Create key with listen scope for STT |
| 404 | Not Found | Wrong endpoint URL | Use api.deepgram.com/v1/listen |
| 408 | Timeout | Audio too long for sync | Use callback param for async |
| 413 | Payload Too Large | File exceeds 2GB | Split with ffmpeg -f segment -segment_time 3600 |
| 429 | Too Many Requests | Concurrency limit hit | Implement backoff, check plan limits |
| 500 | Internal Error | Deepgram server error | Retry with backoff, check status.deepgram.com |
| 502 | Bad Gateway | Upstream failure | Retry after 5-10 seconds |
| 503 | Service Unavailable | Maintenance/overload | Check status.deepgram.com, retry later |
Step 3: WebSocket Errors
import { LiveTranscriImplement production pre-recorded speech-to-text with Deepgram.
Deepgram Core Workflow A: Pre-recorded Transcription
Examples
Upload a short synthetic or licensed audio fixture to the development workflow, validate transcript format, timestamps, language/model choice, and error handling, then remove the artifact according to retention policy. Do not use customer recordings for a tutorial or log raw transcript text when a correlation ID and aggregate result suffice.
Overview
Production pre-recorded transcription service using Deepgram's REST API. Covers transcribeUrl and transcribeFile, speaker diarization, audio intelligence (summarization, topic detection, sentiment, intent), batch processing with concurrency control, and callback-based async transcription for large files.
Prerequisites
@deepgram/sdkinstalled,DEEPGRAM_API_KEYconfigured- Audio files: WAV, MP3, FLAC, OGG, M4A, or WebM
- For batch:
p-limitpackage (npm install p-limit)
Instructions
Step 1: Transcription Service Class
import { createClient, DeepgramClient } from '@deepgram/sdk';
import { readFileSync } from 'fs';
interface TranscribeOptions {
model?: 'nova-3' | 'nova-2' | 'nova-2-meeting' | 'nova-2-phonecall' | 'base';
language?: string;
diarize?: boolean;
utterances?: boolean;
paragraphs?: boolean;
smart_format?: boolean;
summarize?: boolean; // Audio intelligence
detect_topics?: boolean; // Topic detection
sentiment?: boolean; // Sentiment analysis
intents?: boolean; // Intent recognition
keywords?: string[]; // Keyword boosting: ["term:weight"]
callback?: string; // Async callback URL
}
class DeepgramTranscriber {
private client: DeepgramClient;
constructor(apiKey: string) {
this.client = createClient(apiKey);
}
async transcribeUrl(url: string, opts: TranscribeOptions = {}) {
const { result, error } = await this.client.listen.prerecorded.transcribeUrl(
{ url },
{
model: opts.model ?? 'nova-3',
language: opts.language ?? 'en',
smart_format: opts.smart_format ?? true,
diarize: opts.diarize ?? false,
utterances: opts.utterances ?? false,
paragraphs: opts.paragraphs ?? false,
summarize: opts.summarize ? 'v2' : undefined,
detect_topics: opts.detect_topics ?? false,
sentiment: opts.sentiment ?? false,
intents: opts.intents ?? false,
keywords: opts.keywords,
callback: opts.callback,
}
);
if (error) throw new Error(`Transcription failed: ${error.message}`);
return result;
}
async transcribeFile(filePath: string, opts: TranscribeOptions = {}) {
const audio = readFileSync(filePath);
const mimetype = this.detectMimetype(filePath);
cImplement real-time streaming transcription with Deepgram WebSocket.
Deepgram Core Workflow B: Live Streaming Transcription
Examples
Open a development streaming session with a non-sensitive test utterance, verify connection/authentication, partial/final transcript state, timeout, and close behavior. Enforce the session's data/consent policy and log a correlation ID plus state transitions—not audio bytes, API keys, or full participant speech.
Overview
Real-time streaming transcription using Deepgram's WebSocket API. The SDK manages the WebSocket connection via listen.live(). Covers microphone capture, interim/final result handling, speaker diarization, UtteranceEnd detection, auto-reconnect, and building an SSE endpoint for browser clients.
Prerequisites
@deepgram/sdkinstalled,DEEPGRAM_API_KEYconfigured- Audio source: microphone (via Sox/
rec), file stream, or WebSocket audio from browser - For mic capture:
soxinstalled (apt install sox/brew install sox)
Instructions
Step 1: Basic Live Transcription
import { createClient, LiveTranscriptionEvents } from '@deepgram/sdk';
const deepgram = createClient(process.env.DEEPGRAM_API_KEY!);
const connection = deepgram.listen.live({
model: 'nova-3',
language: 'en',
smart_format: true,
punctuate: true,
interim_results: true, // Show in-progress results
utterance_end_ms: 1000, // Silence threshold for utterance end
vad_events: true, // Voice activity detection events
encoding: 'linear16', // 16-bit PCM
sample_rate: 16000, // 16 kHz
channels: 1, // Mono
});
// Connection lifecycle events
connection.on(LiveTranscriptionEvents.Open, () => {
console.log('WebSocket connected to Deepgram');
});
connection.on(LiveTranscriptionEvents.Close, () => {
console.log('WebSocket closed');
});
connection.on(LiveTranscriptionEvents.Error, (err) => {
console.error('Deepgram error:', err);
});
// Transcript events
connection.on(LiveTranscriptionEvents.Transcript, (data) => {
const transcript = data.channel.alternatives[0]?.transcript;
if (!transcript) return;
if (data.is_final) {
console.log(`[FINAL] ${transcript}`);
} else {
process.stdout.write(`\r[interim] ${transcript}`);
}
});
// UtteranceEnd — fires when speaker pauses
connection.on(LiveTranscriptionEvents.UtteranceEnd, () => {
console.log('\n--- utterance end ---');
});
Step 2: Microphone Capture with Sox
import { spawn } from 'child_process';
function startMicrophone(connection: any) {
// Sox captures from default mic: 16kHz, 16-bit signed LE, mono
const mic = spawn('rec', [
'-q', // Quiet (no progress)
'-r', &Optimize Deepgram costs and usage for budget-conscious deployments.
Deepgram Cost Tuning
Prerequisites
- An aggregate usage/cost baseline, approved budget owner, delivery/quality SLO, and data/retention policy.
- Synthetic fixtures and a reversible optimization/change record.
Examples
Compare aggregate duration, model, concurrency, and error data in a development/staging workload, change one approved model or batching parameter, and observe the quality/latency/cost tradeoff. Revert if quality or reliability drops; do not reduce retention, privacy, or consent safeguards merely to lower spend.
Overview
Optimize Deepgram API costs through smart model selection, audio preprocessing to reduce billable minutes, usage monitoring via the Deepgram API, budget guardrails, and feature-aware cost estimation. Deepgram bills per audio minute processed.
Deepgram Pricing (2026)
| Product | Model | Price/Minute | Notes |
|---|---|---|---|
| STT (Batch) | Nova-3 | $0.0043 | Best accuracy |
| STT (Batch) | Nova-2 | $0.0043 | Proven stable |
| STT (Streaming) | Nova-3 | $0.0059 | Real-time |
| STT (Streaming) | Nova-2 | $0.0059 | Real-time |
| STT (Batch) | Base | $0.0048 | Fastest |
| STT (Batch) | Whisper | $0.0048 | Multilingual |
| TTS | Aura-2 | Pay-per-character | See TTS pricing |
| Intelligence | Summarize/Topics/Sentiment | Included with STT | No extra cost |
Add-on costs:
- Diarization: +$0.0044/min
- Multichannel: billed per channel
Instructions
Step 1: Budget-Aware Transcription Service
import { createClient } from '@deepgram/sdk';
interface BudgetConfig {
monthlyLimitUsd: number;
warningThreshold: number; // 0.0-1.0 (e.g., 0.8 = warn at 80%)
costPerMinute: number; // Base STT cost
}
class BudgetAwareTranscriber {
private client: ReturnType<typeof createClient>;
private config: BudgetConfig;
private monthlySpendUsd = 0;
private monthlyMinutes = 0;
constructor(apiKey: string, config: BudgetConfig) {
this.client = createClient(apiKey);
this.config = config;
}
async transcribe(source: any, options: any) {
// Estimate cost before transcription
const estimatedCost = this.estimateCost(options);
const projected = this.monthlySpendUsd + estimatedCost;
if (projected > this.config.monthlyLimitUsd) {
throw new Error(
`Budget exceeded: $${this.monthlySpendUsd.toFixed(2)} spent, ` +
`$${this.config.monthlyLimitUsd} limit`
);
}
if (projected > this.config.monthlyLimitUsd * this.config.warnImplement audio data handling best practices for Deepgram integrations.
Deepgram Data Handling
Prerequisites
- Data classification, consent/legal basis, approved retention/deletion policy, storage boundary, and named data owner.
- A redaction/logging policy and an incident route for recording or transcript exposure.
Examples
Process a licensed development fixture through the approved region/storage route, verify its retention/deletion behavior, and record only a correlation ID and policy result. Do not put recordings, transcripts, participant identifiers, or storage URLs into test logs; on accidental exposure, restrict access and follow the data incident procedure.
Overview
Best practices for handling audio and transcript data with Deepgram. Covers Deepgram's built-in redact parameter for PII, secure audio upload with encryption, transcript storage patterns, data retention policies, and GDPR/HIPAA compliance workflows.
Data Privacy Quick Reference
| Deepgram Feature | What It Does | Enable |
|---|---|---|
redact: ['pci'] |
Masks credit card numbers in transcript | Query param |
redact: ['ssn'] |
Masks Social Security numbers | Query param |
redact: ['numbers'] |
Masks all numeric sequences | Query param |
| Data retention | Deepgram does NOT store audio or transcripts | Default behavior |
Deepgram's data policy: Audio is processed in real-time and not stored. Transcripts are not retained unless you use Deepgram's optional storage features.
Instructions
Step 1: Deepgram Built-in PII Redaction
import { createClient } from '@deepgram/sdk';
const deepgram = createClient(process.env.DEEPGRAM_API_KEY!);
// Deepgram redacts PII directly during transcription
const { result } = await deepgram.listen.prerecorded.transcribeUrl(
{ url: audioUrl },
{
model: 'nova-3',
smart_format: true,
redact: ['pci', 'ssn'], // Credit cards + SSNs -> [REDACTED]
}
);
// Output: "My card is [REDACTED] and SSN is [REDACTED]"
console.log(result.results.channels[0].alternatives[0].transcript);
// For maximum privacy, redact all numbers:
// redact: ['pci', 'ssn', 'numbers']
Step 2: Application-Level PII Redaction
// Additional redaction patterns beyond Deepgram's built-in
const piiPatterns: Array<{ name: string; pattern: RegExp; replacement: string }> = [
{ name: 'email', pattern: /\b[\w.-]+@[\w.-]+\.\w{2,}\b/g, replacement: '[EMAIL]' },
{ name: 'phone', pattern: /\b(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g, replaCollect Deepgram debug evidence for support and troubleshooting.
Deepgram Debug Bundle
Examples
For a streaming failure, collect the correlation ID, environment, client/SDK version, model, connection state transitions, redacted status, and timestamp. Review the bundle for keys, audio bytes, transcript text, participant identifiers, and storage URLs before sharing; reproduce with a licensed fixture and use the approved support/incident route.
Current State
!node --version 2>/dev/null || echo 'Node.js not installed' !npm list @deepgram/sdk 2>/dev/null | grep deepgram || echo '@deepgram/sdk not found' !python3 --version 2>/dev/null || echo 'Python not installed'
Overview
Collect comprehensive debug information for Deepgram support tickets. Generates a sanitized bundle with environment info, API connectivity tests, audio analysis, request/response logs, and a minimal reproduction script. All API keys are automatically redacted.
Prerequisites
- Deepgram API key configured
ffprobeavailable for audio analysis (part of ffmpeg)- Sample audio that reproduces the issue
Instructions
Step 1: Environment Collection Script
#!/bin/bash
set -euo pipefail
BUNDLE_DIR="deepgram-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"
# System info
{
echo "=== System ==="
uname -a
echo ""
echo "=== Node.js ==="
node --version 2>/dev/null || echo "Not installed"
echo ""
echo "=== @deepgram/sdk ==="
npm list @deepgram/sdk 2>/dev/null || echo "Not installed"
echo ""
echo "=== Python ==="
python3 --version 2>/dev/null || echo "Not installed"
pip show deepgram-sdk 2>/dev/null || echo "Not installed"
} > "$BUNDLE_DIR/environment.txt"
Step 2: API Connectivity Tests
# Test REST API
{
echo "=== REST API Test ==="
echo "Timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo ""
echo "--- Project listing ---"
curl -s -w "\nHTTP: %{http_code} | Time: %{time_total}s\n" \
'https://api.deepgram.com/v1/projects' \
-H "Authorization: Token $DEEPGRAM_API_KEY" 2>&1 | \
sed "s/$DEEPGRAM_API_KEY/REDACTED/g"
echo ""
echo "--- Transcription test (Bueller sample) ---"
curl -s -w "\nHTTP: %{http_code} | Time: %{time_total}s\n" \
-X POST 'https://api.deepgram.com/v1/listen?model=nova-3&smart_format=true' \
-H "Authorization: Token $DEEPGRAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav"}' 2>&1 | \
sed Deploy Deepgram integrations to production environments.
Deepgram Deploy Integration
Examples
Deploy a versioned integration to staging with a scoped secret reference and a short licensed fixture, then verify health, timeout/retry behavior, redacted metrics, and the rollback command. Promote through a controlled production canary only after data/consent and quality checks pass; do not deploy a key or audio fixture in the manifest.
Overview
Deploy Deepgram transcription services to Docker, Kubernetes, AWS Lambda, and Google Cloud Run. Includes production Dockerfile, K8s manifests with secret management, serverless handlers for event-driven transcription, and health check patterns.
Prerequisites
- Working Deepgram integration (tested locally)
- Production API key in secret manager
- Container registry access (Docker Hub, ECR, GCR)
- Target platform CLI installed
Instructions
Step 1: Production Dockerfile
# Multi-stage build for minimal production image
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --production=false
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
FROM node:20-alpine AS runtime
# Security: non-root user
RUN addgroup -g 1001 -S app && adduser -S app -u 1001
WORKDIR /app
# Production dependencies only
COPY package*.json ./
RUN npm ci --production && npm cache clean --force
# Copy built application
COPY --from=builder /app/dist ./dist
# Health check (tests Deepgram connectivity)
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget -q --spider http://localhost:3000/health || exit 1
USER app
EXPOSE 3000
CMD ["node", "dist/server.js"]
Step 2: Docker Compose
# docker-compose.yml
version: '3.8'
services:
deepgram-service:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- DEEPGRAM_API_KEY=${DEEPGRAM_API_KEY}
- DEEPGRAM_MODEL=nova-3
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis-data:/data
volumes:
redis-data:
Step 3: Kubernetes Deployment
# k8s/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: deepgram-service
labels:
app: deepgram-service
spec:
replicas: 3
selector:
matchLabels:
app: deepgram-service
template:
metadata:
labels:
app: deepgram-service
spec:
containers:
- name: deepgram-service
image: yourConfigure enterprise role-based access control for Deepgram integrations.
Deepgram Enterprise RBAC
Prerequisites
- A verified identity source, named project/role owners, least-privilege role map, and access-review schedule.
- Authority to provision/revoke users and service credentials through approved identity/admin paths.
Examples
Grant a transcription service account only the development project scope it needs, validate its permitted action with a synthetic fixture, and record the owner and expiration/review date. Confirm that the same identity cannot access production; on role mismatch, revoke the broad assignment and correct the group mapping before further use.
Overview
Role-based access control for enterprise Deepgram deployments. Maps five application roles to Deepgram API key scopes, implements scoped key provisioning via the Deepgram Management API, Express permission middleware, team management with auto-provisioned keys, and automated key rotation.
Deepgram Scope Reference
| Scope | Permission | Used By |
|---|---|---|
member |
Full access (all scopes) | Admin only |
listen |
STT transcription | Developers, Services |
speak |
TTS synthesis | Developers, Services |
manage |
Project/key management | Admin |
usage:read |
View usage metrics | Analysts, Auditors |
keys:read |
List API keys | Auditors |
keys:write |
Create/delete keys | Admin |
Instructions
Step 1: Define Roles and Scope Mapping
interface Role {
name: string;
deepgramScopes: string[];
keyExpiry: number; // Days
description: string;
}
const ROLES: Record<string, Role> = {
admin: {
name: 'Admin',
deepgramScopes: ['member'],
keyExpiry: 90,
description: 'Full access — project and key management',
},
developer: {
name: 'Developer',
deepgramScopes: ['listen', 'speak'],
keyExpiry: 90,
description: 'STT and TTS — no management access',
},
analyst: {
name: 'Analyst',
deepgramScopes: ['usage:read'],
keyExpiry: 365,
description: 'Read-only usage metrics',
},
service: {
name: 'Service Account',
deepgramScopes: ['listen'],
keyExpiry: 90,
description: 'STT only — for automated systems',
},
auditor: {
name: 'Auditor',
deepgramScopes: ['usage:read', 'keys:read'],
keyExpiry: 30,
description: 'Read-only audit access',
},
};
Step 2: Scoped Key Provisioning
Create a minimal working Deepgram transcription example.
Deepgram Hello World
Examples
Transcribe a short licensed fixture in the development project, verify the response shape and selected model/language, and remove the fixture according to the test policy. Keep only a correlation ID and aggregate result in logs; do not use a customer call or retain its transcript as a tutorial artifact.
Overview
Minimal working examples for Deepgram speech-to-text. Transcribe an audio URL in 5 lines with createClient + listen.prerecorded.transcribeUrl. Includes local file transcription, Python equivalent, and Nova-3 model selection.
Prerequisites
npm install @deepgram/sdkcompletedDEEPGRAM_API_KEYenvironment variable set- Audio source: URL or local file (WAV, MP3, FLAC, OGG, M4A)
Instructions
Step 1: Transcribe Audio from URL (TypeScript)
import { createClient } from '@deepgram/sdk';
const deepgram = createClient(process.env.DEEPGRAM_API_KEY!);
async function main() {
const { result, error } = await deepgram.listen.prerecorded.transcribeUrl(
{ url: 'https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav' },
{
model: 'nova-3', // Latest model — best accuracy
smart_format: true, // Auto-punctuation, paragraphs, numerals
language: 'en',
}
);
if (error) throw error;
const transcript = result.results.channels[0].alternatives[0].transcript;
console.log('Transcript:', transcript);
console.log('Confidence:', result.results.channels[0].alternatives[0].confidence);
}
main();
Step 2: Transcribe a Local File
import { createClient } from '@deepgram/sdk';
import { readFileSync } from 'fs';
const deepgram = createClient(process.env.DEEPGRAM_API_KEY!);
async function transcribeFile(filePath: string) {
const audio = readFileSync(filePath);
const { result, error } = await deepgram.listen.prerecorded.transcribeFile(
audio,
{
model: 'nova-3',
smart_format: true,
// Deepgram auto-detects format, but you can specify:
mimetype: 'audio/wav',
}
);
if (error) throw error;
console.log(result.results.channels[0].alternatives[0].transcript);
}
transcribeFile('./meeting-recording.wav');
Step 3: Python Equivalent
import os
from deepgram import DeepgramClient, PrerecordedOptions
client = DeepgramClient(os.environ["DEEPGRAM_API_KEY"])
# URL transcription
url = {"url": "https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav"}
options = PrerecordedOptions(model="nova-3", smart_format=True, language="en")
response = client.listen.rest.v("1").transcribe_url(url, optioExecute Deepgram incident response procedures for production issues.
Deepgram Incident Runbook
Prerequisites
- An incident ID, commander, affected service/environment, escalation route, and authorized redacted diagnostic access.
- A data/consent owner and documented safe mitigation or rollback action.
Examples
For elevated transcription errors, declare scope, capture aggregate health and redacted correlation IDs, stabilize with the documented circuit-breaker/rollback, and verify recovery against the SLO. Escalate provider or data-impact incidents through the approved path; do not attach customer audio, transcripts, or credentials to the incident channel.
Overview
Standardized incident response for Deepgram-related production issues. Includes automated triage script, severity classification (SEV1-SEV4), immediate mitigation actions, fallback activation, and post-incident review template.
Quick Reference
| Resource | URL |
|---|---|
| Deepgram Status | https://status.deepgram.com |
| Deepgram Console | https://console.deepgram.com |
| Support Email | support@deepgram.com |
| Community | https://github.com/orgs/deepgram/discussions |
Severity Classification
| Level | Definition | Response Time | Example |
|---|---|---|---|
| SEV1 | Complete outage, all transcriptions failing | Immediate | 100% 5xx errors |
| SEV2 | Major degradation, >50% error rate | < 15 min | Specific model failing |
| SEV3 | Minor degradation, elevated latency | < 1 hour | P95 > 30s |
| SEV4 | Single feature affected, cosmetic | < 24 hours | Diarization inaccurate |
Instructions
Step 1: Automated Triage (First 5 Minutes)
#!/bin/bash
set -euo pipefail
echo "=== Deepgram Incident Triage ==="
echo "Timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo ""
# 1. Check Deepgram status page
echo "--- Status Page ---"
STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://status.deepgram.com)
echo "Status page: HTTP $STATUS"
# 2. Test API connectivity
echo ""
echo "--- API Connectivity ---"
curl -s -w "\nHTTP: %{http_code} | Latency: %{time_total}s\n" \
'https://api.deepgram.com/v1/projects' \
-H "Authorization: Token $DEEPGRAM_API_KEY" | head -5
# 3. Test transcription
echo ""
echo "--- Transcription Test ---"
RESULT=$(curl -s -w "\n%{http_code}" \
-X POST 'https://api.deepgram.com/v1/listen?model=nova-3&smart_format=true' \
-H "Authorization: Token $DEEPGRAM_API_KEY" \
-H "CInstall and configure Deepgram SDK authentication.
Deepgram Install & Auth
Examples
Load a development API key from the approved secret manager and send a short, non-sensitive audio fixture to the intended Deepgram project. Record only the project/environment and result. If the key appears in a repository, log, or support ticket, revoke it immediately and issue a replacement before investigating further.
Current State
!npm list @deepgram/sdk 2>/dev/null || echo '@deepgram/sdk not installed' !pip show deepgram-sdk 2>/dev/null | grep Version || echo 'deepgram-sdk (Python) not installed'
Overview
Install the Deepgram SDK and configure API key authentication. Deepgram provides speech-to-text (Nova-3, Nova-2), text-to-speech (Aura-2), and audio intelligence APIs. The JS SDK uses createClient() (v3/v4) or new DeepgramClient() (v5+).
Prerequisites
- Node.js 18+ or Python 3.10+
- Deepgram account at console.deepgram.com
- API key from Console > Settings > API Keys
Instructions
Step 1: Install SDK
Node.js (v3/v4 — current stable):
npm install @deepgram/sdk
# or
pnpm add @deepgram/sdk
Python:
pip install deepgram-sdk
Step 2: Configure API Key
# Option A: Environment variable (recommended)
export DEEPGRAM_API_KEY="your-api-key-here"
# Option B: .env file (add .env to .gitignore)
echo 'DEEPGRAM_API_KEY=your-api-key-here' >> .env
Never hardcode keys. Use dotenv for local dev, secret managers in production.
Step 3: Initialize Client (TypeScript)
import { createClient } from '@deepgram/sdk';
// Reads DEEPGRAM_API_KEY from env automatically
const deepgram = createClient(process.env.DEEPGRAM_API_KEY!);
SDK v5+ uses a different constructor:
import { DeepgramClient } from '@deepgram/sdk';
const deepgram = new DeepgramClient({ apiKey: process.env.DEEPGRAM_API_KEY });
Step 4: Initialize Client (Python)
from deepgram import DeepgramClient, PrerecordedOptions, LiveOptions
import os
client = DeepgramClient(os.environ["DEEPGRAM_API_KEY"])
Step 5: Verify Connection
// TypeScript — list projects to verify key is valid
async function verify() {
const deepgram = createClient(process.env.DEEPGRAM_API_KEY!);
const { result, error } = await deepgram.manage.getProjects();
if (error) {
console.error('Auth failed:', error.message);
process.exit(1);
}
console.log(`ConnecteConfigure Deepgram local development workflow with testing and mocks.
Deepgram Local Dev Loop
Examples
Use a local or development workspace with a short licensed fixture, make one SDK/config change, run the focused unit test and a bounded integration test, then inspect redacted metrics. Commit only the reviewed change; never copy production recordings, transcripts, or API keys into a local test loop.
Overview
Set up a fast local development workflow for Deepgram: test fixtures with sample audio, mock responses for offline unit tests, Vitest integration tests against the real API, and a watch-mode transcription dev server.
Prerequisites
@deepgram/sdkinstalled,DEEPGRAM_API_KEYconfigurednpm install -D vitest tsx dotenvfor testing and dev server- Optional:
curlfor downloading test fixtures
Instructions
Step 1: Project Structure
mkdir -p src tests/mocks fixtures
touch src/transcribe.ts tests/transcribe.test.ts tests/mocks/deepgram-responses.ts
Step 2: Download Test Fixtures
# Deepgram provides free sample audio files
curl -o fixtures/nasa-podcast.wav \
https://static.deepgram.com/examples/nasa-podcast.wav
curl -o fixtures/bueller.wav \
https://static.deepgram.com/examples/Bueller-Life-moves-702702706.wav
Step 3: Environment Config
# .env.development
DEEPGRAM_API_KEY=your-dev-key
DEEPGRAM_MODEL=nova-3
# .env.test (use a separate test key with low limits)
DEEPGRAM_API_KEY=your-test-key
DEEPGRAM_MODEL=base
{
"scripts": {
"dev": "tsx watch src/transcribe.ts",
"test": "vitest",
"test:watch": "vitest --watch",
"test:integration": "vitest run tests/integration/"
}
}
Step 4: Mock Deepgram Responses
// tests/mocks/deepgram-responses.ts
export const mockPrerecordedResult = {
metadata: {
request_id: 'mock-request-id-001',
created: '2026-01-01T00:00:00.000Z',
duration: 12.5,
channels: 1,
models: ['nova-3'],
model_info: { 'nova-3': { name: 'nova-3', version: '2026-01-01' } },
},
results: {
channels: [{
alternatives: [{
transcript: 'Life moves pretty fast. If you don\'t stop and look around once in a while, you could miss it.',
confidence: 0.98,
words: [
{ word: 'life', start: 0.08, end: 0.32, confidence: 0.99, punctuated_word: 'Life' },
{ word: 'moves', start: 0.32, end: 0.56, confidence: 0.98, punctuated_word: 'moves' },
{ word: 'pretty', start: 0.56, end: 0.88, confidence: 0.97, punctuated_word: 'pretty' },
{ word: 'Deep dive into migrating to Deepgram from other transcription providers.
Deepgram Migration Deep Dive
Prerequisites
- An inventory of existing audio/transcript flows, data retention/consent obligations, evaluation fixtures, and rollback owner.
- A staging environment with separate credentials and a compatibility/quality acceptance threshold.
Examples
Run the old and new transcription flow against approved non-sensitive fixtures, compare aggregate accuracy/latency/error metrics, and route a small reversible staging canary only after acceptance passes. Roll back immediately on quality, consent, or operational regression; do not bulk-migrate or reprocess customer recordings before the observation window closes.
Current State
!npm list @deepgram/sdk 2>/dev/null | grep deepgram || echo 'Not installed' !npm list @aws-sdk/client-transcribe 2>/dev/null | grep transcribe || echo 'AWS Transcribe SDK not found' !pip show google-cloud-speech 2>/dev/null | grep Version || echo 'Google STT not found'
Overview
Migrate to Deepgram from AWS Transcribe, Google Cloud Speech-to-Text, Azure Cognitive Services, or OpenAI Whisper. Uses an adapter pattern with a unified interface, parallel running for quality validation, percentage-based traffic shifting, and automated rollback.
Feature Mapping
AWS Transcribe -> Deepgram
| AWS Transcribe | Deepgram | Notes |
|---|---|---|
LanguageCode: 'en-US' |
language: 'en' |
ISO 639-1 (2-letter) |
ShowSpeakerLabels: true |
diarize: true |
Same feature, different param |
VocabularyName: 'custom' |
keywords: ['term:1.5'] |
Inline boosting, no pre-upload |
ContentRedactionType: 'PII' |
redact: ['pci', 'ssn'] |
Granular PII categories |
OutputBucketName |
callback: 'https://...' |
Callback URL, not S3 |
| Job polling model | Sync response or callback | No polling needed |
Google Cloud STT -> Deepgram
| Google STT | Deepgram | Notes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RecognitionConfig.encoding |
Auto-detected | Deepgram auto-detects format | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RecognitionConfig.sampleRateHertz |
sample_rate (live only) |
REST auto-detects | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RecognitionConfig.model: 'latest_long' |
model: 'nova-3' |
Direct mapping | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SpeakerDiarizationConfig |
diarize: true
deepgram-multi-env-setup
View full skill →
Configure Deepgram multi-environment setup for dev, staging, and production.
ReadWriteEditBash(kubectl:*)Bash(curl:*)
Deepgram Multi-Environment SetupPrerequisites
ExamplesValidate a configuration in development with a licensed fixture, promote the same version to staging with a separate key, and record its quality/latency/alert results. Promote production through an approved canary only; never reuse production keys or recordings in development to make an environment test pass. OverviewConfigure isolated Deepgram environments for development, staging, and production. Each environment uses a separate Deepgram project, scoped API keys, environment-specific model selection, and validated configuration. Includes typed config, client factory, Docker Compose profiles, and Kubernetes overlays. Environment Strategy
InstructionsStep 1: Typed Environment Configuration
deepgram-observability
View full skill →
Set up comprehensive observability for Deepgram integrations.
ReadWriteEditBash(curl:*)
Deepgram ObservabilityPrerequisites
ExamplesEmit aggregate metrics for request count, latency, model, status class, streaming duration, and rate-limit headroom. Trigger a non-sensitive staging failure to verify alert routing, then record the correlation ID and remediation time—never audio samples, transcripts, or credentials. OverviewFull observability stack for Deepgram: Prometheus metrics (request counts, latency histograms, audio processed, cost tracking), OpenTelemetry distributed tracing, structured JSON logging with Pino, Grafana dashboard JSON, and AlertManager rules. Four Pillars
InstructionsStep 1: Prometheus Metrics Definition
deepgram-performance-tuning
View full skill →
Optimize Deepgram API performance for faster transcription and lower latency.
ReadWriteEditBash(ffmpeg:*)Bash(ffprobe:*)
Deepgram Performance TuningPrerequisites
ExamplesMeasure the development/staging transcription baseline with short fixtures, change one concurrency, streaming, or model parameter, and compare aggregate quality/latency/error results. Keep the change only within the signed threshold; revert on regression and never use customer recordings as performance fixtures. OverviewOptimize Deepgram transcription performance through audio preprocessing with ffmpeg, model selection for speed vs accuracy, streaming for large files, parallel processing, result caching, and connection reuse. Targets: <2s latency for short files, 100+ files/minute batch throughput. Performance Levers
InstructionsStep 1: Audio Preprocessing with ffmpeg
deepgram-prod-checklist
View full skill →
Execute Deepgram production deployment checklist.
ReadWriteEditGrepBash(curl:*)
Deepgram Production ChecklistPrerequisites
ExamplesRun the final production gate with a non-sensitive canary, verify alert routing and the redacted request receipt, then observe against the stated quality/latency/error threshold. If any gate fails, halt rollout and restore the previous approved configuration rather than extending the canary or disabling controls. OverviewComprehensive go-live checklist for Deepgram integrations. Covers singleton client, health checks, Prometheus metrics, alert rules, error handling, and a phased go-live timeline. Production Readiness Matrix
When you exceed your concurrency limit, Deepgram returns Key insight: You can send unlimited total requests — just not more than your concurrency limit simultaneously. InstructionsStep 1: Concurrency-Aware Queue
deepgram-reference-architecture
View full skill →
Implement Deepgram reference architecture for scalable transcription systems.
ReadWriteEditBash(npm:*)
Deepgram Reference ArchitecturePrerequisites
ExamplesModel a development producer that validates media metadata, sends a request using a scoped project key, receives a signed callback, and records only correlation/state metrics. Promote the same versioned contract through staging before a production canary, retaining a dead-letter/recovery owner and excluding audio/transcript content from telemetry. OverviewFour reference architectures for Deepgram transcription at scale: synchronous REST for short files, async queue (BullMQ) for batch processing, WebSocket proxy for real-time streaming, and a hybrid router that auto-selects the best pattern based on audio duration. Architecture Selection Guide
InstructionsStep 1: Synchronous REST Pattern
Step 2: Async Queue Pattern (BullMQ)
deepgram-sdk-patterns
View full skill →
Apply production-ready Deepgram SDK patterns for TypeScript and Python.
ReadWriteEdit
Deepgram SDK PatternsExamplesWrap the SDK behind a client that receives a scoped secret reference, validates media metadata, applies timeout/retry limits, and emits only redacted request metrics. Unit-test the wrapper with a mocked response; use a development fixture for one integration test and verify that credentials, audio, and transcript content never enter logs. OverviewProduction patterns for Prerequisites
InstructionsStep 1: Singleton Client (TypeScript)
Step 2: Text-to-Speech with Aura
Step 3: Audio Intelligence Pipeline
deepgram-upgrade-migration
View full skill →
Plan and execute Deepgram SDK upgrades and model migrations.
ReadWriteEditGrepBash(npm:*)Bash(pip:*)
Deepgram Upgrade MigrationPrerequisites
ExamplesUpgrade the SDK in staging, run mock/unit tests and a small licensed-fixture comparison against the prior version, and compare aggregate output/latency/error metrics. Promote through an approved canary only after acceptance passes; revert to the prior lockfile/configuration on regression and do not reprocess production recordings to validate the upgrade. Current State! OverviewGuide for Deepgram SDK version upgrades (v3 -> v4 -> v5) and model migrations (Nova-2 -> Nova-3). Includes breaking change maps, side-by-side API comparison, A/B testing scripts, automated validation, and rollback procedures. SDK Version History
InstructionsStep 1: Identify Current Version and Breaking Changes
Step 2: v3/v4 to v5 Migration Map
deepgram-webhooks-events
View full skill →
Implement Deepgram callback and webhook handling for async transcription.
ReadWriteEditBash(curl:*)
Deepgram Webhooks & CallbacksPrerequisites
ExamplesValidate the callback signature before parsing its body, deduplicate by an opaque event ID, acknowledge promptly, and write only state/result metadata to logs. Test with a development event; retry transient failures with bounded backoff and quarantine terminal failures rather than replaying audio/transcripts blindly. OverviewImplement async transcription with Deepgram's callback feature. When you pass a Deepgram Callback Flow
InstructionsStep 1: Submit Async Transcription
Step 2: Callback ServerHow It WorksReady to use deepgram-pack?Related Pluginssupabase-packComplete Supabase integration skill pack with 30 skills covering authentication, database, storage, realtime, edge functions, and production operations. Flagship+ tier vendor pack. /plugin install supabase-pack@claude-code-plugins-plus
vercel-packComplete Vercel integration skill pack with 30 skills covering deployments, edge functions, preview environments, performance optimization, and production operations. Flagship+ tier vendor pack. /plugin install vercel-pack@claude-code-plugins-plus
clay-packComplete Clay integration skill pack with 30 skills covering data enrichment, waterfall workflows, AI agents, and GTM automation. Flagship+ tier vendor pack. /plugin install clay-pack@claude-code-plugins-plus
cursor-packComplete Cursor integration skill pack with 30 skills covering AI code editing, composer workflows, codebase indexing, and productivity features. Flagship+ tier vendor pack. /plugin install cursor-pack@claude-code-plugins-plus
exa-packComplete Exa integration skill pack with 30 skills covering neural search, semantic retrieval, web search API, and AI-powered discovery. Flagship+ tier vendor pack. /plugin install exa-pack@claude-code-plugins-plus
firecrawl-packComplete Firecrawl integration skill pack with 30 skills covering web scraping, crawling, markdown conversion, and LLM-ready data extraction. Flagship+ tier vendor pack. /plugin install firecrawl-pack@claude-code-plugins-plus
Tags
deepgramspeech-to-texttranscriptionvoiceaudioasrreal-timevoice-ai
|