CLI Authentication
Interactive Login
Section titled “Interactive Login”The simplest way to authenticate:
dg loginThis 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
Section titled “API Key Flag”For CI/CD environments or scripted usage, pass your API key directly:
dg --api-key YOUR_API_KEY listen audio.mp3Environment Variable
Section titled “Environment Variable”Set your API key as an environment variable:
export DEEPGRAM_API_KEY=YOUR_API_KEY
dg listen audio.mp3Named Profiles
Section titled “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.mp3Profiles select separate credentials in the system keyring when available, along with separate configuration values.
Check Auth Status
Section titled “Check Auth Status”dg whoamiThe command reports the active profile, a masked API key, its credential source, and the configured project ID.
CI/CD Usage
Section titled “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