apimaxDocs
DocsPricingConsole
API ReferenceIntegration GuideUser GuideChangelog

Music Series

Image Series

Video series

Task Management

Error Code ReferenceQuery Task StatusGET

Account Management

Query Quota UsageGET

Docs / Task Management

Task ManagementGETdoubao-seedream-5-5-261028gemini-3-pro-imagegemini-3.1-flash-imagegemini-3.1-flash-lite-image

Query Task Status

GET /v1/tasks/{id} is the shared query endpoint for all async tasks, used to check the execution status, progress, results, and error details of image, music, video, and other tasks.

GEThttps://api.apimax.ai/v1/tasks/:id
Try it
Bearer API KeyJSONServer-side call

GET /v1/tasks/{id} is the shared query endpoint for all async tasks, used to check the execution status, progress, results, and error details of tasks such as image, music, and video generation.

After an async task is created, the API returns a task ID that starts with task_. Clients poll this endpoint with that ID until the task reaches the completed or failed final state.

Authentication#

Use the API key of the user who created the task:

text
Authorization: Bearer YOUR_API_KEY

Tasks can only be queried by their owner. An invalid task ID, a task that does not exist, or a task that belongs to another user all return 404 task_not_found, which prevents leaking other users' task information.

Path parameters#

ParameterTypeRequiredDescription
idstringYesThe task ID returned when the async task was created; it must start with task_

This endpoint has no request body.

Request example#

bash
curl 'https://api.apimax.ai/v1/tasks/task_V1StGXR8_Z5jdHi6B' \
  --header 'Authorization: Bearer <token>'

Status reference#

statusMeaningFinal state
queuedThe task has been created and is queuedNo
in_progressThe task is executingNo
completedThe task succeeded; the result is in dataYes
failedThe task failed; the reason is in errorYes

Polling every 2-5 seconds is recommended. As long as status is not completed or failed, the client should keep waiting.

Common response fields#

FieldTypeDescription
idstringTask ID
objectstringimage.generation.task for image tasks; usually task for other task types
typestringTask type, such as image, music, or video
platformstringPlatform identifier that some non-image tasks may return
statusstringCurrent task status
progressintegerTask progress, from 0 to 100
modelstringThe model used to create the task
created / created_atintegerCreation time as a Unix timestamp
started_atintegerExecution start time; returned by some tasks
completed_at / finished_atintegerTask end time; returned for tasks in a final state
task_infoobjectCancellation availability and estimated duration for image tasks
dataarray/objectTask result; the exact structure depends on the task type
usageobjectBilling and token usage details for image tasks
errorobjectFailure reason; returned only for failed tasks

Each task type returns its own result structure on top of the common fields. Image tasks use created, completed_at, and image.generation.task; music, video, and other tasks usually use created_at, finished_at, and the generic task structure.

In-progress response#

json
{
  "id": "task_V1StGXR8_Z5jdHi6B",
  "object": "image.generation.task",
  "type": "image",
  "status": "in_progress",
  "progress": 35,
  "created": 1757156493,
  "model": "gpt-image-2",
  "task_info": {
    "can_cancel": false,
    "estimated_time": 60
  },
  "usage": {
    "billing_rule": "per_call",
    "credits_reserved": 1,
    "user_group": "default"
  }
}

task_info.estimated_time is an estimated duration in seconds for UI display and should not be treated as a hard client timeout.

Completed image task response#

json
{
  "id": "task_V1StGXR8_Z5jdHi6B",
  "object": "image.generation.task",
  "type": "image",
  "status": "completed",
  "progress": 100,
  "created": 1757156493,
  "completed_at": 1757156593,
  "model": "gpt-image-2",
  "task_info": {
    "can_cancel": false,
    "estimated_time": 0
  },
  "data": [
    {
      "url": "https://cdn.example.com/images/result.png",
      "url_expires_at": 1757160193
    }
  ],
  "usage": {
    "billing_rule": "per_call",
    "input_tokens": 12,
    "output_tokens": 4160,
    "total_tokens": 4172,
    "user_group": "default"
  }
}

Image result links may have an expiry; save them promptly after the task completes.

Other task results#

Music, video, and other tasks return the generic task structure, with data holding the result payload of that task type:

json
{
  "id": "task_example123",
  "object": "task",
  "type": "video",
  "platform": "video",
  "status": "completed",
  "progress": 100,
  "model": "video-model",
  "created_at": 1757156493,
  "started_at": 1757156500,
  "finished_at": 1757156593,
  "data": [
    {
      "url": "https://cdn.example.com/videos/result.mp4"
    }
  ]
}

Determine the task type from type or platform, then parse the corresponding data content.

Failure response#

json
{
  "id": "task_V1StGXR8_Z5jdHi6B",
  "object": "image.generation.task",
  "type": "image",
  "status": "failed",
  "progress": 0,
  "failed_at": 1757156593,
  "model": "gpt-image-2",
  "error": {
    "code": "upstream_error",
    "message": "content policy violation"
  }
}
error.codeDescription
task_not_foundThe task ID is invalid, the task does not exist, or it belongs to another user
upstream_errorThe upstream rejected the request or returned a business error
upstream_unavailableThe upstream service is temporarily unavailable
storage_errorFailed to save the task result
internal_errorGateway internal error

Polling recommendations#

  • A polling interval of 2-5 seconds is recommended; avoid high-frequency requests.
  • Both completed and failed are final states; stop polling once a task reaches either one.
  • If callback_url was set when creating the task, you can use callbacks instead of continuous polling; the callback payload matches the final-state structure of this query endpoint.
  • A client timeout does not mean the task failed; you can keep querying with the same task ID later.

Next steps

All docs
Relink Audio URLsSynchronously fetch ready-to-use audio URLs by Suno clip_id.Upsample Style TagsPolish and expand style tags and lyrics into a fuller style description.Get Style Inspiration SuggestionsGet random style or inspiration suggestions from the Suno upstream.Method 1: Create a Voice from an Existing SongCreate a vocal voice directly from a song clip already generated in this pool.Upload AudioImport user audio as a Suno-owned clip; returns an async upload task ID. With copyright=true the request switches to the copyright pipeline.Query Quota UsageUse an API key to query the remaining credits, used credits, and unlimited-quota status of the current key and its owning user.
On this page
OverviewAuthenticationPath parametersRequest exampleStatus referenceCommon response fieldsIn-progress responseCompleted image task responseOther task resultsFailure responsePolling recommendationsNext steps
API

GET /v1/tasks/:id