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

# Image Actions

> Keep working on an image in an existing task: upscale, vary, remix, reroll, zoom out, pan, inpaint, enhance, animate or extend a video.

| `action` | What it does |
| - | - |
| `upscale` | Upscale one image of a set to 2x resolution, in subtle or creative style. |
| `variation` | Generate four variations of one image, strong or subtle. |
| `remix` | Remix one image with a new prompt while keeping its structure. |
| `reroll` | Run the same prompt again for a fresh set, optionally with a changed prompt. |
| `zoom` | Zoom out of an image, filling in the surroundings. |
| `pan` | Extend an image in one direction. |
| `inpaint` | Repaint only a selected region of an image. |
| `enhance` | Pick one draft and re-render it at full quality. |
| `video` | Turn an image into a 5-second video, with 480p / 720p, motion level and batch size. |
| `video-extend` | Extend a video by 4 seconds, up to 21 seconds total. |

The response carries a new task ID, fetched the same way. The new task has its own `actions`, so you can keep chaining. Operations not listed in `actions` return `unsupported_action`.

> [!TIP]
>
> You can also submit through the unified task endpoint `POST /v1/task/submit` with `model` set to `midjourney-upscale` and the parameters inside `input` (no `action` needed). Both behave and bill the same.


## OpenAPI

````yaml en/openapi/midjourney.json POST /midjourney/action
openapi: 3.1.0
info:
  title: Midjourney API
  version: 1.0.0
  description: Midjourney
servers:
  - url: https://api.ephone.ai
security:
  - bearerAuth: []
