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

# GPT Image 2.6 Image Generation

> - GPT Image 2.6 (gpt-image-2.6-sunburst / gpt-image-2.6-flare) supports text-to-image, image-to-image, image editing and markup-guided editing, with animated GIF and SVG vector output
- Asynchronous processing: use the returned task ID to [query the task](/en/api-manual/task-management/get-task-detail)
- Generated image links are valid for 24 hours. Save the results promptly



## OpenAPI

````yaml en/api-manual/image-series/gpt-image-2.6/gpt-image-2.6-image-generation.json POST /v1/images/generations
openapi: 3.1.0
info:
  title: gpt-image-2.6 API
  description: >-
    Create image tasks using AI models with support for multiple models and
    parameter configurations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Image Generation
    description: AI image generation related APIs
paths:
  /v1/images/generations:
    post:
      tags:
        - Image Generation
      summary: gpt-image-2.6 API
      description: >-
        - GPT Image 2.6 (gpt-image-2.6-sunburst / gpt-image-2.6-flare) supports
        text-to-image, image-to-image, image editing and markup-guided editing,
        with animated GIF and SVG vector output

        - Asynchronous processing: use the returned task ID to [query the
        task](/en/api-manual/task-management/get-task-detail)

        - Generated image links are valid for 24 hours. Save the results
        promptly
      operationId: createImageGenerationGptImage26
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              text_to_image:
                summary: Text to Image (simple)
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: A beautiful colorful sunset over the ocean
              text_to_image_hd:
                summary: Text to Image (HD 16:9)
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: Cinematic wide shot of a futuristic city skyline at dusk
                  size: '16:9'
                  resolution: 4K
                  quality: high
                  'n': 1
                  complexity: high
              text_to_image_pixel:
                summary: Text to Image (explicit pixels)
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: Minimalist logo design
                  size: 1024x1024
                  quality: medium
              image_edit:
                summary: Image-to-Image / Edit
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: Add a cute cat next to her
                  size: '1:1'
                  resolution: 1K
                  quality: medium
                  image_urls:
                    - https://example.com/input.png
                  callback_url: https://your-domain.com/webhook/image-done
              image_inpaint:
                summary: Inpainting (with mask)
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: Replace the sky with a starry night
                  size: '1:1'
                  resolution: 1K
                  quality: medium
                  image_urls:
                    - https://example.com/input.png
                  mask_url: https://example.com/mask.png
              markup_edit:
                summary: Markup-guided editing
                value:
                  model: gpt-image-2.6-flare
                  prompt: >-
                    Change the vase inside the red circle to solid cobalt-blue
                    ceramic, keep everything else unchanged, and remove the red
                    circle
                  quality: medium
                  image_urls:
                    - https://example.com/kitchen.png
                  markup_url: https://example.com/markup.png
              batch_generation:
                summary: Batch generation
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: A cute robot in pixel art style
                  size: '1:1'
                  resolution: 2K
                  quality: high
                  'n': 4
              gif_animation:
                summary: Animated GIF
                value:
                  model: gpt-image-2.6-flare
                  prompt: >-
                    A lantern swaying gently in the night breeze, with a
                    seamless loop
                  output_format: gif
                  size: auto
                  quality: medium
                  model_params:
                    frame_count: 9
                    frame_duration_ms: 200
              svg_vector:
                summary: SVG vector image
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: >-
                    A flat-style logo for a bakery, featuring wheat ears and a
                    circular badge
                  output_format: svg
                  quality: medium
                  model_params:
                    svg_model: gpt-6.1-terra
              gif_animation_pixel:
                summary: Animated GIF (explicit frame size)
                value:
                  model: gpt-image-2.6-flare
                  prompt: A kitten blinking naturally, in a seamless loop
                  output_format: gif
                  size: 720x720
                  quality: low
                  model_params:
                    frame_count: 16
                    frame_duration_ms: 200
      responses:
        '200':
          description: Image generation task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: Unauthenticated, invalid or expired token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: Insufficient quota, recharge required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: gpt-image-2.6-sunburst'
                  type: invalid_request_error
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >-
            Image generation model name, with improved stability and control for
            commercial use


            | Model ID | Best suited for |

            |---|---|

            | `gpt-image-2.6-sunburst` | Greater detail for precise visual work
            |

            | `gpt-image-2.6-flare` | Faster generation for quick iteration |


            Both models accept exactly the same parameters. Actual token
            consumption at the same `quality` tier may differ slightly; use the
            returned `usage` as the source of truth.
          enum:
            - gpt-image-2.6-sunburst
            - gpt-image-2.6-flare
          default: gpt-image-2.6-sunburst
          example: gpt-image-2.6-sunburst
        prompt:
          type: string
          description: >-
            Prompt describing the image to generate or how to edit the input
            image


            **Length limits (both must be met):**

            - Up to `32,000` characters (counted as Unicode code points)

            - The `prompt` text itself must not exceed `60,000` bytes when
            encoded in UTF-8


            Different characters use different numbers of UTF-8 bytes. Use the
            actual encoded byte count.


            If either limit is exceeded, shorten the prompt before resubmitting.


            **Recommendation:** If the prompt exceeds `8000` tokens, the
            generated image may not match expectations; shortening the prompt is
            recommended.
          example: A beautiful colorful sunset over the ocean
          maxLength: 32000
        image_urls:
          type: array
          description: >-
            Reference images as public URLs, for image-to-image and image
            editing


            **Note:**

            - Number of input images per request: `1~16`

            - Size of a single image: not exceeding `50MB`

            - Pixels of a single image: width × height not exceeding
            `178,956,970` px

            - Side length of a single image: width / height each not exceeding
            `23170` px; exceeding this may cause errors

            - Supported file formats: `.jpeg`, `.jpg`, `.png`, `.webp`

            - Image URLs must be directly accessible by the server, or the image
            URL should directly download when accessed (typically these URLs end
            with image file extensions, such as `.png`, `.jpg`)

            - In image-to-image / image editing scenarios, the reference images
            themselves also incur additional image input token consumption

            - With `markup_url`, markup applies to the first image and the
            others serve as references; the first image must have width × height
            ≤ `16,777,216` px

            - Reference images are not supported when `output_format` is `svg`
          items:
            type: string
            format: uri
          example:
            - https://example.com/image1.png
            - https://example.com/image2.png
        mask_url:
          type: string
          format: uri
          description: >-
            Inpainting mask URL — marks the region of the reference image to
            regenerate. **Only valid in image edit mode** (must be combined with
            `image_urls`); the mask is silently ignored in pure text-to-image
            requests.


            **Format requirements:**

            - **Must be a PNG with an alpha channel**: transparent pixels
            (`alpha < 255`) = regions to regenerate; opaque pixels = preserved

            - **Mask dimensions must exactly match the reference image
            dimensions** (width × height in pixels)

            - Single mask per request


            **Note:**

            - At least one reference image is required in `image_urls`; a mask
            sent alone has no effect

            - Cannot be combined with `markup_url`

            - Common errors:
                - `Invalid mask image format - mask image missing alpha channel`: the uploaded image has no alpha channel (JPEG, opaque PNG, etc.). Re-export the mask as a PNG with transparent regions.
                - `Invalid mask image format - mask size does not match image size`: the mask dimensions don't match the reference image. Resize the mask to the same pixel dimensions as your reference image.
          example: https://example.com/mask.png
        markup_url:
          type: string
          format: uri
          description: >-
            Public URL of a markup layer. Use circles, arrows or freehand marks
            to indicate what to change in the reference image, and describe the
            changes in `prompt`. **Only valid in image editing mode** (requires
            `image_urls`).


            **Format requirements:**

            - **Must be a PNG with transparent pixels**: draw only the
            annotations and leave the rest transparent. Do not draw directly on
            the original image

            - **Dimensions must exactly match the first reference image** (width
            × height in pixels)

            - The first reference image and the markup layer must each have
            width × height ≤ `16,777,216` px

            - File size: no more than `50MB`


            **Note:**

            - Markup applies to the first image in `image_urls`; the remaining
            images serve as references

            - Cannot be combined with `mask_url`

            - Supports standard image and GIF editing, but not SVG

            - Can also be supplied as `model_params.markup_url`; the top-level
            value takes precedence when both are present

            - In `prompt`, also specify what to preserve, for example, "keep
            everything else unchanged and remove the red circle"
          example: https://example.com/markup.png
        size:
          type: string
          description: >-
            Generated image dimensions. Defaults to `auto`. Standard images and
            SVG reference images share the following rules; GIF uses the
            separate rules in section ④.


            **① Standard images / SVG reference images: ratio format (15
            options)**


            - `1:1`: Square

            - `1:2` / `2:1`: Extreme portrait / landscape

            - `1:3` / `3:1`: Ultra portrait / landscape (3:1 limit)

            - `2:3` / `3:2`: Standard portrait / landscape

            - `3:4` / `4:3`: Classic portrait / landscape

            - `4:5` / `5:4`: Common social media

            - `9:16` / `16:9`: Mobile / desktop widescreen

            - `9:21` / `21:9`: Ultra-wide


            **② Standard images / SVG reference images: explicit pixel format**:
            `WxH` (or `W×H`), e.g. `1024x1024`, `1536x1024`, `3840×2160`


            - Both width and height must be multiples of `16`

            - Each edge range: `[16, 3840]`

            - Pixel budget: `655,360 ≤ width × height ≤ 8,294,400` (about 0.65
            MP ~ 8.29 MP)

            - Aspect ratio: `≤ 3:1`


            **③ Standard images / SVG reference images: `auto`**: The model
            decides the size automatically (`resolution` does not apply in this
            mode)


            **④ GIF output**: `size` specifies the dimensions of each frame.
            Only `auto` and explicit pixel dimensions are supported, not ratios.


            - With `auto`, each frame is `512×512`

            - Explicit frame width and height must be positive multiples of `16`

            - The `655,360` minimum pixel count for standard images does not
            apply to individual GIF frames; for example, `512x512` is valid

            - The image combining all frames must satisfy the edge, total pixel
            and aspect ratio limits; see `model_params.frame_count` for grid
            layouts and per-frame limits

            - `resolution` does not apply


            **Out-of-range handling:**

            - For standard images / SVG reference images, a ratio + `resolution`
            combination that exceeds the budget is automatically scaled down
            proportionally (e.g. 4K 2:1 → 3840×1920)

            - Explicit GIF frame dimensions that exceed the limits return HTTP
            400 and are not automatically scaled down
          default: auto
          example: auto
        resolution:
          type: string
          description: >-
            Resolution tier shortcut, only effective when `size` is a ratio;
            ignored in explicit pixel mode and for GIF output


            **Pixel budget rules** (dimensions are derived from the target pixel
            count and the `size` ratio, aligned to multiples of 16):


            - `1K`: ~1 MP (1024² = 1,048,576 pixels)

            - `2K`: ~4 MP (2048² = 4,194,304 pixels)

            - `4K`: ~8.29 MP (3840×2160 = 8,294,400 pixels, the maximum)


            **Landscape / square output dimensions** (portrait dimensions are
            the landscape width/height swapped, e.g. `2:3` = `3:2` reversed):


            | Ratio | 1K | 2K | 4K |

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

            | `1:1` | 1024×1024 | 2048×2048 | 2880×2880 |

            | `2:1` | 1456×720 | 2896×1456 | 3840×1920 \* |

            | `3:1` | 1776×592 | 3552×1184 | 3840×1280 \* |

            | `3:2` | 1248×832 | 2512×1680 | 3520×2352 |

            | `4:3` | 1184×880 | 2368×1776 | 3312×2480 \* |

            | `5:4` | 1152×912 | 2288×1824 | 3216×2576 |

            | `16:9` | 1360×768 | 2736×1536 | 3840×2160 (UHD) |

            | `21:9` | 1568×672 | 3136×1344 | 3840×1648 \* |


            \* Marks combinations that are auto-downscaled to fit the pixel
            budget. Values are case-insensitive.
          enum:
            - 1K
            - 2K
            - 4K
          default: 1K
          example: 1K
        quality:
          type: string
          description: >-
            Rendering quality, which directly affects output token count and
            cost. Defaults to `medium`


            | Value | Output tokens (1024²) | Relative image output cost (1024²)
            |

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

            | `low` | 824 | ~0.57× |

            | `medium` | 1,449 | 1.0× |

            | `high` | 1,756 | ~1.21× |

            | `xhigh` | 3,122 | ~2.15× |

            | `max` | 7,024 | ~4.85× |


            **Note:**

            - This table compares image output costs only, excluding input costs
            and SVG author model costs

            - Calculated for `1024×1024`; output tokens vary with total pixels
            and aspect ratio. Use the returned `usage` for actual consumption

            - For GIF output, tokens are calculated for the combined image
            containing all frames; for SVG output, quality applies to the
            reference image

            - Use `low` for quick drafts. For final assets, compare tiers to
            balance detail, latency and cost
          enum:
            - low
            - medium
            - high
            - xhigh
            - max
          default: medium
          example: medium
        complexity:
          type: string
          description: >-
            Planning depth before image generation, independent of `quality`.
            Defaults to `high`


            - `low`: Suitable for local changes such as replacing a background
            or changing sign text

            - `medium`: Balanced

            - `high`: Suitable for text-heavy images, complex layouts or complex
            relationships between objects


            **Note:**

            - Higher levels take longer and may introduce unwanted changes;
            compare results for your task

            - Changing `complexity` does not incur an additional charge

            - For SVG output, this applies to the reference image

            - Can also be supplied as `model_params.complexity`; the top-level
            value takes precedence when both are present
          enum:
            - low
            - medium
            - high
          default: high
          example: high
        background:
          type: string
          description: |-
            Alpha channel of the output image. Defaults to `opaque`

            - `opaque`: Flat background, no alpha channel
            - `transparent`: Keeps the alpha channel

            **Note:**
            - `transparent` is a Preview feature and results may be unstable
            - When using `transparent`, `output_format` must be `png` or `webp`
            - When `output_format` is `gif` or `svg`, only `opaque` is supported
          enum:
            - opaque
            - transparent
          default: opaque
          example: opaque
        output_format:
          type: string
          description: >-
            Output file format. Defaults to `png`


            - `png`: Lossless, supports transparent backgrounds

            - `jpeg`: Lossy compression with smaller files

            - `webp`: Balances file size and quality; also supports transparency

            - `gif`: Animated GIF; see `model_params` for frame count and frame
            duration

            - `svg`: SVG vector image, suitable for logos, icons and other
            graphics that need lossless scaling


            **Note:**

            - When `background` is `transparent`, only `png` or `webp` is
            allowed

            - `gif` supports both text-to-image and image editing

            - For `gif` and `svg`, `n` must be `1`

            - `svg` supports text-to-image only

            - SVG output is created by first generating a reference image, then
            using an author model (`model_params.svg_model`) to convert it to
            vector graphics. Author model tokens are billed separately at that
            model's rates
          enum:
            - png
            - jpeg
            - webp
            - gif
            - svg
          default: png
          example: png
        'n':
          type: integer
          description: >-
            Number of images to generate, each billed independently


            **Note:**

            - Text input tokens scale linearly with `n`

            - Support for `n > 1` is currently unreliable: even with a value
            greater than 1, only one image is often returned. The actual count
            is whatever `results` holds in the response, and billing follows the
            returned `usage`. If you need several images, send multiple
            single-image requests instead

            - When `output_format` is `gif` or `svg`, this must be `1`
          minimum: 1
          maximum: 10
          default: 1
          example: 1
        model_params:
          type: object
          description: >-
            Model-specific parameters. GIF frame parameters and SVG author
            parameters must be supplied in this object.


            - `frame_count` and `frame_duration_ms` are only allowed with
            `output_format=gif`

            - `svg_model` and `svg_reasoning_effort` are only allowed with
            `output_format=svg`

            - Parameters incompatible with the output format return HTTP 400;
            they are not silently ignored
          properties:
            frame_count:
              type: integer
              description: >-
                Number of GIF frames. Only available when `output_format` is
                `gif`. Defaults to `9`.


                All frames are generated together as one combined image.
                Explicit frame width and height must be positive multiples of
                `16`; individual frames are not subject to the minimum pixel
                count for standard images. Edge lengths below are in pixels.


                | Frames | Per-frame limits | Example size |

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

                | `2`~`8` | ≤ 1,036,800 pixels; one edge ≤ 960, the other ≤ 1920
                | `960x1072` |

                | `9` | ≤ 921,600 pixels; both edges ≤ 1280 | `1280x720` |

                | `10`~`12` | ≤ 691,200 pixels; one edge ≤ 1280, the other ≤ 960
                | `960x720` |

                | `13`~`16` | ≤ 518,400 pixels; both edges ≤ 960 | `720x720` |


                **Grid layout (columns × rows):**

                - `2`~`8` frames: `4×2` or `2×4`

                - `9` frames: `3×3`

                - `10`~`12` frames: `3×4` or `4×3`, with `4×4` tried if
                necessary

                - `13`~`16` frames: `4×4`


                **All of the following must also hold:**

                - At least one layout must keep each edge of the combined image
                ≤ `3840` px, total pixels ≤ `8,294,400` and aspect ratio ≤ `3:1`

                - When using a `4×4` layout, each frame must satisfy the area
                and edge limits listed for `13`~`16` frames

                - If no available layout fits, the request returns HTTP 400; the
                area and edge limits in the table are not the only constraints


                With `size=auto`, each frame is `512×512`, which works for every
                supported frame count. Output tokens are calculated for the
                combined image, not by adding up individual frames.
              minimum: 2
              maximum: 16
              default: 9
              example: 9
            frame_duration_ms:
              type: integer
              description: >-
                Duration of each GIF frame in milliseconds. Only available when
                `output_format` is `gif`. Defaults to `200`, rounded to
                10-millisecond increments
              minimum: 20
              maximum: 2000
              default: 200
              example: 200
            svg_model:
              type: string
              description: >-
                SVG author model that converts the reference image into SVG.
                Only available when `output_format` is `svg`. Defaults to
                `gpt-6.1-terra`


                **Note:**

                - Author model tokens are billed separately at the selected
                model's rates

                - The task result's `usage` includes `svg_model`,
                `svg_input_tokens` and `svg_output_tokens`

                - Author model input and output tokens are listed separately and
                are not included in `usage.total_tokens`
              enum:
                - gpt-6.1-terra
                - gpt-6.1-sol
                - gpt-6-astra
                - gpt-6-sol
                - gpt-6-luna
              default: gpt-6.1-terra
              example: gpt-6.1-terra
            svg_reasoning_effort:
              type: string
              description: >-
                Reasoning effort for the SVG author model. Only available when
                `output_format` is `svg`. If omitted, the author model's default
                level, `medium`, is used


                | Author model | Allowed values |

                |---|---|

                | `gpt-6.1-terra`, `gpt-6-sol`, `gpt-6-luna` | `none`, `low`,
                `medium`, `high`, `xhigh`, `max` |

                | `gpt-6.1-sol`, `gpt-6-astra` | `low`, `medium`, `high`,
                `xhigh`, `max` |


                **Note:**

                - Reasoning tokens are included in the author model's output
                tokens
              enum:
                - none
                - low
                - medium
                - high
                - xhigh
                - max
              example: medium
        callback_url:
          type: string
          description: >-
            HTTPS callback address after task completion


            **Callback Timing:**

            - Triggered when task is completed, failed, or cancelled

            - Sent after billing confirmation is completed


            **Security Restrictions:**

            - Only HTTPS protocol is supported

            - Callback to internal IP addresses is prohibited (127.0.0.1,
            10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)

            - URL length must not exceed `2048` characters


            **Callback Mechanism:**

            - Timeout: `10` seconds

            - Maximum `3` retries on failure (retries after `1` second/`2`
            seconds/`4` seconds)

            - Callback response body format is consistent with the task query
            API response format

            - Callback address returning 2xx status code is considered
            successful, other status codes will trigger retry
          format: uri
          example: https://your-domain.com/webhooks/image-task-completed
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: Task creation timestamp
          example: 1757156493
        id:
          type: string
          description: Task ID
          example: task-unified-1757156493-imcg5zqt
        model:
          type: string
          description: Actual model name used
          example: gpt-image-2.6-sunburst
        object:
          type: string
          enum:
            - image.generation.task
          description: Specific task type
        progress:
          type: integer
          description: Task progress percentage (0-100)
          minimum: 0
          maximum: 100
          example: 1
        status:
          type: string
          description: >-
            Task status. Queued and running tasks both return `processing`; the
            final status is `completed` or `failed`.
          enum:
            - processing
            - completed
            - failed
          example: processing
        task_info:
          $ref: '#/components/schemas/TaskInfo'
          description: Asynchronous task information
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: Task output type
          example: image
        usage:
          $ref: '#/components/schemas/Usage'
          description: Usage and billing information
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code identifier
            message:
              type: string
              description: Error description
            type:
              type: string
              description: Error type
    TaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: Whether the task can be cancelled
          example: true
        estimated_time:
          type: integer
          description: Estimated completion time (seconds)
          minimum: 0
          example: 100
    Usage:
      type: object
      description: >-
        Reserved credits at task creation. Query the task after completion for
        actual consumption and token details.
      properties:
        billing_rule:
          type: string
          description: >-
            Billing rule. GPT Image 2.6 is billed per 1,000 tokens. Image usage,
            text input and SVG author model usage are charged separately at
            their respective rates.
          enum:
            - per_1k_tokens
          example: per_1k_tokens
        credits_reserved:
          type: number
          description: Estimated credits consumed
          minimum: 0
          example: 2.5
        user_group:
          type: string
          description: User group category
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        All APIs require Bearer Token authentication.


        **Get API Key:**


        Visit [API Key Management Page](https://evolink.ai/dashboard/keys) to
        get your API Key


        **Add to request header:**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

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