Transcribe Long Recordings
A clip is limited to 30 s. For a longer recording, up to 1 hour, create a job. The flow is always: create the job, wait for it, read the result, delete the job. Results are kept for 7 days.
Upload a file and wait
Use a URL, or get a callback
Pass audio_url instead of file and Dictate downloads the audio. Use it for any file of about 100 MB or more,
which an upload refuses. Pass callback and Dictate calls you when the job is Completed or Failed, so you do
not have to poll.
Check the address early. audio_url and callback.url must start with https://. Dictate refuses an http:// URL,
localhost, and a private or loopback IP address such as https://10.0.0.5/..., at create with 400. Any other host
name is checked when the job runs. A name that points to a private address, or that does not resolve, gives 202, and the job
then ends Failed with invalid_audio_url. A file that cannot be downloaded ends Failed with fetch_failed. Read
error.code when you poll.
The callback body is only {"job_id": "...", "job_state": "Completed"}. It does not hold the result: read it with
jobs.get. Check the X-SARVAM-JOB-CALLBACK-TOKEN header against your auth_token. A callback can arrive more than
once, so make your handler safe to run twice. Dictate retries a failed delivery after 5 s, 30 s, 2 min, 10 min, 30 min
and 1 h.
Good to know
- Upload compressed audio (MP3, M4A, Opus), and set a long timeout for the upload.
- Each
createis a new, billed job. Do not send it again without a reason. - A job that is still running cannot be deleted:
jobs.deletereturns409(conflict_error), and no call stops a running job. Delete it after it isCompletedorFailed. - Poll every 5 s or more. Reads count toward your rate limit.
- The result has the same fields as a clip, plus
sectionsandsegmentswithstart_sandend_stimes. - A job that fails has
job_stateofFailedand anerrorwith acodeandmessage. Unreadable audio is found only when the job runs:createreturns202, then the job endsFailedwithinvalid_audio. Only a clip refuses it up front, with400.