> ## Documentation Index
> Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Midjourney API：文字生成圖片與以圖生圖

> 進階 AI 影像生成，包含文生圖、圖生圖、影像編輯、變化、升級、重新滾動與增強工作流程

## 概覽

Midjourney 透過非同步任務生成高質量擴散影像。可以用原圖引導生成、編輯區域性區域、生成變體、放大圖片、重新生成，或提升草稿質量。在 APIXO Playground 試用後，可依本頁範例呼叫 API。

| 功能 | 值 |
| - | - |
| 模型 ID | `midjourney` |
| 模式 | `text-to-image`, `image-to-image`, `image-edit`, `vary`, `upscale`, `reroll`, `enhance` |
| 提示詞長度 | 非空。提示限制可以是2000個字元或7500個UTF-8位元組；建議將提示保留在2000個字元內以確保相容性。 |
| 參考圖片 | `text-to-image` 支援透過 `image_urls` 提供最多 20 個影像作為提示。`image-to-image` 至少需要一個參考影像欄位，仍使用擴散模型產生。`image-edit` 需要剛好一張來源影像作為編輯底圖。 |
| 縱橫比 | `1:1`, `1:2`, `2:1`, `2:3`, `3:2`, `3:4`, `4:3`, `5:6`, `6:5`, `9:16`, `16:9` |
| 速度 | `fast`、`turbo`、`draft`；`relaxed` 已被官方提供者棄用。為保持相容性，我們仍接受此值，但將其轉換為 `fast` 用於執行與計費。`draft` 屬於擴散模型家族，因此在 `version=7` 時可用於 `text-to-image` 與 `image-to-image`。 |
| 結果計數 | 通常生成與變異使用4張影像，升級與增強則使用1張影像。 |

## 工作流程類別

| 類別 | 模式 | 說明 |
| - | - | - |
| 直接生成 | `text-to-image`, `image-to-image`, `image-edit` | 直接提交新任務。`image-to-image` 使用至少一個所需影像參考的擴散生成。`image-edit` 是區域編輯工作流程。 |
| 二次編輯 | `vary`, `upscale`, `reroll`, `enhance` | 對先前的 Midjourney 任務結果進行操作。`reroll` 使用 `taskId`。`vary`、`upscale` 和 `enhance` 使用 `taskId` 加上 `imageIndex`。`enhance` 僅適用於草稿結果。 |

> [!TIP]
>
> 請勿將 Midjourney 內嵌標誌（例如 `--ar`、`--style` 或 `--sref`）放在 `prompt` 內。從第一個 `--` 開始的提示文字將被丟棄。請改用 API 欄位，例如 `aspect_ratio`、`stylization`、`variety` 和 `weirdness`。

## 端點與身分驗證

API 基底網址：

```text theme={null}
https://api.apixo.ai/api/v1
```

| 方法 | 端點 | 用途 |
| - | - | - |
| `POST` | `/generateTask/midjourney` | 提交 Midjourney 任務 |
| `GET` | `/statusTask/midjourney?taskId={taskId}` | 查詢任務狀態並取得結果 |

每個請求都必須附上 APIXO API 金鑰：

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

送出任務時，還需設定以下請求標頭：

```http theme={null}
Content-Type: application/json
```

## 非同步請求範例

以下範例提交一個最簡單的文字生成圖片任務，回應中會傳回 `taskId`。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/midjourney" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-image",
      "prompt": "a cinematic product photo of a transparent speaker on black marble",
      "version": "7",
      "speed": "fast",
      "aspect_ratio": "16:9",
      "image_urls": [
        "https://example.com/scene-reference.jpg"
      ],
      "sref_urls": [
        {
          "url": "https://example.com/style-reference.jpg",
          "weight": 2
        }
      ],
      "iw": 1.5,
      "sw": 500,
      "sv": 6,
      "negative_prompt": "text, watermark"
    }
  }'
```

成功回應：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
```

請保留 `taskId`，後續輪詢結果時會用到。

## 輪詢結果

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/midjourney?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

