Asynchronous speech recognition API
Service endpoint
Environment | Address |
Production |
|
1. Workflow
Offline recognition is an asynchronous task:
Submit task: Provide the model and audio URL. If the submission is successful, the platform returns a
task_id. If the submission fails, the platform returns an error directly without asynchronous processing or a callback.Check task status: Use the
task_idto check the task status. When the task completes successfully, the query returns atranscription_url.Download result: Download the transcription result in JSON format from the
transcription_url.
2. Endpoints and request headers
BASE_URL is the service address provided upon platform activation.
Actions | Method and endpoint |
Submit task |
|
Query task |
|
Download result |
|
Request header | Submit | Query | Description |
| Required | Required |
|
| Required | — |
|
Submit task API
Request parameters
POST /api/v1/services/audio/asr/transcription
{
"model": "Qwen-Audio-ASR-VoicePica-Async",
"input": {
"file_urls": ["https://audio.example.com/meeting.wav"]
},
"parameters": {}
}
Parameter | Type | Required | Description |
| string | Yes | Specifies the customized model to use. Must be |
| object | Yes | The audio input. |
| array[string] | Yes | An array containing a single audio URL. The URL must be absolute and use the |
| object | Model-dependent | Required for |
| string | No | A valid HTTP or HTTPS callback URL. |
3.1.1 parameters
3.1.1.1 Common parameters
Parameter | Type | Description |
| object | Specifies hotwords and their weights. Weights must be integers from 1 to 5. Requires a non-empty object mapping a hotword (key) to its integer weight (value), such as |
| array[string] | Currently, only The language code of the audio to transcribe, such as |
3.1.1.2 Customized model (Qwen-Audio-ASR-VoicePica-Async)
Category | Parameter | Type | Description |
Reference context | context | String | Default: "" A reference context string with a maximum length of 4,096 characters. Must be a string. Dialogue message arrays and |
RAG |
| boolean | Default: true Specifies whether to use the RAG path for hotwords. This parameter can only be passed together with |
VAD and segmentation |
| boolean | Default: null
The model window is 5 minutes. |
| Integer | Default: 600 The minimum duration of silence (in ms) required to mark the end of a speech segment. Must be greater than or equal to 0. | |
| Number | Default: 0.5 The Silero speech probability threshold. Valid range: (0, 1). This parameter is effective only when VAD is enabled. | |
| Integer | Default: 250 The minimum duration of a speech segment in milliseconds (ms). The value must be 80 or greater. | |
| Integer | Default: 200 The padding, in milliseconds (ms), to add to the beginning and end of a speech segment. This value must be 0 or greater and cannot be | |
Audio format, sample rate, and channel processing |
| String | Default: auto
Mono 16-bit little-endian PCM: Mono 32-bit float little-endian PCM: |
| Integer | Default: 16000 Unit: Hz. Range: | |
| boolean | Default: false If | |
| String | Default: channel0
|
Input requirements
Item | Limit |
Number of files | 1 per request |
Audio size | ≤2 GB |
Audio duration | ≤12 hours |
Request body size (JSON) | ≤65,536 bytes |
Format | Supported formats: WAV, MP3, and PCM. |
3.2 Request example
Replace BASE_URL, CONVAI_API_KEY, and the example audio URL with your actual values:
curl --silent --show-error "$BASE_URL/api/v1/services/audio/asr/transcription" \
-H "Authorization: Bearer $CONVAI_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"model": "Qwen-Audio-ASR-VoicePica-Async",
"input": {"file_urls": ["https://audio.example.com/meeting.wav"]},
"parameters": {}
}'
Response parameters
A successful submission returns an HTTP 202 status code to indicate the task has been queued for processing:
{
"output": {
"task_status": "PENDING",
"task_id": "20261026-550e8400-e29b-41d4-a716-446655440000"
},
"request_id": "req-submit-example"
}
Parameter | Type | Description |
| string | The platform task ID. Use this ID to query the task status. This is not the Model Studio task ID. |
| string | The task status. |
| string | The unique ID for the API request. Use this ID for tracking and troubleshooting. This is not the Model Studio request ID. |
Submission failures and duplicate submissions
If a platform submission fails, times out, or encounters any other exception, the task is set to
FAILED. The platform returns an error synchronously. The task will not be processed in the background, trigger a callback, or be billed.Each POST request that passes validation creates an independent task. The platform does not reuse existing tasks, even for submissions with identical content. Do not automatically resubmit requests to avoid duplicate processing and charges, as each successful task is billed individually.
Even if the client does not receive a response, the task may still have been accepted. If you have an
output.task_id, use it to query the task status. If not, contact support with therequest_idand the time of the request to confirm the status. Do not resubmit a POST request to check the task's status.If a submission error response contains an
output.task_id, you can query the task to find the reason for the failure without waiting for a callback. The platform does not return a task ID if validation fails before task creation. The platform may return a 503 error if it does not receive a write confirmation, but you should not use this response to determine the task status.Querying a failed task with a GET request does not re-run it. A timeout failure does not mean the upstream task has been canceled. If a re-transcription is necessary, you must explicitly submit a new task to avoid creating infinite loops.
An accepted task is not canceled if the response is lost or the client disconnects. The API currently does not support canceling, batch querying, or modifying accepted tasks.
4. Query task API
4.1 Request parameters
GET /api/v1/tasks/{task_id}. No request body.
Parameter | Location | Type | Required | Description |
| URL path | string | Yes | The platform |
curl --silent --show-error "$BASE_URL/api/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $CONVAI_API_KEY"
Poll for the task status every 60 seconds with random jitter. If you receive a 429 response, respect the Retry-After header. If your client has a configured callback, query after you receive a notification for the task's final status. If you do not receive a notification, poll at the recommended frequency. This query returns only the status saved on the platform and does not trigger an upstream query or re-transcription. The status remains in a processing state until the platform receives the completion notification from the upstream service.
4.2 Successful response
A successful query returns an HTTP 200 status code. To determine if the task is complete, check the output.task_status field. The following example shows a successful response for a Qwen-Audio-ASR-VoicePica-Async task:
{
"request_id": "req-query-example",
"output": {
"task_id": "20261026-550e8400-e29b-41d4-a716-446655440000",
"task_status": "SUCCEEDED",
"submit_time": "2026-10-26 12:00:00.000",
"scheduled_time": "2026-10-26 12:00:01.000",
"end_time": "2026-10-26 12:00:02.000",
"results": [
{
"file_url": "https://audio.example.com/meeting.wav",
"transcription_url": "https://results.example.com/signed-fun-result.json",
"subtask_status": "SUCCEEDED"
}
]
},
"usage": {"duration": 9}
}
Parameter | Type | Description |
| string | The request ID for this query. This ID is different from the one in the submission request, and the Model Studio request ID is not returned. |
| string | The task ID, which matches the ID from the submission response. |
| string | The task status. See section 4.3 for details. |
| string | The actual submission time of the upstream task. Omitted if not provided by the upstream service. |
| string | The actual scheduled time of the upstream task. Omitted if not provided by the upstream service. |
| string | The actual end time of the upstream task. This does not indicate when the platform finished saving the result. Omitted if not provided. |
| array[object] | The results of the file subtasks. |
| string / null | The original URL submitted by the client. This value becomes null after the request data is cleared. The platform's internal input URL is not returned. |
| string | A temporary signed URL to download the result. This URL is provided only for successful, unexpired tasks. Validity period: 24 hours. To get a new signed URL, query the task again within the 1-month retention period. |
| string | The status of the file subtask. The value is |
| integer / null | The total usage in seconds, calculated by rounding up the audio's original duration in milliseconds (using the HALF_UP method). The duration includes silence and is not aggregated across channels. |
4.3 Task statuses and failure responses
Status | Meaning | Client Action |
| The task is in the upstream service's queue. | Query again later. |
| The submission is being processed, transcription is in progress, or the platform is saving the result. | Query again later. If the task does not complete after a long time, contact support. |
| The platform has reliably saved the result. | Download the result within the retention period. This status does not indicate that charges have been settled. |
| The task has failed. | Check the |
If a task fails, a download URL is not provided and the usage field is null. The task status remains RUNNING even if the upstream transcription is complete, while the platform is still saving the result.
A query for a failed task still returns an HTTP 200 status code:
{
"request_id": "req-query-example",
"output": {
"task_id": "20261026-550e8400-e29b-41d4-a716-446655440000",
"task_status": "FAILED",
"code": "UpstreamError",
"message": "The Model Studio transcription task failed."
},
"usage": {"duration": null}
}
Recognition results
Result file
Use the transcription_url from the task query to download the standalone recognition result JSON. This file is distinct from the task query response and does not include the platform task envelope.
Example (some optional fields omitted):
{
"file_url": null,
"properties": {
"audio_format": "pcm_s16le",
"channels": [0],
"original_sampling_rate": 16000,
"original_duration_in_milliseconds": 8600
},
"transcripts": [{
"channel_id": 0,
"content_duration_in_milliseconds": 3100,
"text": "Hello, welcome to speech recognition.",
"sentences": [{
"sentence_id": 1,
"begin_time": 100,
"end_time": 3200,
"text": "Hello, welcome to speech recognition.",
"words": [ ]
}]
}]
}
Parameter | Description |
| This field is set to |
| Properties of the original audio file, including the audio format, processed channels, sampling rate, and original duration. |
| The channel index, starting from 0. |
| The content duration in milliseconds, as returned by the model. This value does not replace the billable usage found in the task query response. |
| The full text of the transcription. This can be an empty string for valid periods of silence. |
| An array of sentence-level result objects. |
| The sentence ID. |
|
|
|
|
| The transcribed text of the sentence. |
| Word-level details, such as timestamps and speaker information, as provided by the model. This field appears only if the model returns this information. |
| A relative audio amplitude metric on a scale of 1.0 to 10.0, with one decimal place. A value of 1.0 represents digital silence. Despite the field name, this value is an amplitude metric, not an emotion category or a confidence score. |
6. Final state callback (optional)
6.1 Configure a callback
To receive notifications, add a callback_url to the top level of the request body. If you omit this field, or if its value is null or an empty string, no callback will be sent. In that case, you must use active polling to check the task status.
{
"model": "Qwen-Audio-ASR-VoicePica-Async",
"input": {"file_urls": ["https://audio.example.com/meeting.wav"]},
"parameters": {},
"callback_url": "https://customer.example.com/hooks/asr"
}The field name must be exactly
callback_url. Using other top-level field names, such ascallbackUrl, will result in a 400InvalidParametererror.The URL must be an absolute
httporhttpsaddress with a hostname, up to 2,048 characters long. It cannot include user information (e.g.,user:pass@) or a URL fragment (e.g.,#...).The hostname must be resolvable, and all resolved addresses must be public IP addresses. URLs pointing to a private network, loopback address, or any other non-public address will result in a 400 error, as will DNS resolution failures. The platform re-validates the address before each notification attempt.
You can include your own query parameters, but you cannot use the following reserved names:
taskId,status,timestamp,taskType,success, orsignature. Using any of these will result in a 400 error.Custom request headers and authentication methods are not supported. If you need to distinguish the source of the notification, include your own identifiers in the URL's path or query parameters.
6.2 Notification request
When a task reaches a final asynchronous state of SUCCEEDED or FAILED, the platform sends an HTTP GET request to your callback_url. The following query parameters are appended to the URL. The request has no request body.
GET {callback_url}?taskId=20261026-550e8400-e29b-41d4-a716-446655440000&status=SUCCEEDED×tamp=1792987202000&taskType=ASR_ASYNC_TASK&success=true&signature=xxxParameter | Type | Description |
| string | The platform task ID, which is the same as the |
| string | The final state of the task: |
| integer | The time of this notification attempt in Unix milliseconds. A new timestamp is generated for each retry. |
| string | Fixed value: |
| boolean |
|
| string | The signature. See section 6.3 for details. |
After receiving a notification, call the query API with the taskId to retrieve the transcription_url and usage details on success, or the output.code and output.message on failure.
The callback only notifies you of the final asynchronous state of successfully submitted tasks. Rejections, timeouts, or other exceptions during the submission phase, which return a synchronous error, do not trigger a callback. Notifications for PENDING or RUNNING states are also not sent. A notification might arrive before the 202 response from the submission request or even if the 202 response is lost. Cache and associate notifications by their taskId.
Verify the final state by calling the authenticated query API.
6.3 Signature verification
signature = Base64(MD5(UTF8("taskId={taskId}×tamp={timestamp}&userId={userId}")))Use the decoded values of
taskIdandtimestampfrom the notification request's query parameters. TheuserIdis the user ID associated with the API key used to submit the task. Refer to your provisioning information for this ID.The signature does not include a secret key. It only verifies that the parameters have not been tampered with and does not prove the request originated from the platform. Do not change your application's business state based solely on callback parameters. Always confirm the
task_statusby calling the authenticated query API.
6.4 Response and retries
The platform considers the notification delivered upon receiving any 2xx status code from your endpoint. Return a
200or204status code as quickly as possible. Do not wait for the result download to complete before responding. The platform does not parse the response body.The platform retries the notification if it receives a non-2xx response (including 3xx redirects), or if the connection fails or times out. It retries at intervals of approximately 1, 5, and 30 minutes after the first failure. The platform makes four attempts in total (the initial request plus three retries) before ceasing delivery.
Each notification attempt has a connection timeout of 10 seconds and a total request timeout of 30 seconds. The platform does not follow redirects and does not send cookies or authentication information. If the URL resolves to a non-public address during an attempt, the platform halts delivery.
You may receive duplicate notifications for the same task. Handle these requests idempotently based on the
taskIdandstatus. Always return a 2xx status code for duplicate notifications.
The callback is a best-effort notification. The platform does not persist delivery status, so notifications may be lost during service restarts, scaling events, or if a backlog occurs. Interfaces for re-delivery or replay are not provided. A failed callback does not affect the recognition result or metering. Implement a fallback mechanism that uses active polling to query the task status, though you can use a longer polling interval. For security, do not log the full callback URL or the signature.