Audio transcription
Introduction
Discover authorized source IDs using GET /v1/audio/transcription-models.
curl 'https://api.anycap.io/v1/audio/transcription-models' -H 'Authorization: Bearer YOUR_ANYCAP_KEY'Upload a private recording and retrieve a transcript, detected language, duration and segment timestamps. Capability key: audio.asr. Duration-priced sources use the measured uploaded recording length, rounded up to seconds, and charge only after successful transcription. Read the quote for the credit amount.
1. Upload a recording
WAV and MP3 are supported, up to 15 MiB and 10 minutes. Use the returned id as audio_file_id. Uploads and transcript results are retained for 72 hours.
curl 'https://api.anycap.io/v1/transcription-materials?kind=audio' -H 'Authorization: Bearer YOUR_ANYCAP_KEY' -F '[email protected]'2. Quote and submit
Select an authorized resource_id from the capability source list. Quote and submit with the same recording and language. Submission returns HTTP 202 and a job object.
curl 'https://api.anycap.io/api/v1/capabilities/audio.asr/quotes' -H 'Authorization: Bearer YOUR_ANYCAP_KEY' -H 'Content-Type: application/json' -d '{"resource_id":"SOURCE_UUID","audio_file_id":"FILE_UUID","language":"zh"}'curl 'https://api.anycap.io/api/v1/capabilities/audio.asr/executions' -H 'Authorization: Bearer YOUR_ANYCAP_KEY' -H 'Content-Type: application/json' -d '{"resource_id":"SOURCE_UUID","audio_file_id":"FILE_UUID","language":"zh","quote_id":"QUOTE_UUID","idempotency_key":"YOUR_OPERATION_UUID"}'audio_file_id
language
resource_id
quote_id
idempotency_key
3. Retrieve the transcript
curl 'https://api.anycap.io/api/v1/transcription-executions/JOB_UUID' -H 'Authorization: Bearer YOUR_ANYCAP_KEY'States are queued, submitting, completed, failed and pending. Read result.text when completed; result.segments[] contains start, end (seconds) and text. Expired results are omitted; job history remains readable.
{ "state": "completed", "result": { "text": "你好,欢迎使用音频转文字。", "language": "zh", "duration": 3.2, "segments": [ { "id": 0, "start": 0, "end": 3.2, "text": "你好,欢迎使用音频转文字。" } ] }}| HTTP | Meaning |
|---|---|
| 400 | Invalid audio, language or request |
| 401 / 403 | Check key, organization access and source permissions |
| 409 | Quote or repeated request parameters conflict |
| 429 | Queue or request rate limit reached |