任務處理中的回應範例：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
```

成功回應：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/img1.png\",\"https://file.apixo.ai/img2.png\",\"https://file.apixo.ai/img3.png\",\"https://file.apixo.ai/img4.png\"]}",
    "supported_actions": [
      {
        "mode": "reroll"
      },
      {
        "mode": "vary",
        "imageIndex_options": [0, 1, 2, 3],
        "type_options": [0, 1]
      },
      {
        "mode": "upscale",
        "imageIndex_options": [0, 1, 2, 3],
        "type_options": [0, 1, 2, 3]
      },
      {
        "mode": "image-edit",
        "imageIndex_options": [0, 1, 2, 3]
      },
      {
        "mode": "enhance",
        "imageIndex_options": [0, 1, 2, 3]
      }
    ],
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
```

任務失敗時的回應範例：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "PromptInvalid",
    "failMsg": "Prompt is invalid or rejected",
    "createTime": 1767965610929,
    "completeTime": 1767965620132,
    "costTime": 9203
  }
}
```

等 `state` 變為 `success` 後，再解析 `resultJson`：

```javascript theme={null}
const payload = JSON.parse(data.resultJson);
const imageUrls = payload.resultUrls;
```

當您想要向使用者呈現後續操作時，直接使用 `data.supported_actions`。它以與 `resultJson` 相同的等級傳回，並且僅在後續操作可用時才出現。

後續操作集取決於來源任務模式：

| 來源模式 | 後續模式 |
| - | - |
| `text-to-image` | `reroll`, `vary`, `upscale`, `image-edit`, `enhance` |
| `image-to-image` | `reroll`, `vary`, `upscale`, `image-edit`, `enhance` |
| `image-edit` | `image-edit`, `upscale` |
| `vary` | `reroll`, `vary`, `upscale`, `image-edit` |
| `upscale` | `vary`, `image-edit` |
| `reroll` | `reroll`, `vary`, `upscale`, `image-edit`, `enhance` |
| `enhance` | `vary`, `upscale`, `image-edit` |

`enhance` 僅在成功的 `v7 + draft` 代家庭結果時傳回。從特定影像繼續的後續操作可以包括 `imageIndex_options`，以便用戶端可以詢問使用者從哪個影像繼續。

## 請求體

### 文生圖

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-image",
    "prompt": "a quiet library inside a glass greenhouse, soft morning light",
    "version": "7",
    "speed": "fast",
    "aspect_ratio": "16:9",
    "image_urls": [
      "https://example.com/scene-reference.jpg"
    ],
    "sref_urls": [
      {
        "url": "https://example.com/style-reference.jpg",
        "weight": 2
      }
    ],
    "iw": 1.5,
    "sw": 500,
    "sv": 6,
    "negative_prompt": "text, watermark",
    "stylization": 100,
    "variety": 10,
    "weirdness": 0
  }
}
```

### 圖生圖

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-image",
    "prompt": "a dog lying in a bright park with green grass and trees",
    "image_urls": [
      "https://example.com/dog-at-home.jpg"
    ],
    "version": "7",
    "speed": "fast",
    "aspect_ratio": "4:3"
  }
}
```

### 影像編輯

當您想要編輯特定區域時，請使用 `image-edit`。如果支持，省略 `mask`、`canvas` 和 `imgPos` 將使用基於 `image_urls[0]` 的全影像編輯區域。

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-edit",
    "prompt": "add a modern espresso machine on the counter",
    "image_urls": [
      "https://example.com/cafe.jpg"
    ],
    "version": "7",
    "speed": "fast",
    "mask": {
      "areas": [
        {
          "width": 1024,
          "height": 1024,
          "points": [320, 420, 700, 420, 700, 760, 320, 760]
        }
      ]
    },
    "canvas": {
      "width": 1024,
      "height": 1024
    },
    "imgPos": {
      "width": 1024,
      "height": 1024,
      "x": 0,
      "y": 0
    }
  }
}
```

### 各不相同

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "vary",
    "taskId": "task_previous_midjourney",
    "imageIndex": 0,
    "type": 1,
    "remixPrompt": "more dramatic lighting and richer color contrast"
  }
}
```

### 放大

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "upscale",
    "taskId": "task_previous_midjourney",
    "imageIndex": 2,
    "type": 0
  }
}
```

### 重新滾動

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "reroll",
    "taskId": "task_previous_midjourney"
  }
}
```

### 提升

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "enhance",
    "taskId": "task_previous_midjourney",
    "imageIndex": 1
  }
}
```

