Create an API key first. See authentication. The examples read it from the
API_KEY environment variable.How do I transcribe a file?
1
Create an upload
Send the file’s name, content type and size in bytes. The response has the upload
id, an upload_url and the headers to send with the file.2
Send the file
PUT the file bytes to
upload_url with every returned header. The URL accepts one PUT for 15 minutes. Then call POST /uploads/{id}/complete so the size and type are checked.3
Start the transcript
Send the
upload_id and duration_ms, the recording’s length in milliseconds (20,000 and 10,800,000). Add a fresh Idempotency-Key header. The price is held from your balance and charged when the transcript completes.4
Read the result
Poll
GET /transcripts/{id} every few seconds until status is completed, failed or canceled, or use a webhook. Then call GET /transcripts/{id}/result.What happens if a request is repeated?
Send a newIdempotency-Key for each transcript you want. Repeat a request with the same key to retry it safely: you get the same transcript and are charged once. Reusing a key for a different request returns 409.

