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

> ## Agent Instructions
> Send API requests to https://api.ttapi.io with the TT-API-KEY header. Midjourney account hosting uses https://hold.ttapi.io. Claude Code uses https://cc.ttapi.io.
> Most generation endpoints are asynchronous. The submit response returns a job id. Poll that product's fetch endpoint, or pass a webhook on the submit request. A fetch call does not start a new generation.
> 1 USD = 100 quota. Check the pricing page for that product before estimating cost.
> This file lists the English docs. Follow every /_llms/ link recursively for the API reference, Chinese, and Russian. Open a page's .md URL for the endpoint schema.

# Midjourney API 异步工作流 | Fetch、轮询与后续操作

> 了解如何在 TTAPI 上运行 Midjourney API 异步工作流，包括 imagine、fetch、action、blend、inpaint 等接口。

# Midjourney API 异步工作流

TTAPI 的 **Midjourney API** 以异步任务处理为核心。本指南帮助你决定何时提交、何时轮询、何时对已完成的任务继续操作。

## 核心异步模式

最常用的模式：

1. 通过 [Imagine](/api/cn/midjourney/imagine)、[Blend](/api/cn/midjourney/blend) 或 [Inpaint](/api/cn/midjourney/inpaint) 提交任务
2. 获取 `jobId`
3. 通过 [Midjourney Fetch API](/api/cn/midjourney/fetch) 轮询
4. 需要时通过 [Midjourney Action API](/api/cn/midjourney/action) 执行后续操作

## 各接口的作用

| 场景 | 起始接口 |
| :- | :- |
| 基于提示词生成图像 | [Imagine](/api/cn/midjourney/imagine) |
| 多图合成 | [Blend](/api/cn/midjourney/blend) |
| 区域编辑 | [Inpaint](/api/cn/midjourney/inpaint) |
| 图片反推提示词 | [Describe](/api/cn/midjourney/describe) |

## 何时使用 Fetch

使用 [Midjourney Fetch](/api/cn/midjourney/fetch) 的场景：

* 需要获取最终图片 URL
* 需要知道任务成功或失败
* 应用需要在调用 Action 之前先获取结果

## 何时使用 Action

在生成成功后使用 [Midjourney Action](/api/cn/midjourney/action) 执行：

* 放大（Upscale）
* 变体（Variation）
* 重排（Reroll）
* 缩放（Zoom）
* 平移（Pan）

## 常见异步路径

| 工作流 | 路径 |
| :- | :- |
| 提示词到最终图片 | [Imagine](/api/cn/midjourney/imagine) -> [Fetch](/api/cn/midjourney/fetch) |
| 网格到放大或变体 | [Imagine](/api/cn/midjourney/imagine) -> [Fetch](/api/cn/midjourney/fetch) -> [Action](/api/cn/midjourney/action) |
| 图片混合工作流 | [Blend](/api/cn/midjourney/blend) -> [Fetch](/api/cn/midjourney/fetch) |
| 局部编辑工作流 | [Inpaint](/api/cn/midjourney/inpaint) -> [Fetch](/api/cn/midjourney/fetch) |

## 相关页面

* [Midjourney API 总览](/api/cn/midjourney)
* [Midjourney 快速开始](/grids/cn/start/midjourney-api-quickstart)
* [Midjourney 工作流指南](/grids/cn/start/midjourney-api-workflows)


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