## 參數

**request\_type** `string` *required* (default: async)

取得結果的方式。選擇 `async` 時，透過 `statusTask` 輪詢結果；選擇 `callback` 時，透過 Webhook 接收結果。

**callback\_url** `string`

當 `request_type` 為 `callback` 時必填。請提供可從網際網路存取的 HTTPS 網址，以接收任務的最終結果。詳見 [Webhook](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md)。

**input** `object` *required*

Midjourney 的輸入參數。

**屬性**

**mode** `string` *required*

運作模式。支援的值：`text-to-image`、`image-to-image`、`image-edit`、`vary`、`upscale`、`reroll`、`enhance`。

**prompt** `string`

對於 `text-to-image`、`image-to-image` 和 `image-edit` 是必需的。必須非空。提示限制可以是2000個字元或7500 UTF-8位元組；建議將提示保留在 2000 字元內以確保相容性。

**image\_urls** `string[]`

參考影像 URL。對於 `text-to-image`，此欄位為選填，最多支援 20 個影像提示。對於 `image-to-image`，必須在 `image_urls`、`sref_urls`、`cref_urls` 或 `oref_urls` 中至少提供一個影像參考欄位；若使用 `image_urls`，則視為直接的影像提示輸入。對於 `image-edit`，此欄位為必需，且必須 exactly 包含 1 個基礎影像。URL 應為公開、可直接取得的 JPG、PNG 或 WebP 檔案。

**sref\_urls** `object[]`

`text-to-image` 的可選樣式參考影像。每個項目必須包含 `url`，並可選包含 `weight`。`weight` 為各影像的相對權重，非固定總和比率。

**cref\_urls** `string[]`

`text-to-image` 的可選角色參考影像。

**oref\_urls** `string[]`

`text-to-image` 的可選物件參考影像。最多僅支援 1 個影像。

**version** `string`

Midjourney 型號版本。使用 `7`、`6.1`、`6`、`8.1`、`niji6` 或 `niji7` 來實現目前相容性。API 也規範化 `v7`、`v6.1`、`v6`、`v8.1`、`niji 6` 和 `niji 7` 等形式。

**speed** `string`

需用於 `text-to-image`、`image-to-image` 與 `image-edit`。支援的值：`relaxed`、`fast`、`turbo` 與 `draft`。`relaxed` 已被官方提供者棄用。為保持相容性，APIXO 仍接受此值，但會轉換為 `fast` 用於執行與計費。`draft` 屬於擴散系列，因此在 `version=7` 時可用於 `text-to-image` 與 `image-to-image`。`image-edit` 不支援 `draft`。

**aspect\_ratio** `string`

輸出縱橫比。支援的值：`1:1`、`1:2`、`2:1`、`2:3`、`3:2`、`3:4`、`4:3`、`5:6`、`6:5`、`9:16`、`16:9`。省略時，產生服務將選擇預設的寬高比。

**variety** `integer`

Midjourney 混沌/變化控制。支援範圍：`0`-`100`。預設值可能會有所不同；省略的值可使用`10`。明確設定 `variety` 以確保一致的行為。

**stylization** `integer`

藝術風格化強度。支援範圍：`0`-`1000`。預設值可能會有所不同；省略的值可使用`1`。明確設定 `stylization` 以確保一致的行為。

**weirdness** `integer`

超現實或非傳統效果強度。支援範圍：`0`-`3000`。預設值可能會有所不同；省略的值可使用`1`。明確設定 `weirdness` 以確保一致的行為。

**iw** `number`

`text-to-image` 的影像提示權重。此欄位僅在提供 `image_urls` 時才會生效。

**sw** `integer`

`text-to-image` 的樣式參考權重。支援範圍：`0`-`1000`。此欄位僅在提供 `sref_urls` 時才會生效。

**cw** `integer`

`text-to-image` 模式的角色參考權重，範圍為 `0` 至 `100`。只有提供 `cref_urls` 時才會生效。

**ow** `integer`

`text-to-image` 的物體參考權重。支援範圍：`1`-`1000`。此欄位僅在提供 `oref_urls` 時才會生效。

**sv** `integer`

`text-to-image` 的樣式參考版本。此欄位僅在提供 `sref_urls` 時才有效。

**exp** `integer`

