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

# MAI Image 2.7 Flash

> Microsoft MAI Image 2.7 Flash: faster, lower-cost variant of MAI Image 2.7 with identical capabilities and parameters.

Generate one PNG up to 2048×2048 (4,194,304 pixels), or edit and compose with up to 5 reference images. Defaults: `1K` and `1:1`. For text-to-image, choose `ratio` + `image_size` (`1K` or `2K`) or specify exact `width` and `height`. For image-to-image (`image_list` provided), output dimensions are decided by the model from the reference images.

## Pricing

The table below includes one text-to-image output and up to 1,024 UTF-8 bytes of prompt text, with no reference images. Prices are in platform tokens (USD shown in parentheses).

| Ratio | 1K Output Size | 1K Price | 2K Output Size | 2K Price |
|---|---|---|---|---|
| 1:1 | 1024×1024 | 0.78 ($0.0156) | 2048×2048 | 2.75 ($0.0550) |
| 4:3 / 3:4 | 1152×864 / 864×1152 | 0.75 ($0.0150) | 2336×1760 / 1760×2336 | 2.69 ($0.0538) |
| 3:2 / 2:3 | 1248×832 / 832×1248 | 0.77 ($0.0154) | 2496×1664 / 1664×2496 | 2.72 ($0.0544) |
| 16:9 / 9:16 | 1344×768 / 768×1344 | 0.77 ($0.0154) | 2720×1536 / 1536×2720 | 2.74 ($0.0548) |
| 2:1 / 1:2 | 1536×768 / 768×1536 | 0.86 ($0.0172) | 2880×1440 / 1440×2880 | 2.72 ($0.0544) |
| 21:9 / 9:21 | 1792×768 / 768×1792 | 0.99 ($0.0198) | 3104×1312 / 1312×3104 | 2.67 ($0.0534) |
| 4:1 / 1:4 | 3072×768 / 768×3072 | 1.60 ($0.0320) | 4096×1024 / 1024×4096 | 2.75 ($0.0550) |

- Exact `width` × `height` text-to-image outputs are priced proportionally by total pixel count up to 4,194,304 pixels.
- Each additional started 1,024 bytes of trimmed UTF-8 prompt text adds 0.12 tokens ($0.0024).
- Image-to-image / editing (`image_list` provided): because the model determines output dimensions from the reference images, the output component is billed at the 2K ceiling of 2.63 tokens ($0.0526).
- Each reference image adds 0.17 tokens ($0.0034) per started 1,048,576 pixels. Round each image up separately, then sum.
- Example: editing with a short prompt and one 1024×1024 reference image costs 2.92 tokens ($0.0584).

Use `POST /api/v1/pricing/quote` with the same `prompt`, `ratio`, `image_size` (or `width`/`height`), and `image_list` for an exact quote before submitting. Group discounts, if any, apply to the total. Failed jobs refund their charge.

This endpoint outputs one PNG per request. `4K`, `ratio: "auto"`, transparent background, and multiple outputs (`n > 1`) are not supported.

Returns an `img_uuid`; poll `GET /api/v1/jobs/detail` or use `custom_callback_url`.



## OpenAPI

````yaml api-reference/image-api/openapi-mai-image-2-7-flash.json POST /api/v1/images/generations
openapi: 3.1.0
info:
  title: GoEnhance API - MAI Image 2.7 Flash
  description: MAI Image 2.7 Flash
  version: 1.0.0
servers:
  - url: https://api.goenhance.ai
