跳轉到主要內容
GET
/
mj
/
task
/
{id}
/
fetch
Fetch a Midjourney task
curl --request GET \
  --url https://api.cometapi.com/mj/task/{id}/fetch \
  --header 'Authorization: Bearer <token>'
{
  "id": "1773314942177684",
  "status": "SUCCESS",
  "progress": "100%",
  "imageUrl": "https://api.cometapi.com/mj/image/1773314942177684",
  "videoUrl": "",
  "buttons": [
    {
      "customId": "MJ::JOB::upsample::1::example",
      "emoji": "",
      "label": "U1",
      "type": 2,
      "style": 1
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

在每次 Midjourney submit 呼叫之後都應使用此端點。這是 imagine、action、modal、blend 與 editor 工作流程的主要輪詢端點。

先檢查這些欄位

  • status 確認整體任務狀態
  • progress 確認目前的完成進度訊號
  • 當資產準備就緒時,檢查 imageUrlvideoUrl
  • buttons 取得下一步可用的 customId

輪詢規則

  • 持續輪詢,直到任務到達 SUCCESSMODALFAILURE
  • buttons 陣列視為後續操作的唯一依據
  • 當你需要最終完成的格線圖或放大結果時,使用 imageUrl

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

路徑參數

id
string
必填

Midjourney task id.

回應

200 - application/json

Current task state.

id
string
必填
imageUrl
string
必填
status
string
必填
progress
string
必填
buttons
object[]
必填
action
string
customId
string
botType
string
prompt
string
promptEn
string
description
string
state
string
submitTime
integer
startTime
integer
finishTime
integer
videoUrl
string
failReason
string
maskBase64
string
properties
object