實驗參數，適用於 `text-to-image`。支援範圍：`0`-`100`，於支援版本中。

**negative\_prompt** `string`

`text-to-image` 的否定提示。這映射到 Midjourney `--no`。最大長度：2000 個字元。

**quality** `number`

選填的品質設定。支援的值是特定於版本的。

**is\_hd** `boolean`

選填 2K HD 轉變。僅支援 `text-to-image` 當 `version` 為 `8.1` 時。

**is\_raw** `boolean`

`text-to-image` 選填的原始模式開關。當為 `true` 時，請求會加入 Midjourney `--raw`。

**enableTranslation** `boolean`

請求提示翻譯為英文。翻譯可用性與預設行為可能不同；請明確設定此標誌，而非依賴省略的值。

**watermark** `string`

可選浮水印文字。在相容路線上支援。

**taskId** `string`

需用於 `vary`、`upscale`、`reroll` 與 `enhance`。請使用 APIXO 任務 ID 從先前成功的 Midjourney 生成任務中取得。

**imageIndex** `integer`

對於 `vary`、`upscale` 和 `enhance` 是必需的。從上一個結果中選擇一張影像。支援的範圍：`0`-`3`。

**type** `integer` (default: 0)

選填的變換類型。對於 `vary`，`0` 表示細微變化，`1` 表示強烈變化。對於 `upscale`，相容路由上支援的值為 `0`、`1`、`2` 和 `3`。

**remixPrompt** `string`

相容路線上 `vary` 的可選文字指南。對於 `image-edit`，如果支持，省略 `remixPrompt` 會重複使用 `prompt`。最大長度：2000 個字元。

**mask** `object`

`image-edit` 可選。當您需要特定於區域的編輯時使用它。如果支持，省略此欄位將使用基於來源影像的全影像遮罩。

**屬性**

**areas** `object[]`

多邊形編輯區域。每個區域可以包括 `width`、`height` 和 `points`。`points` 是平面座標陣列：`[x1,y1,x2,y2,...]`。

**url** `string`

黑/白遮罩影像 URL 或基礎 64 遮罩。白色區域重新生成。使用 `areas` 或 `url`，而不是同時使用。

**canvas** `object`

`image-edit` 可選。畫布尺寸。如果提供，`width` 和 `height` 必須是正整數。

**屬性**

**width** `integer`

畫布寬度（以像素為單位）。

**height** `integer`

畫布高度（以像素為單位）。

**imgPos** `object`

`image-edit` 可選。畫布上來源影像的位置和大小。

**屬性**

**width** `integer`

影像寬度（以像素為單位）。

**height** `integer`

影像高度（以像素為單位）。

**x** `integer`

距畫布左上角的水平偏移。

**y** `integer`

距畫布左上角的垂直偏移。

> [!TIP]
>
> `text-to-image` 和 `image-to-image` 共享擴散參數族。`image-to-image` 需要至少一個橫跨 `image_urls`、`sref_urls`、`cref_urls` 或 `oref_urls` 的影像參考，而 `text-to-image` 將 `image_urls` 視為可選影像提示。`image-edit` 是一個單獨的區域編輯工作流程，並使用 `mask`、`canvas`、`imgPos` 和選填的 `remixPrompt`。

## 回應格式

### 送出任務時的回應

任務受理後，`POST /generateTask/midjourney` 會傳回任務 ID：

**code** `integer`

API 狀態碼。`200` 表示任務已受理。

**message** `string`

狀態說明。

**data.taskId** `string`

與狀態端點一起使用的唯一 APIXO 任務識別碼。

### 狀態回應欄位

**taskId** `string`

唯一的 APIXO 任務識別碼。

**state** `string`

目前的任務狀態，可能的值為 `pending`、`processing`、`success`、`failed`。

**resultJson** `string`

內含生成圖片 URL 的 JSON 字串。`state` 為 `success` 時傳回。

**supported\_actions** `array`

選填的後續行動用於處理成功結果。該欄位與 `resultJson` 一樣，位於 `data` 中的同層級。

**failCode** `string`

供程式判讀的錯誤碼，僅在 `state` 為 `failed` 時傳回。

**failMsg** `string`

失敗原因說明，僅在 `state` 為 `failed` 時傳回。

**createTime** `integer`

