Skip to main content
Deepgram's Docs

Search documentation

Type to search this documentation.

On this pageOverview

CLI Authentication

The simplest way to authenticate:

Shell
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.

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

Shell
dg --api-key YOUR_API_KEY listen audio.mp3

Set your API key as an environment variable:

Shell
export DEEPGRAM_API_KEY=YOUR_API_KEY
dg listen audio.mp3

Use multiple API keys with named profiles:

Shell
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.

Shell
dg whoami

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

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

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

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu