For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
PlaygroundChangelogSign In
OverviewAPI ReferencePre-recorded STTStreaming STTVoice AgentsSpeech UnderstandingGuardrailsLLM GatewayFAQ
OverviewAPI ReferencePre-recorded STTStreaming STTVoice AgentsSpeech UnderstandingGuardrailsLLM GatewayFAQ
  • Getting started
    • Transcribe a pre-recorded audio file
    • Model selection
    • View model benchmarks
    • Evaluate model accuracy
    • Cloud endpoints & data residency
    • Manage concurrent requests
    • Webhooks
  • Models
    • Medical Mode
  • Features
    • Boost specific terms
    • Label speakers
    • Transcribe multiple audio channels
    • Transcribe audio with mixed languages
    • Correct spelling of terms
    • Include filler words
    • Search for words in transcript
    • Set the start and end of the transcript
  • Guides
      • Migration guide Deepgram to AssemblyAI
      • Migration guide OpenAI to AssemblyAI
      • Migration guide AWS Transcribe to AssemblyAI
      • Migration guide Google Speech-to-Text to AssemblyAI
      • Migration guide Gladia to AssemblyAI
LogoLogo
PlaygroundChangelogSign In
On this page
  • Get Started
  • Side-By-Side Code Comparison
  • Installation
  • Audio File Sources
  • Adding Features
GuidesMigration guides

Migration guide: Deepgram to AssemblyAI

Was this page helpful?
Previous

Migration guide: OpenAI to AssemblyAI

Next
Built with

This guide walks through the process of migrating from Deepgram to AssemblyAI for transcribing pre-recorded audio.

Get Started

Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for a free account and get your API key from your dashboard.

Side-By-Side Code Comparison

Below is a side-by-side comparison of a basic snippet to transcribe a local file by Deepgram and AssemblyAI:

Deepgram
AssemblyAI
1from deepgram import (
2 DeepgramClient,
3 PrerecordedOptions,
4 FileSource,
5)
6
7API_KEY = "YOUR_DG_API_KEY"
8
9AUDIO_FILE = "./example.wav"
10
11def main():
12 try:
13 deepgram = DeepgramClient(API_KEY)
14
15 with open(AUDIO_FILE, "rb") as file:
16 buffer_data = file.read()
17
18 payload: FileSource = {
19 "buffer": buffer_data,
20 }
21
22 options = PrerecordedOptions(
23 model="nova-2",
24 smart_format=True,
25 diarize=True
26 )
27
28 response = deepgram.listen.prerecorded.v("1").transcribe_file(payload, options)
29
30 print(response.to_json(indent=4))
31
32 except Exception as e:
33 print(f"Exception: {e}")
34
35if name == "main":
36 main()

Below is a side-by-side comparison of a basic snippet to transcribe a publicly-accessible URL by Deepgram and AssemblyAI:

Deepgram
AssemblyAI
1from deepgram import (
2 DeepgramClient,
3 PrerecordedOptions
4)
5
6API_KEY = "YOUR_DG_API_KEY"
7
8AUDIO_URL = {
9 "url": "https://dpgr.am/spacewalk.wav"
10}
11
12def main():
13 try:
14 deepgram = DeepgramClient(API_KEY)
15
16 options = PrerecordedOptions(
17 model="nova-2",
18 smart_format=True,
19 diarize=True
20 )
21
22 response = deepgram.listen.prerecorded.v("1").transcribe_url(AUDIO_URL, options)
23
24 print(response.to_json(indent=4))
25
26 except Exception as e:
27 print(f"Exception: {e}")
28
29if name == "main":
30 main()

Here are helpful things to know about our transcribe method:

  • The SDK handles polling under the hood
  • Transcript is directly accessible via transcript.text
  • English is the default language. We recommend specifying speech_models=["universal-3-pro", "universal-2"] for the highest accuracy
  • We have a cookbook for error handling common errors when using our API.

Installation

Deepgram
AssemblyAI
1from deepgram import (
2 DeepgramClient,
3 PrerecordedOptions,
4 FileSource,
5)
6
7API_KEY = "YOUR_DG_API_KEY"
8deepgram = DeepgramClient(API_KEY)

When migrating from Deepgram to AssemblyAI, you’ll first need to handle authentication and SDK setup:

Get your API key from your AssemblyAI dashboard
To follow this guide, install AssemblyAI’s Python SDK by typing this code into your terminal:
pip install assemblyai

Things to know:

  • Store your API key securely in an environment variable
  • API key authentication works the same across all AssemblyAI SDKs

Audio File Sources

Deepgram
AssemblyAI
1# Local Files
2AUDIO_FILE = "example.wav"
3with open(AUDIO_FILE, "rb") as file:
4 buffer_data = file.read()
5
6payload: FileSource = {
7 "buffer": buffer_data,
8}
9
10options = PrerecordedOptions(
11 smart_format=True,
12 summarize="v2",
13)
14
15file_response = deepgram.listen.rest.v("1").transcribe_file(payload, options)
16
17json = file_response.to_json()
18
19#Public URLs
20AUDIO_URL = {
21 "url": "https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav"
22}
23
24options = PrerecordedOptions(
25 smart_format=True,
26 summarize="v2"
27)
28
29url_response = deepgram.listen.rest.v("1").transcribe_url(AUDIO_URL, options)
30
31json = url_response.to_json()

Here are helpful things to know when migrating your audio input handling:

  • There’s no need to specify the audio format to AssemblyAI - it’s auto-detected. AssemblyAI accepts almost every audio/video file type: here is a full list of all our supported file types
  • Our SDK handles file upload and transcription automatically in one step
  • For S3 files, you’ll need to generate pre-signed URLs (see example in cookbook)

Adding Features

Deepgram
AssemblyAI
1options = PrerecordedOptions(
2 model="nova-2",
3 smart_format=True,
4 diarize=True,
5 detect_entities=True
6)
7
8response = deepgram.listen.prerecorded.v("1").transcribe_url(AUDIO_URL, options)

Key differences:

  • Use aai.TranscriptionConfig to specify any extra features that you wish to use
  • The results for Speaker Diarization are stored in transcript.utterances. To see the full transcript response object, refer to our API Reference.
  • Check our documentation for our full list of available features and their parameters