任務建立時的 Unix 時間戳記，單位為毫秒。

**completeTime** `integer`

任務完成時的 Unix 時間戳記，單位為毫秒。任務完成後才會傳回。

**costTime** `integer`

處理持續時間（以毫秒為單位）。完成後呈現。

## Webhook 回呼模式

若希望後端自動收到最終結果，可使用回呼模式，無須輪詢。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/midjourney" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "text-to-image",
      "prompt": "a premium watch on dark stone, macro photography, soft reflections",
      "version": "7",
      "speed": "fast",
      "aspect_ratio": "1:1"
    }
  }'
```

Webhook 的接收條件與重試規則請見 [Webhook 文件](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md)。

## 計費

新提交的非 LLM 請求按 **1 點 = `$0.001`** 計費。先依用量和加購項目計算總額，再套用帳戶折扣，最後將請求總額無條件進位至整數點數。若已約定固定單價，則保留該單價的精度，不再使用標準價或另行打折；最終點數仍須進位。詳見[積分換算與進位](https://apixo.ai/docs/zh-hant/pricing.md#credit-conversion-and-rounding)。

Midjourney 依使用次數計費。所選模式與速度決定了單價。

目前的公開定價最容易理解的是兩個系列：

| 類別 | 模式 | APIXO 價格 | 筆記 |
| - | - | - | - |
| 直接生成 | `text-to-image` | `$0.10 / use` (`draft`), `$0.20 / use` (`fast`), `$0.40 / use` (`turbo`) | 擴散生成。`v8.1` 與 `is_hd=true` 以及 `fast` 結合為 `$0.30 / use`。 |
| 直接生成 | `image-to-image` | 與 `text-to-image` 相同 | 使用類似 `text-to-image` 的擴散生成，但需提供至少一張影像作為參考輸入。 |
| 直接生成 | `image-edit` | `$0.30 / use` (`fast`), `$0.60 / use` (`turbo`) | 區域編輯工作流程。 |
| 二次編輯 | `vary` | `$0.30 / use` | 需提供先前的 `taskId` 與 `imageIndex`。 |
| 二次編輯 | `upscale` | `$0.30 / use` | 需提供先前的 `taskId` 與 `imageIndex`。 |
| 二次編輯 | `reroll` | 與源任務價格相同 | 使用相同的設定重新運行先前成功的任務。 |
| 二次編輯 | `enhance` | 查看 [API 定價](https://apixo.ai/pricing/api) | 僅草稿增強工作流程。需要先前的 `taskId` 和 `imageIndex`。 |

最新的美元費率請見 [API 價目表](https://apixo.ai/pricing/api)。

## 耗時與輪詢

實際延遲可能會因提示複雜性、模式、所選路由和目前佇列負載而異。

| 模式或速度 | 一般生成時間 | 建議首次查詢時間 | 輪詢間隔 |
| - | - | - | - |
| `turbo`一代 | 15s-25s | 任務建立 20 秒後 | 3s-5s |
| `fast`一代 | 30s-45s | 任務建立 20 秒後 | 3s-5s |
| `vary`、`upscale` 或 `enhance` | 15s-60s | 任務建立 15 秒後 | 3s-5s |
| `reroll` | 與原始生成速度相似 | 任務建立 20 秒後 | 3s-5s |

> [!TIP]
>
> 正式環境的並行請求較多時，建議使用回呼，以免頻繁輪詢。

請求頻率與並行數上限會依帳戶、API 金鑰和路由而異。收到 `429` 時，請降低請求頻率，並逐步拉長重試間隔。帳戶層級的限制請見[系統 API](https://apixo.ai/docs/zh-hant/api-reference/system.md)。

## 錯誤與排查

### HTTP 錯誤

| 代碼 | 含義 | 處理方式 |
| - | - | - |
| `400` | 請求內容、模式、參數、提示或影像 URL 有誤 | 修正請求後再試 |
| `401` | 缺少 API 金鑰，或金鑰無效 | 檢查 `Authorization` 請求標頭 |
| `402` | 餘額或配額不足 | 充值或更換帳號或金鑰 |
| `403` | 金鑰或路由無權訪問該模型 | 檢查權限和路由策略 |
| `429` | 已達到速率或並行限制 | 以指數退避方式重試 |
| `500` | 伺服器錯誤 | 逐步拉長間隔後重試 |
| `502` | 服務錯誤 | 逐步拉長間隔後重試 |
| `504` | 服務超時 | 重新嘗試；耗時較長的任務可改用回呼模式 |

### 任務失敗代碼

| 錯誤碼 | 含義 | 處理方式 |
| - | - | - |
| `PromptInvalid` | 提示詞無效或遭拒 | 重寫提示，並移除不安全或格式錯誤的內容 |
| `MissingParameter` | 缺少必需的請求參數 | 請檢查 `mode`、`prompt`、`speed`、`image_urls`、`taskId` 與 `imageIndex` |
| `SensitiveContentDetected` | 輸入或輸出已被安全檢查標記 | 更動提示或來源影像 |
| `InputOutputSensitiveContentDetected` | 輸入或輸出被標記為敏感 | 嘗試不同的輸入 |
| `Upload error` | 圖片上傳或圖片尺寸驗證失敗 | 使用公共直接影像 URL 並將影像檔維持在支援的限制內 |
| `Website TimeOut` | 生成服務沒有及時回應 | 稍後重試或使用回呼模式 |
| `Task TimeOut` | 任務已過期或逾時 | 重新生成 |
| `RateLimitExceeded` | 請求頻率已達上限 | 以指數退避方式重試 |

### 常見修復

| 問題現象 | 處理方式 |
| - | - |
| `Invalid mode type` | 使用 `text-to-image`、`image-to-image`、`image-edit`、`vary`、`upscale`、`reroll` 或 `enhance` 之一。 |
| 參數被忽略 | 使用穩定的 API 欄位名稱：`aspect_ratio`、`variety`、`stylization` 和 `weirdness`。 |
| 提示意外遺失標誌 | 將 Midjourney 標誌移出 `prompt`；第一個 `--` 之後的文字將被忽略。 |
| `taskId` 未找到 `vary`、`upscale`、`reroll` 或 `enhance` | 使用 `data.taskId` 從之前成功的 Midjourney 結果中取得，由 APIXO 回傳。 |
| 影像編輯無法讀取影像大小 | 使用可公開存取且可直接取得的來源影像 URL。來源影像必須可讀取，以確定預設畫布和遮罩尺寸。 |
| `relaxed` 與預期的執行速度或計費不符 | `relaxed` 因相容性而被接受，但 APIXO 將其轉換為 `fast` 以執行和計費 |
| `draft` 被拒絕 | `draft` 僅在擴散系列中支援（`text-to-image` 和 `image-to-image`）當 `version=7` 時。 |
| `enhance` 被拒絕 | `enhance` 僅適用於成功的 Midjourney 草稿結果。 |

完整列表見[錯誤碼](https://apixo.ai/docs/zh-hant/api-reference/errors.md)。

## MCP 整合

[完整模型架構](https://apixo.ai/docs/models/schemas/image/midjourney.json)在`mcp.result`中聲明結果解碼並在`mcp.attachments`中聲明支援的檔案綁定。這些是用戶端整合中繼資料，而不是產生輸入參數。附件路徑：`mask.url`、`image_urls`、`cref_urls`、`oref_urls`、`sref_urls[].url`。保留使用者的文件順序。對於包含 `[]` 的路徑，在 `input` 中提供父陣列項目及其中繼資料，然後將檔案綁定到明確項目索引，例如 `[0]`。模型參數驗證保留在 API 上。

## 相關連結

* [生成 API 總覽](https://apixo.ai/docs/zh-hant/models.md)
* [影像模型](https://apixo.ai/docs/zh-hant/models/image)
* [送出生成任務](https://apixo.ai/docs/zh-hant/api-reference/generate-task.md)
* [查詢任務狀態](https://apixo.ai/docs/zh-hant/api-reference/status-task.md)
* [Webhook](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md)
* [錯誤碼](https://apixo.ai/docs/zh-hant/api-reference/errors.md)
* [參數規範](https://apixo.ai/docs/zh-hant/api-reference/parameters.md)
* [路由策略](https://apixo.ai/docs/zh-hant/concepts/routing-strategies.md)
* [在 APIXO Playground 試用 Midjourney](https://apixo.ai/models/midjourney)
* [API定價](https://apixo.ai/pricing/api)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.