CLI Authentication

Authenticate the Deepgram CLI with your API key.

Interactive Login

The simplest way to authenticate:

dg login

This opens your browser to the Deepgram Console where you can authorize the CLI. The CLI stores API keys in your operating system keyring when available. Direct API-key login falls back to profile configuration when the keyring is unavailable.

API Key Flag

For CI/CD environments or scripted usage, pass your API key directly:

dg --api-key YOUR_API_KEY listen audio.mp3

Environment Variable

Set your API key as an environment variable:

export DEEPGRAM_API_KEY=YOUR_API_KEY
dg listen audio.mp3

Named Profiles

Use multiple API keys with named profiles:

dg login --profile production
dg login --profile development
# Use a specific profile
dg --profile production listen audio.mp3

Profiles select separate credentials in the system keyring when available, along with separate configuration values.

Check Auth Status

dg whoami

The command reports the active profile, a masked API key, its credential source, and the configured project ID.

CI/CD Usage

For CI/CD pipelines, use the --api-key flag or environment variable:

# Example GitHub Actions
- name: Transcribe audio
env:
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
run: dg -o json listen audio.mp3 > transcript.json