> ## 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 快速开始 | 生成、查询与后续操作

> 快速上手 TTAPI 的 Midjourney API，包含 imagine、fetch、action 等核心接口的完整工作流。

# Midjourney API 快速开始

本指南帮助你从 API Key 快速完成 **Midjourney API** 集成。

## 你将学到

1. 提交图像生成请求
2. 轮询任务状态
3. 使用 Action 进行放大、变体等后续操作

## 第一步：生成图像

从 [Midjourney Imagine API](/api/cn/midjourney/imagine) 开始，这是基于提示词生成图像的主入口。

```bash theme={null}
curl --request POST \
  --url https://api.ttapi.io/midjourney/v1/imagine \
  --header 'Content-Type: application/json' \
  --header 'TT-API-KEY: YOUR_API_KEY' \
  --data '
{
  "prompt": "cinematic portrait of an astronaut in neon rain",
  "mode": "fast",
  "hookUrl": "https://your-domain.com/webhook"
}
'
```

## 第二步：查询结果

Midjourney 任务是异步的。收到 `jobId` 后，通过 [Midjourney Fetch API](/api/cn/midjourney/fetch) 轮询结果。

```bash theme={null}
curl --request GET \
  --url "https://api.ttapi.io/midjourney/v1/fetch?jobId=YOUR_jobId" \
  --header 'TT-API-KEY: YOUR_API_KEY'
```

## 第三步：继续工作流

初始图片网格生成完成后，使用 [Midjourney Action API](/api/cn/midjourney/action) 执行后续操作：

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

## 推荐流程

| 目标 | 推荐路径 |
| :- | :- |
| 提示词生图 | [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 Imagine API](/api/cn/midjourney/imagine)
* [Midjourney Fetch API](/api/cn/midjourney/fetch)
* [Midjourney Action API](/api/cn/midjourney/action)
* [Midjourney 工作流指南](/grids/cn/start/midjourney-api-workflows)


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