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

# Midjourney Inpaint

Use the Midjourney Inpaint feature to repaint a specified region of a generated image. Supports specifying the repaint region via polygon areas or black-and-white mask images. This endpoint uses async processing; the client needs to query the final result using the task\_id.

## Request Headers

**Content-Type** `string` *required*

Enum: `application/json`

**Authorization** `string` *required*

Bearer authentication format: Bearer \{\{API Key}}.

## Request Body

**image\_no** `integer` *required*

Image number, used to specify which image to inpaint.

Range: 0\~3

**task\_id** `string` *required*

The unique identifier of the original image generation task.

**remix\_prompt** `string`

Inpaint region prompt, used to describe the desired content for the repainted region.

Length limit: 1-8192 characters.

**mask** `object` *required*

Repaint region configuration, replaces the area parameter, and supports multi-region inpainting. Choose either areas or url.

**properties**

**url** `string`

A black-and-white binary image specifying polygon regions; supports specifying multiple regions. The white region is the repaint region.

**areas** `array`

Array of polygon regions; supports specifying multiple regions.

**InpaintArea properties**

**points** `array` *required*

Array of polygon region coordinate points, with the top-left as the origin, organized clockwise in XYXY format.

**width** `float` *required*

Image pixel width.

Range: 500\~4096

**height** `float` *required*

Image pixel height.

Range: 500\~4096

**area** `object` *required*

Single polygon region configuration (use either this or the mask parameter).

**properties**

**points** `array` *required*

Array of polygon region coordinate points, with the top-left as the origin, organized clockwise in XYXY format.

**width** `float` *required*

Image pixel width.

Range: 500\~4096

**height** `float` *required*

Image pixel height.

Range: 500\~4096

## Response

**task\_id** `string` *required*

The task\_id of the async task. Use the task\_id to call the [Get Async Task Result API](https://docs.myrouter.ai/docs/models/reference-get-async-task-result.md) to retrieve the generated result.


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