API Platform

Get Task

Query the latest status and results of a general audio asynchronous task. Use the task_id returned by the server when the asynchronous task was created (async=true). When a task succeeds, the result fields are expanded at the top level rather than wrapped in a result field. All audio asynchronous tasks — including Create Transcription — are queried uniformly through this endpoint.

GET
/v1/audio/tasks/{task_id}

General audio asynchronous task query. No request body; returns the task object. The success-path state machine is PENDING → PROCESSING → SUCCESS; on failure, the task enters a failure terminal state and returns error.

Authentication

Add Authorization: Bearer <API_KEY> to the request header to authenticate. You can generate a key on the console "API Keys" page.

Example
curl https://api.mosi.cn/v1/audio/tasks/$TASK_ID \
  -H "Authorization: Bearer $MOSS_API_KEY"

Path parameters

FieldTypeRequiredDescription
task_idstringYes

The task ID returned by the server when the asynchronous task was created, e.g. task_abc123.

Request example

curl https://api.mosi.cn/v1/audio/tasks/$TASK_ID \
  -H "Authorization: Bearer $MOSS_API_KEY"

Response fields

FieldTypeAlways returnedDescription
idstringYes

Task ID.

objectstringYes

Task object type, for example audio.speech / audio.voice_generation / audio.transcription.

statusstringYes

Task status, for example PENDING / PROCESSING / SUCCESS / FAILED.

created_atintegerYes

Creation time, a Unix timestamp in seconds.

updated_atintegerYes

Last update time, a Unix timestamp in seconds.

retry_afterintegerNo

Suggested polling interval in seconds, returned while the task has not reached a terminal state.

Response example

Response example
{
  "id": "task_abc123",
  "object": "audio.speech",
  "status": "PROCESSING",
  "created_at": 1710000000,
  "updated_at": 1710000000,
  "retry_after": 3
}

A task may stay in PROCESSING for an extended period, and completion time depends on actual processing; start polling at the returned retry_after interval (in seconds).

Next steps