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

# Midjourney Submit Modal

> Use DeerAPI to call the Midjourney Submit Modal endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the Midjourney Submit Modal workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

## Before you start

Use the DeerAPI base URL and pass your API Key in the `Authorization` header:

```text theme={null}
https://api.deerapi.com
```

```text theme={null}
Authorization: Bearer $DEERAPI_KEY
```

## Model selection

Choose a current model ID from the [live pricing page](https://api.deerapi.com/pricing). Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

## Implementation notes

* Use the OpenAPI playground for the exact request fields accepted by this endpoint.
* Keep API Keys on the server side when you build production applications.
* Log the request ID from failed calls so support can investigate the request.
* Retry `429`, `500`, and `503` responses with exponential backoff.


## OpenAPI

````yaml /api/openapi/image/midjourney/post-submit-modal.openapi.json POST /mj/submit/modal
openapi: 3.1.0
info:
  title: Modal (Area Redesign & Zoom) API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /mj/submit/modal:
    post:
      summary: Modal (Area Redesign & Zoom)
      operationId: modal
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - taskId
              properties:
                maskBase64:
                  type: string
                  description: >-
                    Base64-encoded mask image for partial inpainting. White
                    areas are repainted; black areas are preserved.
                prompt:
                  type: string
                  description: >-
                    Text prompt describing the desired change for the selected
                    region.
                taskId:
                  type: string
                  description: >-
                    Task id from the parent task whose modal action you are
                    continuing.
                  default: example
              default:
                taskId: example
            examples:
              Default:
                summary: Default
                value:
                  prompt: string
                  taskId: '14001934816969359'
            example:
              prompt: string
              taskId: '14001934816969359'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - description
                  - properties
                  - result
                properties:
                  code:
                    type: integer
                    description: |
                      The status of the task
                  description:
                    type: string
                  properties:
                    type: object
                    properties: {}
                  result:
                    type: integer
                    description: |
                      The task ID of the returned task
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl https://api.deerapi.com/mj/submit/modal \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -d '{
                "prompt": "string",
                "taskId": "14001934816969359"
              }'
        - lang: Python
          label: requests
          source: |
            import os
            import requests

            url = "https://api.deerapi.com/mj/submit/modal"
            headers = {
                "Authorization": "Bearer " + os.environ["DEERAPI_KEY"],
                "Content-Type": "application/json",
            }
            payload = {
              "prompt": "string",
              "taskId": "14001934816969359"
            }

            response = requests.post(url, headers=headers, json=payload)
            print(response.json())
        - lang: JavaScript
          label: fetch
          source: >
            const response = await
            fetch("https://api.deerapi.com/mj/submit/modal", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.DEERAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "prompt": "string",
                "taskId": "14001934816969359"
              }),
            });


            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a DeerAPI API Key as a Bearer token.

````