deepgram/deepgram-python-sdk

Official Python SDK for Deepgram.

What it solves

This SDK provides a standardized way for Python developers to integrate Deepgram's AI models for speech-to-text, text-to-speech, and language understanding into their applications, eliminating the need to write raw API requests.

How it works

The SDK acts as a wrapper around Deepgram's APIs, offering both synchronous and asynchronous clients. It supports multiple interaction patterns:

  • Real-time Streaming: Uses WebSockets for live speech recognition and interactive voice agents.
  • File Processing: Handles the upload and transcription of pre-recorded audio files.
  • Audio Generation: Converts text into natural-sounding speech.
  • Text Analysis: Processes text to detect sentiment, topics, and intents.
  • Custom Transports: Allows developers to replace the default WebSocket transport with custom implementations, including a specialized transport for AWS SageMaker endpoints.

Who it’s for

Developers building voice-enabled applications, conversational AI agents, automated transcription services, or text analysis tools.

Highlights

  • Comprehensive Modalities: Supports Speech-to-Text (Listen), Text-to-Speech (Speak), and Text Intelligence (Read).
  • Conversational AI: Built-in support for creating interactive voice agents that combine listening, thinking (via LLMs like GPT-4o-mini), and speaking.
  • Async Support: Full async/await capabilities for non-blocking I/O operations.
  • Flexible Authentication: Supports both API keys for server-side use and temporary access tokens for client-side security.
  • Extensible Networking: Supports custom HTTP clients and transport factories for alternative protocols or cloud deployments.

Related

  • Project
  • Project
  • Project
  • Project
  • Project