Skip to main content
POST
/
v1
/
midjourney
/
generations
/
inpaint
curl --request POST \
  --url https://api.apimart.ai/v1/midjourney/generations/inpaint \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "task_id": "task_01KQW0D3WJ2QYJP9E3H7GZ4D2R",
    "speed": "fast"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KV52C0TEJSYZMCG0NCS4YWKK"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/midjourney/generations/inpaint \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "task_id": "task_01KQW0D3WJ2QYJP9E3H7GZ4D2R",
    "speed": "fast"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KV52C0TEJSYZMCG0NCS4YWKK"
    }
  ]
}
Entry point for region inpaint (equivalent to Vary (Region)). After submission the task enters the MODAL state; you must then call modal with a mask + prompt to finish.
ItemValue
actionINPAINT
Billingmidjourney@inpaint[-version][-speed]
Requiredtask_id, or task_id + custom_id
Optionalindex, speed, metadata

Parameters

FieldDescription
task_idSource task ID (typically an Upscale single-image task)
custom_idOptional; button ID for the corresponding Vary (Region) action
indexOptional; which image of the parent task (14, default 1); usually unnecessary for a single image
speedrelax / fast / turbo
metadataOptional custom metadata

Auto matching

The service matches Vary (Region) from the source task buttons.

Request example

{
  "task_id": "task_01KQW0D3WJ2QYJP9E3H7GZ4D2R",
  "speed": "fast"
}

Follow-up

On success the response returns status: "modal" — this is a valid non-terminal state, not an error. Continue with the modal endpoint, where task_id is the local task ID returned by inpaint, plus prompt and optional mask_url.
{
  "task_id": "task_03_inpaint...",
  "status": "modal",
  "model": "midjourney"
}

Notes

  • The parent task must be a SUCCESS upscaled single image; inpainting a grid directly errors — call upscale first.
  • After entering MODAL you must call modal within 30 minutes, otherwise the backend auto-cancels and refunds.
  • Version metadata from the source task is inherited automatically. To price by speed, configure midjourney@inpaint-fast / midjourney@inpaint-turbo.