Speech to text

From deepgram/skills · View interactive version

Speech to text is an AI agent skill from the GitHub repository deepgram/skills. Start here for Deepgram speech-to-text. Use when a task says "speech to text", "STT", "transcribe", "transcription", "live transcription", "captions", "diarization", "nova-3", "Flux", "turn detection", or "end of turn". Picks the model family (Nova on /v1/listen for general transcription, Flux STT o

How to use this skill

Skill file

Deepgram Speech-to-Text

Deepgram transcribes audio with two model families on two endpoints. Pick the family first; the endpoint, the parameters, and the message shapes all follow from that choice. This skill gets a first request working and names the skill to open next. It does not repeat the full parameter reference; that lives in the api skill.

Pick the model family first

| | Nova | Flux STT |

|---|---|---|

| Model names | nova-3 (alias of nova-3-general), nova-3-medical, nova-3-pharma | flux-general-en (English), flux-general-multi (10 languages) |

| Endpoint | /v1/listen, REST and WebSocket | /v2/listen, WebSocket only |

| Output | A transcript stream | TurnInfo events carrying turn state and a transcript per turn |

| Turn detection | None built in; you use endpointing and your own logic | Built in: StartOfTurn, EagerEndOfTurn, TurnResumed, EndOfTurn |

| Formatting and analysis | smart_format, diarize_model, summarize, sentiment, topics, intents, redaction | Word timestamps, numerals, redact (numbers or aggressive_numbers), keyterm, profanity_filter, mip_opt_out, tag; no smart formatting, no diarization |

| Language | language=<code>, or language=multi for code-switching, which language_hint biases | The model name selects the language; language_hint biases flux-general-multi |

Decision rule:

First request: Nova on a prerecorded file

Create a key at https://console.deepgram.com and export it as DEEPGRAM_API_KEY. The key goes in the Authorization header with the Token scheme. Always pass model; without it the API falls back to base.

curl -s -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://dpgr.am/spacewalk.wav"}'

The transcript is at results.channels[0].alternatives[0].transcript. To send a local file instead, set Content-Type to the audio type (for example audio/wav) and pass --data-binary @file.wav with no JSON body.

Nova options you will reach for, all query parameters on /v1/listen:

Flux STT: conversational audio with turn detection

Connect over WebSocket. Flux has no REST path.

wss://api.deepgram.com/v2/listen?model=flux-general-en&encoding=linear16&sample_rate=16000

Send the same Authorization: Token header. Audio must be mono. For raw audio (linear16, linear32, mulaw, alaw, opus, ogg-opus) encoding and sample_rate are required; for WAV, Ogg, or WebM containers omit both. Send 80 ms chunks. Flux STT has no KeepAlive message: WebSocket pings replace it, with a 60-second timeout. For in-region processing use wss://api.eu.deepgram.com/v2/listen, wss://api.au.deepgram.com/v2/listen, or wss://api.in.deepgram.com/v2/listen with the same key.

Two query parameters on /v2/listen to note:

The server sends Connected, then a stream of TurnInfo messages. Each carries event, turn_index, transcript, words with timestamps, and end_of_turn_confidence. The event values:

Three query parameters tune turn detection, and all three can change mid-stream through the Configure message below:

| Parameter | Range | Default | Effect |

|---|---|---|---|

| eot_threshold | 0.5 to 1.0 | 0.7 | Confidence needed for EndOfTurn. 1.0 suppresses model detection. |

| eager_eot_threshold | 0.3 to 0.9 | unset | Enables EagerEndOfTurn. Lower values fire earlier with more false starts. Must be less than or equal to eot_threshold. |

| eot_timeout_ms | 500 to 60000 | 5000 | Silence that forces EndOfTurn regardless of confidence. |

Client control messages, each a JSON text frame:

For non-English or mixed-language calls use model=flux-general-multi, optionally with repeated language_hint=<code> parameters (for example language_hint=en&language_hint=es). Without hints the model detects the language itself. TurnInfo then includes languages and languages_hinted. numerals formats every number on flux-general-en; on flux-general-multi it formats English, Spanish, French, German, Russian, Portuguese, Italian, and Dutch, and leaves Hindi and Japanese numbers as spoken.

Common mistakes

  1. Authorization: Bearer <api key> returns 401. API keys use Authorization: Token <key>. Bearer is only for the short-lived JWT that POST /v1/auth/grant issues.
  2. A 403 with {"err_code":"INSUFFICIENT_PERMISSIONS","err_msg":"Project does not have access to the requested model."} comes back both for a misspelled model name and for a real model the project cannot use. The body carries a request_id. Check the spelling before asking for access. GET https://api.deepgram.com/v1/models lists the public catalog; GET /v1/projects/{project_id}/models lists your project's models. There is no model named nova-3-conversational; conversational audio is Flux, flux-general-en. The public catalog does not list the Flux model names, so the Flux docs are the source for those.
  3. Flux on /v1/listen does not work, and model=flux is not a valid value. Use /v2/listen with flux-general-en or flux-general-multi.
  4. language=en or language=multi on Flux is wrong. The model name selects the language. On /v2/listen, language_hint is accepted only by flux-general-multi and returns 400 on any other model.
  5. Setting encoding or sample_rate for containerized audio (WAV, Ogg, WebM) causes errors or garbled output. Omit both and let the container declare the format.
  6. ForceEndTurn on /v1/listen returns an error; it exists only on Flux.
  7. smart_format, diarize, and the intelligence parameters are not available on /v2/listen. Speaker labels and summaries are a Nova job.
  8. A KeepAlive sent as a binary frame is mishandled. Send control messages as text frames and audio as binary frames.
  9. {"type":"Configure","features":{"numerals":true}} is the /v1/listen form. Flux STT rejects the features nesting and closes the connection; on /v2/listen send numerals as a top-level field, {"type":"Configure","numerals":true}.

Pricing

Deepgram bills speech-to-text per minute of audio. Figures change, so read them at https://deepgram.com/pricing rather than from any skill.

Use a different skill when

Sources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.