> ## 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/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`，该字段为必需，且必须恰好包含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，该 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 或 base64 蒙版。白色区域将被重新生成。请使用 `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/api-reference/webhooks.md)。

## 计费

新提交的非 LLM 请求按 **1 积分 = `$0.001`** 计费。先按用量和附加项目计算总额，再应用账号折扣，最后将请求总额向上取整到整数积分。如果约定了固定单价，则按该单价的原始精度计算，不再使用标准价或另行打折；最终积分仍向上取整。详见[积分换算与取整](https://apixo.ai/docs/zh/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/api-reference/system.md)。

## 错误与排查

### HTTP 错误

| 代码 | 含义 | 处理方式 |
| - | - | - |
| `400` | 请求体、模式、参数、提示或图像 URL 无效 | 在重试前修复请求 |
| `401` | 缺少 API 密钥，或密钥无效 | 检查 `Authorization` 请求头 |
| `402` | 余额或配额不足 | 充值或更换账号或API密钥 |
| `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/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/models.md)
* [图像模型](https://apixo.ai/docs/zh/models/image)
* [提交生成任务](https://apixo.ai/docs/zh/api-reference/generate-task.md)
* [查询任务状态](https://apixo.ai/docs/zh/api-reference/status-task.md)
* [Webhook](https://apixo.ai/docs/zh/api-reference/webhooks.md)
* [错误码](https://apixo.ai/docs/zh/api-reference/errors.md)
* [参数规范](https://apixo.ai/docs/zh/api-reference/parameters.md)
* [路由策略](https://apixo.ai/docs/zh/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.