paths:
  /midjourney/action:
    post:
      summary: Image Actions
      description: >-
        Keep working on an image in an existing task: upscale, vary, remix,
        reroll, zoom out, pan, inpaint, enhance, animate or extend a video.
        `action` takes the values listed in `actions` of the fetch result;
        switch the tabs under Body to see the parameters of each.
      operationId: midjourney_action
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - upscale
                      default: upscale
                      description: Always `upscale`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which image to use, starting at 1 (1–4
                        for a grid, up to 24 for V8 drafts). Optional when the
                        parent has a single image.
                    type:
                      type: string
                      enum:
                        - subtle
                        - creative
                      default: subtle
                      description: '**Upscale Type**: subtle (default) or creative.'
                    speed:
                      type: string
                      enum:
                        - relax
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: relax is cheapest but queues longer; turbo is
                        fastest at 2x price. You can also write --relax / --fast
                        / --turbo in the prompt; this field wins. Defaults to
                        fast.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                  title: upscale
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - variation
                      default: variation
                      description: Always `variation`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which image to use, starting at 1 (1–4
                        for a grid, up to 24 for V8 drafts). Optional when the
                        parent has a single image.
                    strength:
                      type: string
                      enum:
                        - strong
                        - subtle
                      default: strong
                      description: '**Strength**: strong (default) or subtle.'
                    speed:
                      type: string
                      enum:
                        - relax
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: relax is cheapest but queues longer; turbo is
                        fastest at 2x price. You can also write --relax / --fast
                        / --turbo in the prompt; this field wins. Defaults to
                        fast.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                  title: variation
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - remix
                      default: remix
                      description: Always `remix`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which image to use, starting at 1 (1–4
                        for a grid, up to 24 for V8 drafts). Optional when the
                        parent has a single image.
                    prompt:
                      type: string
                      maxLength: 6000
                      description: '**Prompt**: The new prompt (required).'
                    strength:
                      type: string
                      enum:
                        - strong
                        - subtle
                      default: strong
                      description: '**Strength**: strong (default) or subtle.'
                    speed:
                      type: string
                      enum:
                        - relax
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: relax is cheapest but queues longer; turbo is
                        fastest at 2x price. You can also write --relax / --fast
                        / --turbo in the prompt; this field wins. Defaults to
                        fast.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                    - prompt
                  title: remix
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - reroll
                      default: reroll
                      description: Always `reroll`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    prompt:
                      type: string
                      maxLength: 6000
                      description: >-
                        **Prompt**: Optional rewritten prompt; omit to reuse the
                        original.
                    speed:
                      type: string
                      enum:
                        - relax
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: relax is cheapest but queues longer; turbo is
                        fastest at 2x price. You can also write --relax / --fast
                        / --turbo in the prompt; this field wins. Defaults to
                        fast.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                  title: reroll
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - zoom
                      default: zoom
                      description: Always `zoom`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which image to use, starting at 1 (1–4
                        for a grid, up to 24 for V8 drafts). Optional when the
                        parent has a single image.
                    zoom:
                      type: number
                      default: 2
                      minimum: 1
                      maximum: 2
                      description: '**Zoom Factor**: 1.0 to 2.0, default 2.0.'
                    prompt:
                      type: string
                      maxLength: 6000
                      description: >-
                        **Prompt**: Optional: describe the new area; --ar is
                        allowed.
                    speed:
                      type: string
                      enum:
                        - relax
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: relax is cheapest but queues longer; turbo is
                        fastest at 2x price. You can also write --relax / --fast
                        / --turbo in the prompt; this field wins. Defaults to
                        fast.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                  title: zoom
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - pan
                      default: pan
                      description: Always `pan`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which image to use, starting at 1 (1–4
                        for a grid, up to 24 for V8 drafts). Optional when the
                        parent has a single image.
                    direction:
                      type: string
                      enum:
                        - up
                        - down
                        - left
                        - right
                      description: '**Direction**: up, down, left or right.'
                    prompt:
                      type: string
                      maxLength: 6000
                      description: '**Prompt**: Optional: describe the extended area.'
                    speed:
                      type: string
                      enum:
                        - relax
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: relax is cheapest but queues longer; turbo is
                        fastest at 2x price. You can also write --relax / --fast
                        / --turbo in the prompt; this field wins. Defaults to
                        fast.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                    - direction
                  title: pan
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - inpaint
                      default: inpaint
                      description: Always `inpaint`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which image to use, starting at 1 (1–4
                        for a grid, up to 24 for V8 drafts). Optional when the
                        parent has a single image.
                    mask:
                      type: string
                      description: >-
                        **Mask**: White = repaint, black = keep. An image URL
                        (publicly reachable) or a base64 data URI, up to 20 MB
                        each.
                    prompt:
                      type: string
                      maxLength: 6000
                      description: '**Prompt**: Optional: what the region should become.'
                    speed:
                      type: string
                      enum:
                        - relax
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: relax is cheapest but queues longer; turbo is
                        fastest at 2x price. You can also write --relax / --fast
                        / --turbo in the prompt; this field wins. Defaults to
                        fast.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                    - mask
                  title: inpaint
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - enhance
                      default: enhance
                      description: Always `enhance`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which draft to enhance, starting at 1
                        (1–4 for a set of four, up to 24 for a draft batch).
                    speed:
                      type: string
                      enum:
                        - relax
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: relax is cheapest but queues longer; turbo is
                        fastest at 2x price. You can also write --relax / --fast
                        / --turbo in the prompt; this field wins. Defaults to
                        fast.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                    - index
                  title: enhance
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - video
                      default: video
                      description: Always `video`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which image to use, starting at 1 (1–4
                        for a grid, up to 24 for V8 drafts). Optional when the
                        parent has a single image.
                    prompt:
                      type: string
                      maxLength: 6000
                      description: >-
                        **Prompt**: Optional: describe the motion. Without it,
                        motion is generated automatically.
                    resolution:
                      type: string
                      enum:
                        - 480p
                        - 720p
                      default: 480p
                      description: '**Resolution**: 480p (default) or 720p (3.2x price).'
                    motion:
                      type: string
                      enum:
                        - low
                        - high
                      default: low
                      description: >-
                        **Motion**: low (default, subtle motion) or high (large
                        camera motion).
                    batch_size:
                      type: integer
                      enum:
                        - 1
                        - 2
                        - 4
                      default: 1
                      description: >-
                        **Batch Size**: Videos per task: 1 (default), 2 or 4;
                        priced by count.
                    end_image:
                      type: string
                      description: >-
                        **End Frame**: Optional end frame. An image URL
                        (publicly reachable) or a base64 data URI, up to 20 MB
                        each.
                    loop:
                      type: boolean
                      default: false
                      description: >-
                        **Loop**: Make a seamless loop; cannot be combined with
                        end_image.
                    speed:
                      type: string
                      enum:
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: Video supports fast and turbo only. You can
                        also write --fast / --turbo in the prompt; this field
                        wins.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                  title: video
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - video-extend
                      default: video-extend
                      description: Always `video-extend`.
                    task_id:
                      type: string
                      description: >-
                        **Task ID**: The task to continue from (the task_id
                        returned on submit). It must have succeeded.
                    index:
                      type: integer
                      minimum: 1
                      maximum: 24
                      description: >-
                        **Image Index**: Which video to extend, starting at 1.
                        Optional when there is only one.
                    prompt:
                      type: string
                      maxLength: 6000
                      description: '**Prompt**: Optional: describe what happens next.'
                    motion:
                      type: string
                      enum:
                        - low
                        - high
                      default: low
                      description: >-
                        **Motion**: low (default, subtle motion) or high (large
                        camera motion).
                    speed:
                      type: string
                      enum:
                        - fast
                        - turbo
                      default: fast
                      description: >-
                        **Speed**: Video supports fast and turbo only. You can
                        also write --fast / --turbo in the prompt; this field
                        wins.
                    notify_hook:
                      type: string
                      format: uri
                      description: >-
                        **Notify hook**: when the task ends, the same content as
                        the fetch result is POSTed to this URL (a public http /
                        https URL). Omit it to poll instead.
                  required:
                    - action
                    - task_id
                  title: video-extend
            examples:
              upscale:
                summary: upscale
                value:
                  action: upscale
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 2
                  type: subtle
              variation:
                summary: variation
                value:
                  action: variation
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 1
                  strength: strong
              remix:
                summary: remix
                value:
                  action: remix
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 3
                  prompt: a paper boat on a calm lake --ar 1:1 --v 7
              reroll:
                summary: reroll
                value:
                  action: reroll
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
              zoom:
                summary: zoom
                value:
                  action: zoom
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 1
                  zoom: 1.5
              pan:
                summary: pan
                value:
                  action: pan
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 1
                  direction: right
              inpaint:
                summary: inpaint
                value:
                  action: inpaint
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 1
                  mask: data:image/png;base64,iVBORw0...
                  prompt: a red sailboat
              enhance:
                summary: enhance
                value:
                  action: enhance
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 2
              video:
                summary: video
                value:
                  action: video
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 1
                  motion: low
                  batch_size: 1
              video-extend:
                summary: video-extend
                value:
                  action: video-extend
                  task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                  index: 1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
              example:
                task_id: mj-7a2d3c1f0b9e4d8a8c6b5a4f3e2d1c0b
                action: upscale
                status: submitted
                created_at: 1792000000
        '400':
          description: invalid_request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: invalid_request
                  message: index must be between 1 and 4
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Invalid API key
        '402':
          description: insufficient_quota
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient balance
        '404':
          description: task_not_found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: task_not_found
                  message: Task not found
        '409':
          description: task_not_finished
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: task_not_finished
                  message: The task has not succeeded yet
        '429':
          description: queue_full
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: queue_full
                  message: Queue is full, please try again later
        '500':
          description: upstream_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: upstream_error
                  message: The service is temporarily unavailable, please retry
components:
  schemas:
    SubmitResponse:
      type: object
      properties:
        task_id:
          type: string
          description: Task ID.
        action:
          type: string
          description: Action name, e.g. `imagine`, `upscale`.
        status:
          type: string
          description: Task status, see the table above.
          enum:
            - submitted
            - in_progress
            - success
            - failure
        created_at:
          type: integer
          description: Created at (Unix seconds).
      required:
        - task_id
        - action
        - status
        - created_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your API key in the `Authorization: Bearer YOUR_API_KEY` header.'

````

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