docs/deepgram.md
Deepgram is a speech AI platform that provides APIs for speech-to-text, text-to-speech, audio intelligence, and related voice features.
Deepgram uses API key authentication. Get your API key from the Deepgram Console.
The API key must have access to the project you want to query. For usage data, the key also needs the usage:read scope for that project.
Set the DEEPGRAM_API_KEY environment variable:
export DEEPGRAM_API_KEY="dg_..."
Optionally set a Deepgram project ID:
export DEEPGRAM_PROJECT_ID="your-project-uuid"
If DEEPGRAM_PROJECT_ID is omitted, CodexBar calls Deepgram's project list endpoint and aggregates usage across all projects visible to the API key.
You can also configure the API key and optional project ID in CodexBar Settings → Providers → Deepgram.
printf '%s' "$DEEPGRAM_API_KEY" | codexbar config set-api-key --provider deepgram --stdin
The Deepgram provider fetches summarized usage data from the Deepgram Management API.
/v1/projects): Lists projects visible to the API key when no project ID is configured./v1/projects/{PROJECT_ID}/usage/breakdown): Returns summarized project usage over a date range. The response includes fields such as start, end, resolution, and results.Each usage result may include:
startendhourstotal_hoursagent_hourstokens_intokens_outtts_charactersrequestsDeepgram's usage breakdown endpoint supports querying with start and end date parameters. The response includes summarized usage results for the selected period.
The Deepgram menu card shows:
Deepgram does not currently provide a credit balance through this provider. The provider displays usage, not remaining credits.
codexbar --provider deepgram
codexbar -p dg # alias
The API key must have permission to read usage data for the configured project.
If the key is valid but lacks the correct scope, Deepgram may return an error like:
INSUFFICIENT_PERMISSIONS
Your account does not have the required scope to perform that action for this project.
Check that your account has the 'usage:read' scope for this project.
In that case, create or update a Deepgram API key with the usage:read scope for the target project.
Authorization: Token <API_KEY> for requests.