> ## 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.

# Midjourney API Documentation

> Build Midjourney image generation workflows on TTAPI with imagine, action, blend, describe, seed, inpaint, and fetch.

# Midjourney API

Most Midjourney integrations are straightforward at the submit step and messy after the first result comes back. This page is meant to reduce that confusion. If you are starting from a text prompt, use **Imagine**. If you already have a finished grid and want to keep working from it, use **Action**. If the workflow starts from several source images, use **Blend**. If you need to change only one part of an image, use **Inpaint**.

On TTAPI, those workflows live under one Midjourney API family, with **Fetch** handling the async part in the middle.

## Get Started

* [Midjourney API Quickstart](/grids/en/start/midjourney-api-quickstart)
* [Midjourney Imagine API](/api/en/midjourney/imagine)
* [Midjourney Fetch API](/api/en/midjourney/fetch)
* [Midjourney Action API](/api/en/midjourney/action)
* [Gateway & Auth](/grids/en/development/authentication)
* [Image Pricing](/grids/en/start/pricing/image#midjourney)

## Key Features

### Start from text, then keep the workflow alive

[Midjourney Imagine](/api/en/midjourney/imagine) is the normal starting point. It creates the initial grid and gives you the job handle you need for everything that follows. In practice, that means your app can treat Imagine as the "create" step and Fetch or Action as the "continue" step.

### Async handling that matches real product flows

Midjourney generation is asynchronous. You submit the job, store the returned identifier, then poll [Midjourney Fetch](/api/en/midjourney/fetch) or use a `hookUrl`. This matters because most product bugs around Midjourney are not prompt bugs, they are state-management bugs: missing job storage, polling the wrong id, or trying to trigger follow-up actions before the first grid is done.

### Action-based continuation after the first grid

Once a job completes, [Midjourney Action](/api/en/midjourney/action) lets you continue from that result instead of starting over. That is where upscales, variations, rerolls, pan, and zoom belong. If your product has U/V-style controls or "make this one stronger" buttons, Action is usually the endpoint behind them.

### Multiple entry points for non-standard workflows

Not every Midjourney integration starts from a clean text prompt. [Blend](/api/en/midjourney/blend) is useful when the user begins with multiple reference images. [Describe](/api/en/midjourney/describe) helps when the user has an image but not a usable prompt yet. [Seed](/api/en/midjourney/seed) is practical for prompt testing and reproducibility. [Inpaint](/api/en/midjourney/inpaint) is the right choice when you want to preserve most of the image and only regenerate a selected area.

## Authentication And Base URL

All Midjourney API requests on TTAPI use the same gateway and auth pattern.

* Base URL: `https://api.ttapi.io`
* Header: `TT-API-KEY: YOUR_API_KEY`
* Content-Type: `application/json`

## Recommended Workflow

The most common production path looks like this:

1. Submit `POST /midjourney/v1/imagine`.
2. Save the returned job identifier as soon as the request succeeds.
3. Poll `GET /midjourney/v1/fetch?jobId=...` until the job finishes.
4. Read `components`, output image URLs, and other metadata from the fetch payload.
5. If the user wants to continue from the completed result, call [Midjourney Action](/api/en/midjourney/action).

One detail that trips teams up: the submit response returns a `jobId` field inside `data`, but the polling endpoint expects that same value as the `jobId` query parameter. Store it once, then reuse it consistently.

### Example Request

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

### Example Fetch

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

When Fetch succeeds, the payload can include the final image URLs, the list of executable `components`, and metadata like `seed`. That is usually enough to drive the next UI state without another custom lookup layer.

## Use Cases

* Creative review tools that generate a first grid, then let users request variations or upscales on demand
* Campaign or catalog workflows where teams iterate through several prompt directions before choosing one branch to continue
* Moodboard or art-direction tools that start from multiple reference images through [Blend](/api/en/midjourney/blend)
* Prompt-research workflows that use [Describe](/api/en/midjourney/describe) and [Seed](/api/en/midjourney/seed) to make outputs easier to analyze and repeat
* Visual editing tools that need selective repainting instead of full regeneration through [Inpaint](/api/en/midjourney/inpaint)

## Core Endpoints

| Use case                             | Best page                                              |
| :----------------------------------- | :----------------------------------------------------- |
| Start a new prompt-based job         | [Midjourney Imagine API](/api/en/midjourney/imagine)   |
| Continue a completed result          | [Midjourney Action API](/api/en/midjourney/action)     |
| Combine several source images        | [Midjourney Blend API](/api/en/midjourney/blend)       |
| Turn an image into prompt text       | [Midjourney Describe API](/api/en/midjourney/describe) |
| Look up the seed from a finished job | [Midjourney Seed API](/api/en/midjourney/seed)         |
| Regenerate only one part of an image | [Midjourney Inpaint API](/api/en/midjourney/inpaint)   |
| Poll task status and outputs         | [Midjourney Fetch API](/api/en/midjourney/fetch)       |

## FAQ

### Which Midjourney endpoint should I start with?

If the user is starting from a fresh prompt, start with [Midjourney Imagine](/api/en/midjourney/imagine). That is the normal entry point for a new generation.

### When should I use Action instead of Inpaint?

Use [Midjourney Action](/api/en/midjourney/action) when you want to continue a completed result with built-in follow-up operations like upscale, variation, reroll, pan, or zoom. Use [Midjourney Inpaint](/api/en/midjourney/inpaint) when you want to keep most of the image and only change a selected area with a mask.

### How do I get task results reliably?

Store the job identifier from the initial submit call immediately, then use [Midjourney Fetch](/api/en/midjourney/fetch) with that same value. In most apps, losing the job id is a bigger operational problem than the generation itself.

### Do I need Blend or Describe for a normal text-to-image flow?

No. For a standard prompt-first workflow, [Imagine](/api/en/midjourney/imagine) plus [Fetch](/api/en/midjourney/fetch) is enough. Use [Blend](/api/en/midjourney/blend) or [Describe](/api/en/midjourney/describe) only when the workflow starts from images rather than text.
