Skip to main content
These examples use the Deepgram Nova model; see the Speech-to-Text models for other models and endpoints.

Placeholders

The snippets below use these placeholders. Replace them before running the code.

Basic File Transcription

Upload an audio file (MP3, WAV, FLAC, OGG, M4A, or WebM) and get back the transcribed text. Here is a sample file you can use:
You should get a response like this:

Going further

You can pass additional form fields to customize the transcription:
  • Language: If you know the language, pass language=en (or es, fr, etc.). Not all models auto-detect, so setting this explicitly can improve accuracy.
  • Diarization: Pass diarize=true to identify different speakers in a multi-speaker recording. The response will include a speaker field on each word. PLease check the models documentation for specific diarization config.
  • Punctuation: Pass punctuate=true to add punctuation to the transcript automatically.
For the full parameter list per model, see the Speech-to-Text API reference.

Next Steps

Live STT demo

Try real-time speech recognition in your browser, no setup needed

STT WebSocket examples

Real-time transcription as users speak

Speech-to-Text models

Browse all STT models and endpoints

STT API reference

Endpoint-specific parameters