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.
Ask AIPlaygroundLoginFree API Key
HomeAPI ReferenceVoice AgentSpeech-to-TextText-to-SpeechIntelligenceSelf-Hosted Deployments
HomeAPI ReferenceVoice AgentSpeech-to-TextText-to-SpeechIntelligenceSelf-Hosted Deployments
    • Home
    • Ask AI
    • Support
    • Changelog
        • Getting Started
        • Installation
        • Authentication
        • Speech-to-Text
        • Text-to-Speech
        • Text Intelligence
        • Account Management
        • MCP Server
        • Shell Completion
        • Plugin System
      • Agentic developer tools
  • Trust & Security
    • Security Policy
    • Data Privacy Compliance
    • Information Security & Privacy
  • SDKs
    • SDK Features
  • Guides
LogoLogo
Ask AIPlaygroundLoginFree API Key
On this page
  • Prerequisites
  • Quick Start
  • Core Workflows
  • Transcribe audio
  • Text-to-speech
  • Text intelligence
  • Account management
  • Output Formats
  • Agent-Friendly Mode
  • Next Steps
Developer ToolsCommand-Line Interface

Deepgram CLI — Getting Started

Transcribe audio, synthesize speech, and manage your Deepgram account — all from your terminal.

Was this page helpful?
Previous

CLI Installation

Install the Deepgram CLI on macOS, Linux, and Windows.
Next
Built with

The dg CLI gives you full access to Deepgram APIs from your terminal. Transcribe files, stream live audio, synthesize speech, analyze text, and manage your Deepgram account — without writing a single line of code.

Prerequisites

  • Python 3.10 or later
  • A Deepgram API key (get one free)

Quick Start

$# Install
$curl -fsSL deepgram.com/install.sh | sh
$
$# Authenticate
$dg login
$
$# Transcribe an audio file
$dg listen recording.wav
$
$# Synthesize text-to-speech
$dg speak "Hello from Deepgram"

Core Workflows

Transcribe audio

$# Transcribe a local file
$dg listen audio.mp3
$
$# Transcribe from a URL
$dg listen https://example.com/audio.mp3
$
$# Stream from your microphone
$dg listen --mic
$
$# Pipe transcript to another tool
$dg listen audio.mp3 -o json | jq '.results.channels[0].alternatives[0].transcript'

Text-to-speech

$# Generate speech and save to file
$dg speak "Hello from Deepgram" -o hello.wav
$
$# Pipe audio to your speaker
$echo "Latest headlines" | dg speak | ffplay -nodisp -autoexit -

Text intelligence

$# Analyze a document
$dg read report.txt --topics --sentiment --summarize
$
$# Summarize piped text
$cat transcript.txt | dg read --summarize

Account management

$# List your projects
$dg projects list
$
$# Create an API key
$dg keys create "ci-runner"
$
$# Check your usage
$dg usage

Output Formats

The CLI defaults to human-readable output in the terminal. Use -o or --output to switch formats:

$dg listen audio.mp3 -o json # Structured JSON
$dg listen audio.mp3 -o yaml # YAML
$dg listen audio.mp3 -o table # ASCII table
$dg listen audio.mp3 -o csv # CSV

When stdout is a pipe, the CLI automatically switches to JSON.

Agent-Friendly Mode

The CLI auto-detects AI agent environments (Claude Code, Aider, OpenAI Codex, Gemini) and adjusts its behavior:

  • Disables interactive prompts
  • Routes status messages to stderr
  • Defaults to JSON output

To explicitly enable agent-friendly mode:

$dg listen audio.mp3 --agent-friendly

To get machine-readable parameter documentation:

$dg listen --agent-friendly

Next Steps

  • Install the CLI — More installation methods including pip, pipx, and Homebrew
  • Authenticate — Learn about authentication options
  • Speech-to-Text — Full transcription reference
  • Text-to-Speech — Full TTS reference