Documentation Index
Fetch the complete documentation index at: https://docs.tensorstudio.ai/llms.txt
Use this file to discover all available pages before exploring further.
Welcome
The Dhrith ASR API is a batch transcription service for Indian multilingual speech. Upload audio files or provide URLs, submit batches for transcription, track processing progress, and retrieve merged transcripts at scale. Use this API to:- Upload files asynchronously and poll upload status.
- Submit batches from completed uploads and/or explicit GCS keys or URLs.
- Track progress at batch level and fetch merged results per file.
1) Dhrith ASR Overview
Processing flow
- Client sends
POST /files/uploadwith multipart files. - Client polls
GET /files/upload/{batch_upload_id}until uploads complete. - Client sends
POST /batchwithbatch_upload_id,file_ids, and/or asourceslist. - Client polls status endpoints or fetches paginated/downloadable results.
Authentication
Application endpoints require JWT and expect:Authorization: Bearer <JWT_TOKEN>
The token is validated against JWKS. Missing or invalid tokens return 401.
IDs you will use
batch_upload_id: groups files from one upload request.batch_id: groups everything from one transcription submission.file_id: stable ID for one source file/URL and its merged result.
2) Features and Metrics
Core features
- Async file upload: spool-to-disk with background storage upload.
- Batch input support: completed uploads, specific uploaded files by
file_id, explicit GCS keys, and remote audio URLs in one batch request. - File management: list and delete uploaded files.
Operational metrics exposed by API responses
- Upload metrics:
spool_seconds,upload_statusper filecompleted,failed,uploading,pendingcounters
- Submission estimates:
estimated_audio_secondsestimated_completion_seconds
- Batch progress counters:
total_files,files_completed,files_failed,files_processing- In development mode:
total_jobs,completed_jobs,failed_jobs,processing_jobs,queued_jobs
Default pagination behavior
GET /filesand results endpoints default:page=1limit=50- max
limit=200
3) Endpoints and Usage
Base URL examples below usehttps://api.soket.ai/transcribe.
POST /files/upload
Upload one or more audio files. Returns 202 Accepted immediately with a batch_upload_id. Background storage upload continues after the response.
Example
Typical response
GET /files/upload/{batch_upload_id}
Poll upload progress. Returns per-file upload_status and gcs_key for completed files.
Example
GET /files
List all files uploaded by the authenticated user.
Query params
page(default:1)limit(default:50, max:200)upload_status(optional):pending,uploading,completed,failed
Example
DELETE /files
Delete one or more uploaded files by file_id.
Example
POST /batch
Submit a batch for transcription with a JSON body:
batch_upload_id(optional): include all completed files from one uploadfile_ids(optional): list of specificfile_idstrings from prior uploadssources(optional): list of{ gcs_key, filename }or{ url, filename }items
batch_upload_id, file_ids, or sources must resolve to at least one file. All fields can be combined.
Example (from completed upload)
Example (specific file_ids)
Example (upload batch + URLs)
Typical response
GET /status/batch/{batch_id}
Returns aggregate progress across files and chunk jobs in the batch.
Typical response (production)
total_jobs, completed_jobs, failed_jobs, processing_jobs, queued_jobs, and files_processing.
Example
GET /results/batch/{batch_id}
Paginated results endpoint.
Query params
status(optional):completed,failed,retrying,processingpage(default:1)limit(default:50, max:200)raw(default:false)false: merged per-file resultstrue: raw per-job records
chunks(optional bool): include chunk-level results inline when enabledspeech_information(optional bool): include segment-level speech information (tone, accent, speaker_id, timestamps, etc.)
Example (merged, completed-only)
Example (raw job records)
Typical response shape
raw=false(default):
{ batch_id, page, limit, total_pages, total_files, count, files: [...] }raw=true:
{ batch_id, page, limit, total_pages, total_jobs, count, jobs: [...] }- If batch does not exist and no status filter is applied:
{ "error": "batch not found" }
GET /results/file/{file_id}
Returns merged transcript and status for one file.
Query params
chunks(optional bool): include per-chunk detailsspeech_information(optional bool): include segment-level speech information
Example
Typical response shape
- Found file:
{ file_id, filename, status, result?, errors?, chunk_results? } - Not found:
{ "error": "file not found" }
total_chunks, completed_chunks, and failed_chunks are included.
GET /download/batch/{batch_id}
Download all results for a batch as stream.
Query params
status(optional)format(default:ndjson):ndjsonorjsonraw(default:false): raw per-job instead of merged per-filechunks(optional bool): include chunk payloads in merged outputspeech_information(optional bool): include segment-level speech information in merged output
Example (NDJSON export)
Example (JSON export with filter)
4) Examples
Example A: Complete batch lifecycle
Example B: Get one file’s merged transcript
Error handling quick reference
400: invalid input or batch constraints violated.401: missing/invalid JWT.404: upload batch, batch, file, orfile_idsnot found.409: uploads still in progress orfile_idsnot yet completed when submitting batch.429: quota exceeded (if quota checks are enabled).503: queue saturation or operational dependency unavailable.
Notes for production docs
- Keep JWT examples as environment variable placeholders (
$JWT_TOKEN), never hardcoded tokens. - Recommend NDJSON for large exports due to streaming-friendliness.
- For UI polling, use
GET /status/batch/{batch_id}as the lightweight progress endpoint. - Poll
GET /files/upload/{batch_upload_id}before callingPOST /batch.
5) Architecture and Queue Workflow
When a batch is submitted, the system runs a two-stage queue pipeline:- Parent file jobs (one per input file/URL) on the file queue.
- Child chunk jobs (fan-out after chunking) on the chunk queue.
Queue map
asr_file_queue: primary queue for parent jobs submitted byPOST /batch.asr_job_queue: primary queue for chunk jobs created during parent fan-out.file_retry_queue(optional): dedicated retry lane for parent jobs. Only active whenSEPARATE_RETRY_QUEUES=true.job_retry_queue(optional): dedicated retry lane for chunk jobs. Only active whenSEPARATE_RETRY_QUEUES=true.
Retry modes
The system supports two retry modes, controlled by theSEPARATE_RETRY_QUEUES environment variable:
Default (SEPARATE_RETRY_QUEUES=false): failed jobs are automatically re-enqueued on the same primary queue after configured intervals. Simple and reliable.
Separate retry queues (SEPARATE_RETRY_QUEUES=true): Failed jobs are manually re-enqueued onto dedicated retry queues (file_retry_queue, job_retry_queue) by custom failure callbacks. Workers listen on [primary, retry] in that order, so fresh jobs always take priority over retries. Use this when you need retry jobs to have lower scheduling priority than new work.
Related env vars for separate mode:
CHUNK_MAX_RETRIES_SEPARATE(default3): max retry attempts before permanent failure.CHUNK_RETRY_INTERVALS_SEPARATE(default30,60,120): delay in seconds between retry attempts.SAVE_AUDIO_DATA(defaulttrue): whentrue, raw audio bytes and metadata are saved for debugging and replay; set tofalseto skip audio-data persistence.
Major processes
- Upload ingress: auth, size limits, spool-to-disk, background storage upload.
- Batch ingress and validation: auth, limits, back-pressure checks, and job enqueue.
- Parent stage: normalize source input, load source audio, chunk, and enqueue child jobs.
- Chunk stage: inference through direct ASR calls or batch gate coordination.
- Persistence and counters: update job stores and completion counters.
- Finalize and expose: merge chunk transcriptions into parent result, then serve via status/results/download endpoints.
Failure and retry scenarios
- Transient network or inference errors:
- chunk/parent status is marked
retrying - default mode: automatic retries on the same queue with configured intervals
- separate mode: failure callback re-enqueues onto the retry queue with a delay
- work remains isolated to failed jobs/chunks
- chunk/parent status is marked
- Chunk permanently fails after retries:
- chunk marked
failed _on_chunk_terminalstill advances completion accounting- parent finalizes as
partialif at least one chunk failed
- chunk marked
- Parent fails mid-fanout after some chunks enqueued:
- parent marked
failedto avoid duplicate enqueue on retry - already-enqueued child chunks continue to terminal state
- parent marked
- Worker crash or stale in-flight state:
- startup recovery requeues stale in-flight jobs
- stuck chunk recovery marks orphaned processing chunks as failed
- Queue pressure:
- API may reject new batch submissions with
503when queue depth limits are exceeded
- API may reject new batch submissions with