security: []
paths:
  /api/v1/images/generations:
    post:
      tags:
        - ImageAPI
      summary: MAI Image 2.7 Flash
      description: >-
        Microsoft MAI Image 2.7 Flash: faster, lower-cost variant of MAI Image
        2.7 with identical capabilities and parameters.


        Generate one PNG up to 2048×2048 (4,194,304 pixels), or edit and compose
        with up to 5 reference images. Defaults: `1K` and `1:1`. For
        text-to-image, choose `ratio` + `image_size` (`1K` or `2K`) or specify
        exact `width` and `height`. For image-to-image (`image_list` provided),
        output dimensions are decided by the model from the reference images.


        ## Pricing


        The table below includes one text-to-image output and up to 1,024 UTF-8
        bytes of prompt text, with no reference images. Prices are in platform
        tokens (USD shown in parentheses).


        | Ratio | 1K Output Size | 1K Price | 2K Output Size | 2K Price |

        |---|---|---|---|---|

        | 1:1 | 1024×1024 | 0.78 ($0.0156) | 2048×2048 | 2.75 ($0.0550) |

        | 4:3 / 3:4 | 1152×864 / 864×1152 | 0.75 ($0.0150) | 2336×1760 /
        1760×2336 | 2.69 ($0.0538) |

        | 3:2 / 2:3 | 1248×832 / 832×1248 | 0.77 ($0.0154) | 2496×1664 /
        1664×2496 | 2.72 ($0.0544) |

        | 16:9 / 9:16 | 1344×768 / 768×1344 | 0.77 ($0.0154) | 2720×1536 /
        1536×2720 | 2.74 ($0.0548) |

        | 2:1 / 1:2 | 1536×768 / 768×1536 | 0.86 ($0.0172) | 2880×1440 /
        1440×2880 | 2.72 ($0.0544) |

        | 21:9 / 9:21 | 1792×768 / 768×1792 | 0.99 ($0.0198) | 3104×1312 /
        1312×3104 | 2.67 ($0.0534) |

        | 4:1 / 1:4 | 3072×768 / 768×3072 | 1.60 ($0.0320) | 4096×1024 /
        1024×4096 | 2.75 ($0.0550) |


        - Exact `width` × `height` text-to-image outputs are priced
        proportionally by total pixel count up to 4,194,304 pixels.

        - Each additional started 1,024 bytes of trimmed UTF-8 prompt text adds
        0.12 tokens ($0.0024).

        - Image-to-image / editing (`image_list` provided): because the model
        determines output dimensions from the reference images, the output
        component is billed at the 2K ceiling of 2.63 tokens ($0.0526).

        - Each reference image adds 0.17 tokens ($0.0034) per started 1,048,576
        pixels. Round each image up separately, then sum.

        - Example: editing with a short prompt and one 1024×1024 reference image
        costs 2.92 tokens ($0.0584).


        Use `POST /api/v1/pricing/quote` with the same `prompt`, `ratio`,
        `image_size` (or `width`/`height`), and `image_list` for an exact quote
        before submitting. Group discounts, if any, apply to the total. Failed
        jobs refund their charge.


        This endpoint outputs one PNG per request. `4K`, `ratio: "auto"`,
        transparent background, and multiple outputs (`n > 1`) are not
        supported.


        Returns an `img_uuid`; poll `GET /api/v1/jobs/detail` or use
        `custom_callback_url`.
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: '{{Authorization}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - mai-image-2-7-flash
                  description: Model name. Must be `mai-image-2-7-flash`.
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 20000
                  description: >-
                    Text description or editing instructions, up to 20,000
                    characters. Input billing uses the UTF-8 byte length of the
                    trimmed prompt.
                ratio:
                  type: string
                  enum:
                    - '1:1'
                    - '4:3'
                    - '3:4'
                    - '3:2'
                    - '2:3'
                    - '16:9'
                    - '9:16'
                    - '2:1'
                    - '1:2'
                    - '21:9'
                    - '9:21'
                    - '4:1'
                    - '1:4'
                  default: '1:1'
                  description: >-
                    Output aspect ratio for text-to-image. `auto` is not
                    supported. Ignored when `width`/`height` or `image_list` is
                    provided.
                image_size:
                  type: string
                  enum:
                    - 1K
                    - 2K
                  default: 1K
                  description: >-
                    Resolution tier for text-to-image (`1K` or `2K`; `4K` is not
                    supported). Ignored when `width`/`height` or `image_list` is
                    provided.
                width:
                  type: integer
                  minimum: 768
                  maximum: 4096
                  description: >-
                    Optional exact pixel width for text-to-image only. Must be
                    provided together with `height`, both >= 768 and `width *
                    height <= 4,194,304`. Rounded down to a multiple of 32 by
                    the model. Overrides `ratio` and `image_size`.
                height:
                  type: integer
                  minimum: 768
                  maximum: 4096
                  description: >-
                    Optional exact pixel height for text-to-image only. Must be
                    provided together with `width`.
                background:
                  type: string
                  enum:
                    - opaque
                    - auto
                  description: >-
                    Optional background mode (`opaque` or `auto`). Transparent
                    background is not supported.
                image_list:
                  type: array
                  minItems: 0
                  maxItems: 5
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        format: uri
                    required:
                      - url
                  description: >-
                    Up to 5 direct public image URLs for single-image editing or
                    multi-image composition. Each image must return HTTP 200 or
                    206 without redirects (max 50MB). Output dimensions are
                    determined by the model from the reference images.
                custom_callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. A publicly accessible HTTPS URL. When the task
                    status changes (processing / success / failed), GoEnhance
                    sends a POST request to this URL. The request body is
                    identical to the response of GET /api/v1/jobs/detail. If
                    your server does not respond with HTTP 200, the notification
                    is retried up to 3 times, with a 3-second timeout per
                    attempt.
                  example: https://your-server.com/goenhance/callback
              required:
                - model
                - prompt
            example:
              model: mai-image-2-7-flash
              prompt: >-
                A glass perfume bottle on white marble, clean product
                photography, soft side lighting
              ratio: '1:1'
              image_size: 1K
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      img_uuid:
                        type: string
                      cost:
                        type: number
                        description: >-
                          Tokens deducted for this request. This is the amount
                          actually charged, so it already reflects any discount
                          active on your account and can be lower than the
                          listed price. Tokens are deducted when the task is
                          accepted, and refunded automatically if the generation
                          ends in failure.
                        example: 0.78
                    required:
                      - img_uuid
                      - cost
                required:
                  - code
                  - msg
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    code: 0
                    msg: Success
                    data:
                      img_uuid: c12b656c-747a-44fd-9c80-add79b0c52d5
                      cost: 0.78
                '2':
                  summary: Insufficient tokens
                  value:
                    code: 100
                    msg: tokens is not enough
                quota:
                  summary: API key quota exceeded
                  value:
                    code: 101
                    msg: 'API key quota exceeded: 4990 of 5000 tokens used (monthly)'
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                required:
                  - code
                  - msg
          headers: {}
      deprecated: false
      security: []

````

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