deepgram-python-speech-to-text

Transcribe audio files and streams using the Deepgram Python SDK.

456|139|Updated May 12, 2021
One-click install
npx skills add https://github.com/deepgram/deepgram-python-sdk --skill deepgram-python-speech-to-text
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deepgram-python-speech-to-text
Source: https://github.com/deepgram/deepgram-python-sdk/tree/main/.agents/skills/deepgram-python-speech-to-text
Command: npx skills add https://github.com/deepgram/deepgram-python-sdk --skill deepgram-python-speech-to-text

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writers or developers who maintain Python repos with Deepgram STT code often need a quick, guided way to transcribe audio using the v1 / Listen API, either from prerecorded files via REST or in real time via WebSocket.

Core Features & Use Cases

  • Supports REST transcription endpoints: transcribe_url and transcribe_file for batch or URL-based audio.
  • Supports WebSocket streaming via listen.v1.connect for real-time transcription.
  • Use cases include enabling ASR in Python apps, testing integration, and validating model outputs within a repo.

Quick Start

Create a Deepgram client and call listen.v1.media.transcribe_url or listen.v1.connect to start transcription.

Frequently Asked Questions about deepgram-python-speech-to-text

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I transcribe audio files in Python using the Deepgram SDK?

To transcribe audio files in Python, use the Deepgram SDK to call the transcribe_file REST endpoint for batch processing or transcribe_url for URL-based media. You need a Deepgram API key and compatible audio encoding settings like linear16.

Can I do real-time speech-to-text with Python using a WebSocket connection?

Yes, real-time speech-to-text is supported via the Deepgram SDK using the listen.v1.connect WebSocket streaming endpoint. This enables live audio ingestion for on-the-fly transcription in your Python projects.

What audio encodings and models work with Deepgram transcription in Python?

Deepgram transcription in Python requires compatible audio encoding settings such as linear16 and supports models like nova-3. These configurations ensure accurate speech-to-text processing for both prerecorded files and live audio streams.

Does the Deepgram Python SDK support both REST and WebSocket for speech-to-text?

Yes, the Deepgram Python SDK supports both REST and WebSocket for speech-to-text. Use transcribe_url and transcribe_file REST endpoints for prerecorded audio, or listen.v1.connect WebSocket streaming for real-time transcription.

Why do I need a Deepgram API key for Python speech-to-text integration?

A Deepgram API key is required for Python speech-to-text integration to authenticate your requests to the v1 Listen API. Without valid API keys, the SDK cannot access Deepgram's transcription services for REST or WebSocket endpoints.

What's the difference between batch transcription and live audio ingestion in Python?

Batch transcription processes prerecorded audio files via REST endpoints like transcribe_file, while live audio ingestion uses WebSocket streaming through listen.v1.connect for on-the-fly transcription of real-time audio input.