Transcribe API

Voice-to-text transcription tokens, history, and usage tracking

The Transcribe API provides Deepgram token vending for real-time WebSocket transcription, transcription history management, audio storage, and usage tracking.

Base URL

https://api.do.dev/v1/transcribe

Authentication

Transcribe endpoints require API key authentication with appropriate scopes.

ScopeDescription
transcribe:tokenGenerate Deepgram transcription tokens
transcribe:historyManage transcription history and audio
transcribe:usageView usage statistics and limits
transcribe:*Full transcribe access

Endpoints

Token

MethodPathScopeDescription
GET/v1/transcribe/tokentranscribe:tokenGenerate a temporary Deepgram token for WebSocket transcription

The token endpoint vends short-lived Deepgram JWT tokens (30s TTL) for client-side WebSocket connections. The WebSocket connection stays open after the token expires -- the token is only validated at connection time.

Usage limits are checked before vending a token.

curl -H "Authorization: Bearer do_live_..." \
  https://api.do.dev/v1/transcribe/token
{
  "token": "eyJ...",
  "expiresIn": 30,
  "remaining": 950
}

History

MethodPathScopeDescription
GET/v1/transcribe/historytranscribe:historyList transcription history
POST/v1/transcribe/historytranscribe:historyAdd a transcription entry
DELETE/v1/transcribe/history/{id}transcribe:historyDelete a history entry

List History

curl -H "Authorization: Bearer do_live_..." \
  "https://api.do.dev/v1/transcribe/history?limit=20&offset=0"

Add History Entry

curl -X POST -H "Authorization: Bearer do_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "rawTranscript": "hello world",
    "cleanedText": "Hello, world.",
    "durationMs": 2500,
    "targetApp": "notes",
    "confidence": 0.95,
    "wordCount": 2
  }' \
  https://api.do.dev/v1/transcribe/history
FieldTypeRequiredDescription
rawTranscriptstringYesRaw transcript from Deepgram
cleanedTextstringYesCleaned/formatted text
durationMsnumberYesRecording duration in milliseconds
targetAppstringNoTarget application name
tonestringNoTone/style applied
confidencenumberNoDeepgram confidence score
wordCountnumberNoWord count
audioDurationSecnumberNoDeepgram audio duration in seconds
modelstringNoDeepgram model used
requestIdstringNoDeepgram request ID

Audio Storage

MethodPathScopeDescription
POST/v1/transcribe/history/audio/upload-urltranscribe:historyGet a pre-signed upload URL
POST/v1/transcribe/history/{id}/audiotranscribe:historyAttach uploaded audio to a history entry
GET/v1/transcribe/history/{id}/audiotranscribe:historyGet audio download URL

Audio storage uses Convex file storage. Upload flow:

  1. Request an upload URL via POST /history/audio/upload-url
  2. Upload the audio file directly to the returned URL
  3. Attach the resulting storageId to a history entry via POST /history/{id}/audio

Usage

MethodPathScopeDescription
GET/v1/transcribe/usagetranscribe:usageCurrent month usage stats
GET/v1/transcribe/usage/dailytranscribe:usageDaily usage breakdown
GET/v1/transcribe/usage/check-limittranscribe:usageCheck remaining quota

Get Usage

curl -H "Authorization: Bearer do_live_..." \
  "https://api.do.dev/v1/transcribe/usage?months=3"

Returns monthly usage including dictation count, audio minutes, word count, and estimated cost.

Check Limits

curl -H "Authorization: Bearer do_live_..." \
  "https://api.do.dev/v1/transcribe/usage/check-limit?timezone=America/New_York"
{
  "allowed": true,
  "dailyWordsUsed": 250,
  "dailyWordsLimit": 1000,
  "dailyWordsRemaining": 750,
  "weeklyWordsUsed": 1200,
  "weeklyWordsLimit": 3000,
  "weeklyWordsRemaining": 1800,
  "limitType": null,
  "plan": "hobby"
}