[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F9RRCK2KDRMW0ED8CT577W":3,"skill-same:01M6F9RRCK2KDRMW0ED8CT577W":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":65,"ownerHtmlUrl":66,"ownerBlogUrl":6,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6F9RRCK2KDRMW0ED8CT577W","deepgram-cost-tuning",null,"Optimize Deepgram costs and usage for budget-conscious deployments.\nUse when reducing transcription costs, implementing usage controls,\nor optimizing pricing tier utilization.\nTrigger: \"deepgram cost\", \"reduce deepgram spending\", \"deepgram pricing\",\n\"deepgram budget\", \"optimize deepgram usage\", \"deepgram billing\".","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fdeepgram-cost-tuning\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000040","财务",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"deepgram cost tuning","deepgram","tuning","cost","use","billing","controls","trigger","io","optimize","deployments","openclaw","edit","write","read","Bash","Budget","Optimization","code","pricing","2026-11-10 10:12:30",false,"---\nname: deepgram-cost-tuning\ndescription: |\n  Optimize Deepgram costs and usage for budget-conscious deployments.\n  Use when reducing transcription costs, implementing usage controls,\n  or optimizing pricing tier utilization.\n  Trigger: \"deepgram cost\", \"reduce deepgram spending\", \"deepgram pricing\",\n  \"deepgram budget\", \"optimize deepgram usage\", \"deepgram billing\".\nallowed-tools: Read, Write, Edit, Bash(ffmpeg:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code, codex, openclaw\ntags: [saas, deepgram, cost-optimization, billing]\n\n---\n# Deepgram Cost Tuning\n\n## Overview\nOptimize 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.\n\n## Deepgram Pricing (2026)\n\n| Product | Model | Price\u002FMinute | Notes |\n|---------|-------|-------------|-------|\n| STT (Batch) | Nova-3 | $0.0043 | Best accuracy |\n| STT (Batch) | Nova-2 | $0.0043 | Proven stable |\n| STT (Streaming) | Nova-3 | $0.0059 | Real-time |\n| STT (Streaming) | Nova-2 | $0.0059 | Real-time |\n| STT (Batch) | Base | $0.0048 | Fastest |\n| STT (Batch) | Whisper | $0.0048 | Multilingual |\n| TTS | Aura-2 | Pay-per-character | See TTS pricing |\n| Intelligence | Summarize\u002FTopics\u002FSentiment | Included with STT | No extra cost |\n\n**Add-on costs:**\n- Diarization: +$0.0044\u002Fmin\n- Multichannel: billed per channel\n\n## Instructions\n\n### Step 1: Budget-Aware Transcription Service\n\n```typescript\nimport { createClient } from '@deepgram\u002Fsdk';\n\ninterface BudgetConfig {\n  monthlyLimitUsd: number;\n  warningThreshold: number;  \u002F\u002F 0.0-1.0 (e.g., 0.8 = warn at 80%)\n  costPerMinute: number;     \u002F\u002F Base STT cost\n}\n\nclass BudgetAwareTranscriber {\n  private client: ReturnType\u003Ctypeof createClient>;\n  private config: BudgetConfig;\n  private monthlySpendUsd = 0;\n  private monthlyMinutes = 0;\n\n  constructor(apiKey: string, config: BudgetConfig) {\n    this.client = createClient(apiKey);\n    this.config = config;\n  }\n\n  async transcribe(source: any, options: any) {\n    \u002F\u002F Estimate cost before transcription\n    const estimatedCost = this.estimateCost(options);\n    const projected = this.monthlySpendUsd + estimatedCost;\n\n    if (projected > this.config.monthlyLimitUsd) {\n      throw new Error(\n        `Budget exceeded: $${this.monthlySpendUsd.toFixed(2)} spent, ` +\n        `$${this.config.monthlyLimitUsd} limit`\n      );\n    }\n\n    if (projected > this.config.monthlyLimitUsd * this.config.warningThreshold) {\n      console.warn(\n        `Budget warning: ${((projected \u002F this.config.monthlyLimitUsd) * 100).toFixed(0)}% ` +\n        `of $${this.config.monthlyLimitUsd} limit`\n      );\n    }\n\n    const { result, error } = await this.client.listen.prerecorded.transcribeUrl(\n      source, options\n    );\n    if (error) throw error;\n\n    \u002F\u002F Track actual usage\n    const duration = result.metadata.duration \u002F 60;  \u002F\u002F Convert to minutes\n    const actualCost = this.calculateCost(duration, options);\n    this.monthlyMinutes += duration;\n    this.monthlySpendUsd += actualCost;\n\n    return result;\n  }\n\n  private estimateCost(options: any): number {\n    \u002F\u002F Conservative estimate — assume 5 minutes per file\n    return this.calculateCost(5, options);\n  }\n\n  private calculateCost(minutes: number, options: any): number {\n    let cost = minutes * this.config.costPerMinute;\n    if (options.diarize) cost += minutes * 0.0044;  \u002F\u002F Diarization add-on\n    return cost;\n  }\n\n  getUsageSummary() {\n    return {\n      minutesUsed: this.monthlyMinutes.toFixed(1),\n      spentUsd: this.monthlySpendUsd.toFixed(4),\n      remainingUsd: (this.config.monthlyLimitUsd - this.monthlySpendUsd).toFixed(4),\n      utilizationPercent: ((this.monthlySpendUsd \u002F this.config.monthlyLimitUsd) * 100).toFixed(1),\n    };\n  }\n}\n\n\u002F\u002F Usage:\nconst transcriber = new BudgetAwareTranscriber(process.env.DEEPGRAM_API_KEY!, {\n  monthlyLimitUsd: 100,\n  warningThreshold: 0.8,\n  costPerMinute: 0.0043,\n});\n```\n\n### Step 2: Reduce Billable Minutes with Audio Preprocessing\n\n```bash\n# Remove silence — can save 10-40% of billable minutes\nffmpeg -i input.wav \\\n  -af \"silenceremove=stop_periods=-1:stop_duration=0.5:stop_threshold=-30dB\" \\\n  -ar 16000 -ac 1 -acodec pcm_s16le \\\n  trimmed.wav\n\n# Speed up audio (1.25x) — saves 20% of billable minutes\n# Deepgram handles slightly sped-up audio well\nffmpeg -i input.wav \\\n  -filter:a \"atempo=1.25\" \\\n  -ar 16000 -ac 1 -acodec pcm_s16le \\\n  faster.wav\n```\n\n```typescript\nimport { execSync } from 'child_process';\n\nfunction measureSavings(inputPath: string) {\n  \u002F\u002F Get original duration\n  const origDuration = parseFloat(\n    execSync(`ffprobe -v quiet -show_entries format=duration -of csv=p=0 \"${inputPath}\"`)\n      .toString().trim()\n  );\n\n  \u002F\u002F Remove silence\n  execSync(`ffmpeg -y -i \"${inputPath}\" \\\n    -af \"silenceremove=stop_periods=-1:stop_duration=0.5:stop_threshold=-30dB\" \\\n    -ar 16000 -ac 1 -acodec pcm_s16le \u002Ftmp\u002Ftrimmed.wav 2>\u002Fdev\u002Fnull`);\n\n  const trimmedDuration = parseFloat(\n    execSync(`ffprobe -v quiet -show_entries format=duration -of csv=p=0 \u002Ftmp\u002Ftrimmed.wav`)\n      .toString().trim()\n  );\n\n  const savings = ((1 - trimmedDuration \u002F origDuration) * 100).toFixed(1);\n  const costSaved = ((origDuration - trimmedDuration) \u002F 60 * 0.0043).toFixed(4);\n\n  console.log(`Original: ${origDuration.toFixed(1)}s`);\n  console.log(`Trimmed: ${trimmedDuration.toFixed(1)}s`);\n  console.log(`Savings: ${savings}% (${costSaved}\u002Ffile at $0.0043\u002Fmin)`);\n}\n```\n\n### Step 3: Query Deepgram Usage API\n\n```typescript\nimport { createClient } from '@deepgram\u002Fsdk';\n\nasync function getUsageDashboard(projectId: string) {\n  const client = createClient(process.env.DEEPGRAM_API_KEY!);\n\n  \u002F\u002F Get usage for current month\n  const now = new Date();\n  const monthStart = new Date(now.getFullYear(), now.getMonth(), 1);\n\n  const { result } = await client.manage.getUsage(projectId, {\n    start: monthStart.toISOString(),\n    end: now.toISOString(),\n  });\n\n  \u002F\u002F Aggregate by model\n  const byModel: Record\u003Cstring, { minutes: number; cost: number }> = {};\n  for (const entry of (result as any).results ?? []) {\n    const model = entry.model ?? 'unknown';\n    if (!byModel[model]) byModel[model] = { minutes: 0, cost: 0 };\n    byModel[model].minutes += (entry.hours ?? 0) * 60 + (entry.minutes ?? 0);\n  }\n\n  console.log('=== Monthly Usage ===');\n  for (const [model, data] of Object.entries(byModel)) {\n    const cost = data.minutes * 0.0043;\n    console.log(`${model}: ${data.minutes.toFixed(1)} min ($${cost.toFixed(2)})`);\n  }\n\n  \u002F\u002F Monthly projection\n  const dayOfMonth = now.getDate();\n  const daysInMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate();\n  const totalMinutes = Object.values(byModel).reduce((s, d) => s + d.minutes, 0);\n  const projectedMinutes = (totalMinutes \u002F dayOfMonth) * daysInMonth;\n  const projectedCost = projectedMinutes * 0.0043;\n\n  console.log(`\\nProjected monthly: ${projectedMinutes.toFixed(0)} min ($${projectedCost.toFixed(2)})`);\n}\n```\n\n### Step 4: Cost-Optimized Model Selection\n\n```typescript\nfunction recommendModel(params: {\n  qualityNeeded: 'high' | 'medium' | 'low';\n  isRealtime: boolean;\n  languages: string[];\n  budgetPerMinute?: number;\n}): { model: string; pricePerMin: number; reason: string } {\n  const { qualityNeeded, isRealtime, languages, budgetPerMinute } = params;\n\n  \u002F\u002F Multilingual -> Whisper\n  if (languages.length > 1 || !['en', 'es', 'fr', 'de'].includes(languages[0])) {\n    return { model: 'whisper-large', pricePerMin: 0.0048, reason: 'Multilingual support' };\n  }\n\n  \u002F\u002F Budget constraint\n  if (budgetPerMinute !== undefined && budgetPerMinute \u003C 0.005) {\n    return { model: 'nova-2', pricePerMin: 0.0043, reason: 'Best price per quality' };\n  }\n\n  \u002F\u002F Real-time -> Nova-3 (streaming price $0.0059\u002Fmin)\n  if (isRealtime) {\n    return { model: 'nova-3', pricePerMin: 0.0059, reason: 'Best real-time accuracy' };\n  }\n\n  \u002F\u002F Quality based\n  switch (qualityNeeded) {\n    case 'high':\n      return { model: 'nova-3', pricePerMin: 0.0043, reason: 'Highest accuracy' };\n    case 'medium':\n      return { model: 'nova-2', pricePerMin: 0.0043, reason: 'Good accuracy, proven' };\n    case 'low':\n      return { model: 'base', pricePerMin: 0.0048, reason: 'Fastest processing' };\n  }\n}\n```\n\n### Step 5: Feature Cost Awareness\n\n```typescript\n\u002F\u002F Feature cost breakdown per minute of audio\nconst featureCosts: Record\u003Cstring, { cost: number; description: string }> = {\n  \u002F\u002F Free features (included with STT)\n  smart_format:   { cost: 0,      description: 'Punctuation + paragraphs + numerals' },\n  punctuate:      { cost: 0,      description: 'Punctuation only' },\n  paragraphs:     { cost: 0,      description: 'Paragraph formatting' },\n  summarize:      { cost: 0,      description: 'AI summary (included with STT)' },\n  detect_topics:  { cost: 0,      description: 'Topic detection (included)' },\n  sentiment:      { cost: 0,      description: 'Sentiment analysis (included)' },\n  intents:        { cost: 0,      description: 'Intent recognition (included)' },\n  redact:         { cost: 0,      description: 'PII redaction (included)' },\n\n  \u002F\u002F Paid add-ons\n  diarize:        { cost: 0.0044, description: 'Speaker identification (+$0.0044\u002Fmin)' },\n  multichannel:   { cost: 0.0043, description: 'Per-channel billing (1x STT cost per channel)' },\n};\n\nfunction estimateJobCost(params: {\n  durationMinutes: number;\n  model: string;\n  features: string[];\n  channels?: number;\n}): number {\n  const baseCost = params.durationMinutes * 0.0043;\n  let addOnCost = 0;\n\n  for (const feature of params.features) {\n    addOnCost += (featureCosts[feature]?.cost ?? 0) * params.durationMinutes;\n  }\n\n  \u002F\u002F Multichannel: billed per channel\n  const channelMultiplier = params.channels ?? 1;\n\n  return (baseCost + addOnCost) * channelMultiplier;\n}\n\n\u002F\u002F Example: 60 min meeting with diarization\n\u002F\u002F estimateJobCost({ durationMinutes: 60, model: 'nova-3', features: ['diarize'] })\n\u002F\u002F = (60 * 0.0043) + (60 * 0.0044) = $0.258 + $0.264 = $0.522\n```\n\n## Output\n- Budget-aware transcription with auto-blocking\n- Audio preprocessing to reduce billable minutes\n- Usage dashboard via Deepgram API\n- Cost-optimized model recommendation\n- Feature cost breakdown with estimation\n\n## Cost Optimization Quick Wins\n\n| Strategy | Savings | Effort |\n|----------|---------|--------|\n| Remove silence from audio | 10-40% | Low (ffmpeg one-liner) |\n| Disable diarization when not needed | ~50% | Low (remove option) |\n| Use callback for long files | Indirect (no timeouts) | Low |\n| Cache repeated transcriptions | 20-60% | Medium (Redis) |\n| Speed up audio 1.25x | 20% | Low (ffmpeg) |\n| Use Nova-2 instead of Nova-3 | 0% (same price) | None |\n| Batch pre-recorded vs streaming | 37% ($0.0043 vs $0.0059) | Medium |\n\n## Error Handling\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Budget exceeded | No controls | Enable budget check before transcription |\n| Unexpected charges | Diarization always on | Make diarization opt-in |\n| Usage API empty | Wrong project ID | Get ID from `getProjects()` |\n| Cost spike | Batch job without limits | Set concurrency limits + budget cap |\n\n## Resources\n- [Deepgram Pricing](https:\u002F\u002Fdeepgram.com\u002Fpricing)\n- [Usage API](https:\u002F\u002Fdevelopers.deepgram.com\u002Freference\u002Fget-usage)\n- [Cost Optimization Guide](https:\u002F\u002Fdevelopers.deepgram.com\u002Fdocs\u002Fcost-optimization)\n\n","# Deepgram Cost Tuning\n\n## Overview\nOptimize 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.\n\n## Deepgram Pricing (2026)\n\n| Product | Model | Price\u002FMinute | Notes |\n|---------|-------|-------------|-------|\n| STT (Batch) | Nova-3 | $0.0043 | Best accuracy |\n| STT (Batch) | Nova-2 | $0.0043 | Proven stable |\n| STT (Streaming) | Nova-3 | $0.0059 | Real-time |\n| STT (Streaming) | Nova-2 | $0.0059 | Real-time |\n| STT (Batch) | Base | $0.0048 | Fastest |\n| STT (Batch) | Whisper | $0.0048 | Multilingual |\n| TTS | Aura-2 | Pay-per-character | See TTS pricing |\n| Intelligence | Summarize\u002FTopics\u002FSentiment | Included with STT | No extra cost |\n\n**Add-on costs:**\n- Diarization: +$0.0044\u002Fmin\n- Multichannel: billed per channel\n\n## Instructions\n\n### Step 1: Budget-Aware Transcription Service\n\n```typescript\nimport { createClient } from '@deepgram\u002Fsdk';\n\ninterface BudgetConfig {\n  monthlyLimitUsd: number;\n  warningThreshold: number;  \u002F\u002F 0.0-1.0 (e.g., 0.8 = warn at 80%)\n  costPerMinute: number;     \u002F\u002F Base STT cost\n}\n\nclass BudgetAwareTranscriber {\n  private client: ReturnType\u003Ctypeof createClient>;\n  private config: BudgetConfig;\n  private monthlySpendUsd = 0;\n  private monthlyMinutes = 0;\n\n  constructor(apiKey: string, config: BudgetConfig) {\n    this.client = createClient(apiKey);\n    this.config = config;\n  }\n\n  async transcribe(source: any, options: any) {\n    \u002F\u002F Estimate cost before transcription\n    const estimatedCost = this.estimateCost(options);\n    const projected = this.monthlySpendUsd + estimatedCost;\n\n    if (projected > this.config.monthlyLimitUsd) {\n      throw new Error(\n        `Budget exceeded: $${this.monthlySpendUsd.toFixed(2)} spent, ` +\n        `$${this.config.monthlyLimitUsd} limit`\n      );\n    }\n\n    if (projected > this.config.monthlyLimitUsd * this.config.warningThreshold) {\n      console.warn(\n        `Budget warning: ${((projected \u002F this.config.monthlyLimitUsd) * 100).toFixed(0)}% ` +\n        `of $${this.config.monthlyLimitUsd} limit`\n      );\n    }\n\n    const { result, error } = await this.client.listen.prerecorded.transcribeUrl(\n      source, options\n    );\n    if (error) throw error;\n\n    \u002F\u002F Track actual usage\n    const duration = result.metadata.duration \u002F 60;  \u002F\u002F Convert to minutes\n    const actualCost = this.calculateCost(duration, options);\n    this.monthlyMinutes += duration;\n    this.monthlySpendUsd += actualCost;\n\n    return result;\n  }\n\n  private estimateCost(options: any): number {\n    \u002F\u002F Conservative estimate — assume 5 minutes per file\n    return this.calculateCost(5, options);\n  }\n\n  private calculateCost(minutes: number, options: any): number {\n    let cost = minutes * this.config.costPerMinute;\n    if (options.diarize) cost += minutes * 0.0044;  \u002F\u002F Diarization add-on\n    return cost;\n  }\n\n  getUsageSummary() {\n    return {\n      minutesUsed: this.monthlyMinutes.toFixed(1),\n      spentUsd: this.monthlySpendUsd.toFixed(4),\n      remainingUsd: (this.config.monthlyLimitUsd - this.monthlySpendUsd).toFixed(4),\n      utilizationPercent: ((this.monthlySpendUsd \u002F this.config.monthlyLimitUsd) * 100).toFixed(1),\n    };\n  }\n}\n\n\u002F\u002F Usage:\nconst transcriber = new BudgetAwareTranscriber(process.env.DEEPGRAM_API_KEY!, {\n  monthlyLimitUsd: 100,\n  warningThreshold: 0.8,\n  costPerMinute: 0.0043,\n});\n```\n\n### Step 2: Reduce Billable Minutes with Audio Preprocessing\n\n```bash\n# Remove silence — can save 10-40% of billable minutes\nffmpeg -i input.wav \\\n  -af \"silenceremove=stop_periods=-1:stop_duration=0.5:stop_threshold=-30dB\" \\\n  -ar 16000 -ac 1 -acodec pcm_s16le \\\n  trimmed.wav\n\n# Speed up audio (1.25x) — saves 20% of billable minutes\n# Deepgram handles slightly sped-up audio well\nffmpeg -i input.wav \\\n  -filter:a \"atempo=1.25\" \\\n  -ar 16000 -ac 1 -acodec pcm_s16le \\\n  faster.wav\n```\n\n```typescript\nimport { execSync } from 'child_process';\n\nfunction measureSavings(inputPath: string) {\n  \u002F\u002F Get original duration\n  const origDuration = parseFloat(\n    execSync(`ffprobe -v quiet -show_entries format=duration -of csv=p=0 \"${inputPath}\"`)\n      .toString().trim()\n  );\n\n  \u002F\u002F Remove silence\n  execSync(`ffmpeg -y -i \"${inputPath}\" \\\n    -af \"silenceremove=stop_periods=-1:stop_duration=0.5:stop_threshold=-30dB\" \\\n    -ar 16000 -ac 1 -acodec pcm_s16le \u002Ftmp\u002Ftrimmed.wav 2>\u002Fdev\u002Fnull`);\n\n  const trimmedDuration = parseFloat(\n    execSync(`ffprobe -v quiet -show_entries format=duration -of csv=p=0 \u002Ftmp\u002Ftrimmed.wav`)\n      .toString().trim()\n  );\n\n  const savings = ((1 - trimmedDuration \u002F origDuration) * 100).toFixed(1);\n  const costSaved = ((origDuration - trimmedDuration) \u002F 60 * 0.0043).toFixed(4);\n\n  console.log(`Original: ${origDuration.toFixed(1)}s`);\n  console.log(`Trimmed: ${trimmedDuration.toFixed(1)}s`);\n  console.log(`Savings: ${savings}% (${costSaved}\u002Ffile at $0.0043\u002Fmin)`);\n}\n```\n\n### Step 3: Query Deepgram Usage API\n\n```typescript\nimport { createClient } from '@deepgram\u002Fsdk';\n\nasync function getUsageDashboard(projectId: string) {\n  const client = createClient(process.env.DEEPGRAM_API_KEY!);\n\n  \u002F\u002F Get usage for current month\n  const now = new Date();\n  const monthStart = new Date(now.getFullYear(), now.getMonth(), 1);\n\n  const { result } = await client.manage.getUsage(projectId, {\n    start: monthStart.toISOString(),\n    end: now.toISOString(),\n  });\n\n  \u002F\u002F Aggregate by model\n  const byModel: Record\u003Cstring, { minutes: number; cost: number }> = {};\n  for (const entry of (result as any).results ?? []) {\n    const model = entry.model ?? 'unknown';\n    if (!byModel[model]) byModel[model] = { minutes: 0, cost: 0 };\n    byModel[model].minutes += (entry.hours ?? 0) * 60 + (entry.minutes ?? 0);\n  }\n\n  console.log('=== Monthly Usage ===');\n  for (const [model, data] of Object.entries(byModel)) {\n    const cost = data.minutes * 0.0043;\n    console.log(`${model}: ${data.minutes.toFixed(1)} min ($${cost.toFixed(2)})`);\n  }\n\n  \u002F\u002F Monthly projection\n  const dayOfMonth = now.getDate();\n  const daysInMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate();\n  const totalMinutes = Object.values(byModel).reduce((s, d) => s + d.minutes, 0);\n  const projectedMinutes = (totalMinutes \u002F dayOfMonth) * daysInMonth;\n  const projectedCost = projectedMinutes * 0.0043;\n\n  console.log(`\\nProjected monthly: ${projectedMinutes.toFixed(0)} min ($${projectedCost.toFixed(2)})`);\n}\n```\n\n### Step 4: Cost-Optimized Model Selection\n\n```typescript\nfunction recommendModel(params: {\n  qualityNeeded: 'high' | 'medium' | 'low';\n  isRealtime: boolean;\n  languages: string[];\n  budgetPerMinute?: number;\n}): { model: string; pricePerMin: number; reason: string } {\n  const { qualityNeeded, isRealtime, languages, budgetPerMinute } = params;\n\n  \u002F\u002F Multilingual -> Whisper\n  if (languages.length > 1 || !['en', 'es', 'fr', 'de'].includes(languages[0])) {\n    return { model: 'whisper-large', pricePerMin: 0.0048, reason: 'Multilingual support' };\n  }\n\n  \u002F\u002F Budget constraint\n  if (budgetPerMinute !== undefined && budgetPerMinute \u003C 0.005) {\n    return { model: 'nova-2', pricePerMin: 0.0043, reason: 'Best price per quality' };\n  }\n\n  \u002F\u002F Real-time -> Nova-3 (streaming price $0.0059\u002Fmin)\n  if (isRealtime) {\n    return { model: 'nova-3', pricePerMin: 0.0059, reason: 'Best real-time accuracy' };\n  }\n\n  \u002F\u002F Quality based\n  switch (qualityNeeded) {\n    case 'high':\n      return { model: 'nova-3', pricePerMin: 0.0043, reason: 'Highest accuracy' };\n    case 'medium':\n      return { model: 'nova-2', pricePerMin: 0.0043, reason: 'Good accuracy, proven' };\n    case 'low':\n      return { model: 'base', pricePerMin: 0.0048, reason: 'Fastest processing' };\n  }\n}\n```\n\n### Step 5: Feature Cost Awareness\n\n```typescript\n\u002F\u002F Feature cost breakdown per minute of audio\nconst featureCosts: Record\u003Cstring, { cost: number; description: string }> = {\n  \u002F\u002F Free features (included with STT)\n  smart_format:   { cost: 0,      description: 'Punctuation + paragraphs + numerals' },\n  punctuate:      { cost: 0,      description: 'Punctuation only' },\n  paragraphs:     { cost: 0,      description: 'Paragraph formatting' },\n  summarize:      { cost: 0,      description: 'AI summary (included with STT)' },\n  detect_topics:  { cost: 0,      description: 'Topic detection (included)' },\n  sentiment:      { cost: 0,      description: 'Sentiment analysis (included)' },\n  intents:        { cost: 0,      description: 'Intent recognition (included)' },\n  redact:         { cost: 0,      description: 'PII redaction (included)' },\n\n  \u002F\u002F Paid add-ons\n  diarize:        { cost: 0.0044, description: 'Speaker identification (+$0.0044\u002Fmin)' },\n  multichannel:   { cost: 0.0043, description: 'Per-channel billing (1x STT cost per channel)' },\n};\n\nfunction estimateJobCost(params: {\n  durationMinutes: number;\n  model: string;\n  features: string[];\n  channels?: number;\n}): number {\n  const baseCost = params.durationMinutes * 0.0043;\n  let addOnCost = 0;\n\n  for (const feature of params.features) {\n    addOnCost += (featureCosts[feature]?.cost ?? 0) * params.durationMinutes;\n  }\n\n  \u002F\u002F Multichannel: billed per channel\n  const channelMultiplier = params.channels ?? 1;\n\n  return (baseCost + addOnCost) * channelMultiplier;\n}\n\n\u002F\u002F Example: 60 min meeting with diarization\n\u002F\u002F estimateJobCost({ durationMinutes: 60, model: 'nova-3', features: ['diarize'] })\n\u002F\u002F = (60 * 0.0043) + (60 * 0.0044) = $0.258 + $0.264 = $0.522\n```\n\n## Output\n- Budget-aware transcription with auto-blocking\n- Audio preprocessing to reduce billable minutes\n- Usage dashboard via Deepgram API\n- Cost-optimized model recommendation\n- Feature cost breakdown with estimation\n\n## Cost Optimization Quick Wins\n\n| Strategy | Savings | Effort |\n|----------|---------|--------|\n| Remove silence from audio | 10-40% | Low (ffmpeg one-liner) |\n| Disable diarization when not needed | ~50% | Low (remove option) |\n| Use callback for long files | Indirect (no timeouts) | Low |\n| Cache repeated transcriptions | 20-60% | Medium (Redis) |\n| Speed up audio 1.25x | 20% | Low (ffmpeg) |\n| Use Nova-2 instead of Nova-3 | 0% (same price) | None |\n| Batch pre-recorded vs streaming | 37% ($0.0043 vs $0.0059) | Medium |\n\n## Error Handling\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Budget exceeded | No controls | Enable budget check before transcription |\n| Unexpected charges | Diarization always on | Make diarization opt-in |\n| Usage API empty | Wrong project ID | Get ID from `getProjects()` |\n| Cost spike | Batch job without limits | Set concurrency limits + budget cap |\n\n## Resources\n- [Deepgram Pricing](https:\u002F\u002Fdeepgram.com\u002Fpricing)\n- [Usage API](https:\u002F\u002Fdevelopers.deepgram.com\u002Freference\u002Fget-usage)\n- [Cost Optimization Guide](https:\u002F\u002Fdevelopers.deepgram.com\u002Fdocs\u002Fcost-optimization)\n\n",{"name":5,"tags":52,"author":55,"license":15,"version":56,"description":57,"allowed-tools":58,"compatible-with":59},[53,28,54,32],"saas","cost-optimization","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Optimize Deepgram costs and usage for budget-conscious deployments.\nUse when reducing transcription costs, implementing usage controls,\nor optimizing pricing tier utilization.\nTrigger: \"deepgram cost\", \"reduce deepgram spending\", \"deepgram pricing\",\n\"deepgram budget\", \"optimize deepgram usage\", \"deepgram billing\".\n","Read, Write, Edit, Bash(ffmpeg:*)","claude-code, codex, openclaw","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fdeepgram-cost-tuning",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill deepgram-cost-tuning",{"tool":75,"command":76},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill deepgram-cost-tuning",{"tool":78,"command":79},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill deepgram-cost-tuning","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fjeremylongshore\u002Fclaude-code-plugins-plus-skills\u002Fdeepgram-cost-tuning\u002FSKILL.md",true,[],[84,98,108,117,123,130],{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":94,"publishedAt":47},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[89],{"categoryNo":90,"categoryName":91,"taxonomyType":92,"taxonomyTypeDesc":93},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[95,96,97],"model","model hierarchy","model hierarchy skill",{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":104,"publishedAt":47},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[103],{"categoryNo":90,"categoryName":91,"taxonomyType":92,"taxonomyTypeDesc":93},[105,106,107],"MCP","zoom","zoom mcp",{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":47},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[114,115,116,106],"sdk","zoom apps sdk","apps",{"skillNo":118,"name":119,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":47},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[119],{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":129,"publishedAt":47},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[128],{"categoryNo":90,"categoryName":91,"taxonomyType":92,"taxonomyTypeDesc":93},[125],{"skillNo":131,"name":132,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":47},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[132]]