Skip to content
Trang này chưa có bản dịch sang ngôn ngữ của bạn, nên hiện đang được hiển thị bằng tiếng Anh.

Get task

Query Midjourney task status and results. Unified task API /v1/tasks/{task_id} and MJ-style API /v1/midjourney/{task_id}

Toàn bộ tài liệu
GET/v1/midjourney/task_01KV52C0TEJSYZMCG0NCS4YWKK

Recommended polling endpoint for the business side:

text
GET /v1/tasks/{task_id}

Unified task statuses are pending / processing / completed / failed; successful results are returned in result.images[].url.

Use the MJ-style endpoint when you need buttons[].customId for follow-up actions:

text
GET /v1/midjourney/{task_id}

Ví dụ request

curl --request GET \
  --url https://api.apisea.ai/v1/midjourney/task_01KV52C0TEJSYZMCG0NCS4YWKK \
  --header 'Authorization: Bearer <token>'

Status flow

text
SUBMITTED → IN_PROGRESS → SUCCESS
                        → FAILURE
                        → MODAL (needs extra parameters, see Inpaint)

Response example

json
{
  "id": "task_01JWXXXX",
  "status": "SUCCESS",
  "action": "IMAGINE",
  "progress": "100%",
  "grid_image_url": "https://cdn.example.com/mj_xxxx.png",
  "image_urls": [
    "https://cdn.example.com/mj_xxxx_0.png",
    "https://cdn.example.com/mj_xxxx_1.png",
    "https://cdn.example.com/mj_xxxx_2.png",
    "https://cdn.example.com/mj_xxxx_3.png"
  ],
  "buttons": [
    {"customId": "MJ::JOB::upsample::1::abc123def456", "label": "U1"},
    {"customId": "MJ::JOB::variation::1::abc123def456", "label": "V1"}
  ],
  "prompt": "a beautiful sunset over mountains"
}

grid_image_url is the 2x2 grid image; image_urls are the four cropped single-image URLs.

Warning

Field naming gotchas

  • /v1/tasks/{task_id} returns unified pending / processing / completed / failed statuses.
  • /v1/midjourney/{task_id} returns MJ-style fields such as grid_image_url, image_urls, and buttons.

About buttons: For most follow-up actions, pass index, direction, or zoom_ratio and the service maps the matching customId. If auto matching fails, pass custom_id directly.

Status overview

statusMeaningTerminal
NOT_STARTRow created, not yet confirmed by the system (transient)No
SUBMITTEDSystem accepted, queuedNo
IN_PROGRESSSystem processingNo
MODALWaiting for /modal parameters (see Inpaint)No
SUCCESSDone✓
FAILUREFailed → auto-refund (quota → 0, fail_reason holds the cause)✓

Query notes

  • The query endpoint is not billed separately, but keep the rate reasonable (3–5s polling recommended).
  • A regular user can only query their own tasks; querying others' returns 403.
  • Tasks are retained for 3 days by default; after that, queries return 404, but the generated image / video URLs remain accessible.

Advanced: act directly with custom_id

After reading buttons[].customId, you can pass it directly to the custom_id field of a follow-up action endpoint to bypass auto matching:

json
{
  "task_id": "task_01JWXXXX",
  "custom_id": "MJ::JOB::upsample::1::abc123def456"
}

Phản hồi

{
  "id": "task_01KV52C0TEJSYZMCG0NCS4YWKK",
  "status": "SUCCESS",
  "action": "IMAGINE",
  "progress": "100%",
  "grid_image_url": "https://cdn.example.com/mj_xxxx.png",
  "image_urls": [
    "https://cdn.example.com/mj_xxxx_0.png",
    "https://cdn.example.com/mj_xxxx_1.png",
    "https://cdn.example.com/mj_xxxx_2.png",
    "https://cdn.example.com/mj_xxxx_3.png"
  ],
  "buttons": [
    {"customId": "MJ::JOB::upsample::1::abc123def456", "label": "U1"},
    {"customId": "MJ::JOB::variation::1::abc123def456", "label": "V1"}
  ],
  "prompt": "a beautiful sunset over mountains"
}

Phát hiện lỗi trong tài liệu này? Gửi email đến support@apisea.ai.