# GPT Image 2.6 Flare - Image to Image

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/jobs/createTask:
    post:
      summary: GPT Image 2.6 Flare - Image to Image
      deprecated: false
      description: >
        ## Create Task


        Use this endpoint to create a GPT Image 2.6 Flare image-to-image task.


        ### GIF animation


        | Parameter | Default | Notes |

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

        | `frame_count` | `9` | Integer 2–16. |

        | `frame_duration_ms` | `200` | Duration per frame in integer
        milliseconds. Minimum 20, rounded to 10 ms. |


        Send these only when `output_format` is `gif`. For `svg`, send
        `svg.model` instead. Do not send `mask_url` with `gif` or `svg`.


        <Card title="Get Task Details" icon="lucide-search"
        href="/market/common/get-task-detail">
         After submission, use the unified query endpoint to check task progress and retrieve results
        </Card>


        ::: tip[]

        For production use, we recommend providing the `callBackUrl` parameter
        so your service can receive completion notifications instead of polling
        for task status.

        :::


        ## Related Resources


        <CardGroup cols={2}>
         <Card title="Model Marketplace" icon="lucide-store" href="/market/quickstart">
         Explore all available models and capabilities
         </Card>
         <Card title="Common API" icon="lucide-cog" href="/common-api/get-account-credits">
         Check account credits and usage
         </Card>
        </CardGroup>
      operationId: gpt-image-2-6-flare-image-to-image
      tags:
        - docs/en/Market/Image    Models/GPT Image
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  enum:
                    - gpt-image-2-6/flare-image-to-image
                  default: gpt-image-2-6/flare-image-to-image
                  description: >-
                    The model name used for generation. This endpoint must use
                    `gpt-image-2-6/flare-image-to-image`.
                callBackUrl:
                  type: string
                  format: uri
                  description: >-
                    Callback URL for task completion notifications. Optional
                    parameter. If provided, the system will send a POST request
                    to this URL when the task completes, whether it succeeds or
                    fails. If omitted, no callback notification will be sent. To
                    ensure callback security, see [Webhook Verification
                    Guide](/common-api/webhook-verification).
                  examples:
                    - https://your-domain.com/api/callback
                input:
                  type: object
                  additionalProperties: false
                  description: Input parameters.
                  properties:
                    prompt:
                      type: string
                      minLength: 1
                      maxLength: 32000
                      description: >-
                        Instruction for how to edit or combine the input images.
                        Say what should stay the same and what should change.
                        Put any text that should appear in the image in quotes.
                        Required, 1 to 32,000 characters.
                      examples:
                        - restyle as cinematic still
                    input_urls:
                      type: array
                      maxItems: 16
                      items:
                        type: string
                        format: uri
                      description: >-
                        Reference image URLs. Required, up to 16 publicly
                        accessible URLs. Accepted types: jpeg / png / webp.
                      examples:
                        - - https://example.com/a.png
                    mask_url:
                      type: string
                      format: uri
                      description: >-
                        Inpaint mask URL. Optional. Cannot be used together with
                        `markup`. Do not send when `output_format` is `gif` or
                        `svg`.
                      examples:
                        - https://example.com/mask.png
                    markup:
                      type: string
                      format: uri
                      description: >-
                        Markup edit. Optional string: URL of a transparent PNG
                        overlaid on the first reference image. Cannot be used
                        together with `mask_url`.
                      examples:
                        - https://example.com/markup.png
                    aspect_ratio:
                      type: string
                      enum:
                        - auto
                        - '1:1'
                        - '3:2'
                        - '2:3'
                        - '4:3'
                        - '3:4'
                        - '5:4'
                        - '4:5'
                        - '16:9'
                        - '9:16'
                        - '2:1'
                        - '1:2'
                        - '21:9'
                        - '9:21'
                        - '3:1'
                        - '1:3'
                      default: auto
                      description: >-
                        Aspect ratio. Optional, default `auto`.


                        For static images (`png` / `jpeg` / `webp`), pixel size
                        is mapped from `aspect_ratio` + `resolution` (see the
                        table on `resolution`).

                        Supported: `auto`, `1:1`, `3:2`, `2:3`, `4:3`, `3:4`,
                        `5:4`, `4:5`, `16:9`, `9:16`, `2:1`, `1:2`, `21:9`,
                        `9:21`, `3:1`, `1:3`.
                      examples:
                        - auto
                    resolution:
                      type: string
                      enum:
                        - 1K
                        - 2K
                        - 4K
                      default: 1K
                      description: |-
                        Resolution tier. Optional, default `1K`.

                        Static-image pixel sizes (width × height):

                        <table>
                        <thead>
                        <tr>
                        <th align="left">ratio</th>
                        <th align="center">1K</th>
                        <th align="center">2K</th>
                        <th align="center">4K</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                        <td nowrap>1:1 / auto</td>
                        <td align="center" nowrap>1024×1024</td>
                        <td align="center" nowrap>2048×2048</td>
                        <td align="center" nowrap>2880×2880</td>
                        </tr>
                        <tr>
                        <td nowrap>3:2</td>
                        <td align="center" nowrap>1536×1024</td>
                        <td align="center" nowrap>2048×1360</td>
                        <td align="center" nowrap>3520×2336</td>
                        </tr>
                        <tr>
                        <td nowrap>2:3</td>
                        <td align="center" nowrap>1024×1536</td>
                        <td align="center" nowrap>1360×2048</td>
                        <td align="center" nowrap>2336×3520</td>
                        </tr>
                        <tr>
                        <td nowrap>4:3</td>
                        <td align="center" nowrap>1024×768</td>
                        <td align="center" nowrap>2048×1536</td>
                        <td align="center" nowrap>3312×2480</td>
                        </tr>
                        <tr>
                        <td nowrap>3:4</td>
                        <td align="center" nowrap>768×1024</td>
                        <td align="center" nowrap>1536×2048</td>
                        <td align="center" nowrap>2480×3312</td>
                        </tr>
                        <tr>
                        <td nowrap>5:4</td>
                        <td align="center" nowrap>1280×1024</td>
                        <td align="center" nowrap>2560×2048</td>
                        <td align="center" nowrap>3216×2576</td>
                        </tr>
                        <tr>
                        <td nowrap>4:5</td>
                        <td align="center" nowrap>1024×1280</td>
                        <td align="center" nowrap>2048×2560</td>
                        <td align="center" nowrap>2576×3216</td>
                        </tr>
                        <tr>
                        <td nowrap>16:9</td>
                        <td align="center" nowrap>1536×864</td>
                        <td align="center" nowrap>2048×1152</td>
                        <td align="center" nowrap>3840×2160</td>
                        </tr>
                        <tr>
                        <td nowrap>9:16</td>
                        <td align="center" nowrap>864×1536</td>
                        <td align="center" nowrap>1152×2048</td>
                        <td align="center" nowrap>2160×3840</td>
                        </tr>
                        <tr>
                        <td nowrap>2:1</td>
                        <td align="center" nowrap>2048×1024</td>
                        <td align="center" nowrap>2688×1344</td>
                        <td align="center" nowrap>3840×1920</td>
                        </tr>
                        <tr>
                        <td nowrap>1:2</td>
                        <td align="center" nowrap>1024×2048</td>
                        <td align="center" nowrap>1344×2688</td>
                        <td align="center" nowrap>1920×3840</td>
                        </tr>
                        <tr>
                        <td nowrap>21:9</td>
                        <td align="center" nowrap>2016×864</td>
                        <td align="center" nowrap>2688×1152</td>
                        <td align="center" nowrap>3840×1648</td>
                        </tr>
                        <tr>
                        <td nowrap>9:21</td>
                        <td align="center" nowrap>864×2016</td>
                        <td align="center" nowrap>1152×2688</td>
                        <td align="center" nowrap>1648×3840</td>
                        </tr>
                        <tr>
                        <td nowrap>3:1</td>
                        <td align="center" nowrap>1536×512</td>
                        <td align="center" nowrap>3072×1024</td>
                        <td align="center" nowrap>3840×1280</td>
                        </tr>
                        <tr>
                        <td nowrap>1:3</td>
                        <td align="center" nowrap>512×1536</td>
                        <td align="center" nowrap>1024×3072</td>
                        <td align="center" nowrap>1280×3840</td>
                        </tr>
                        </tbody>
                        </table>
                      examples:
                        - 1K
                    quality:
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                        - xhigh
                        - max
                        - auto
                      default: medium
                      description: >-
                        Quality. Optional, default `medium`.


                        Supported: `low`, `medium`, `high`, `xhigh`, `max`,
                        `auto`.
                      examples:
                        - medium
                    background:
                      type: string
                      enum:
                        - transparent
                        - opaque
                        - auto
                      default: auto
                      description: >-
                        Background. Optional, default `auto`. Transparent
                        background is only supported with `png` / `webp` /
                        `gif`.


                        - `transparent`: transparent background, useful for
                        product cut-outs, icons and stickers. `output_format`
                        must be `png`, `webp` or `gif`

                        - `opaque`: always a solid background

                        - `auto` (default): the model decides
                      examples:
                        - auto
                    output_format:
                      type: string
                      enum:
                        - png
                        - jpeg
                        - webp
                        - gif
                        - svg
                      default: png
                      description: >-
                        Output format. Optional, default `png`. Passing `jpg` is
                        treated as `jpeg`.


                        Supported: `png`, `jpeg`, `webp`, `gif`, `svg`.


                        - Transparent background is only supported with `png` /
                        `webp` / `gif`

                        - For `gif`, use `frame_count` / `frame_duration_ms`; do
                        not send `svg`

                        - For `svg`, send `svg.model`; do not send the GIF
                        fields

                        - Do not send `mask_url` when `output_format` is `gif`
                        or `svg`
                      examples:
                        - png
                    complexity:
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                      default: high
                      description: |-
                        Planning complexity. Optional, default `high`.

                        Supported: `low`, `medium`, `high`.
                      examples:
                        - high
                    moderation:
                      type: string
                      enum:
                        - auto
                        - low
                      default: low
                      description: |-
                        Moderation strength. Optional, default `low`.

                        Supported: `auto`, `low`.
                      examples:
                        - low
                    output_compression:
                      type: integer
                      minimum: 0
                      maximum: 100
                      description: >-
                        JPEG / WebP compression, 0–100. Optional.


                        Send only when `output_format` is `jpeg` or `webp`. Do
                        not include this field for other formats.
                    svg:
                      type: object
                      additionalProperties: false
                      description: >-
                        Send the whole `svg` object only when
                        `output_format=svg`. Do not include `svg` for other
                        formats.
                      properties:
                        model:
                          type: string
                          enum:
                            - gpt-6-sol
                            - gpt-5.6-luna
                            - gpt-5.6-terra
                          default: gpt-5.6-luna
                          description: >-
                            Text model used to write the SVG. Optional, default
                            `gpt-5.6-luna`.


                            Supported: `gpt-6-sol`, `gpt-5.6-luna`,
                            `gpt-5.6-terra`.


                            SVG output is billed in two parts: image tokens
                            (same as PNG) plus the selected author model's
                            input/output tokens. See the Pricing page for rates.
                          examples:
                            - gpt-5.6-luna
                      x-apidog-orders:
                        - model
                    frame_count:
                      type: integer
                      minimum: 2
                      maximum: 16
                      default: 9
                      description: >-
                        GIF frame count. Send only when `output_format=gif`.
                        Integer 2–16, default 9. Do not send for non-gif.
                      examples:
                        - 9
                    frame_duration_ms:
                      type: integer
                      minimum: 20
                      maximum: 2000
                      multipleOf: 10
                      default: 200
                      description: >-
                        Duration of each GIF frame. Send only when
                        `output_format=gif`. Integer milliseconds, default 200,
                        minimum 20, rounded to 10 ms. Do not send for non-gif.
                      examples:
                        - 200
                  required:
                    - prompt
                    - input_urls
                  x-apidog-orders:
                    - prompt
                    - input_urls
                    - mask_url
                    - markup
                    - aspect_ratio
                    - resolution
                    - quality
                    - background
                    - output_format
                    - complexity
                    - moderation
                    - output_compression
                    - frame_count
                    - frame_duration_ms
                    - svg
              x-apidog-orders:
                - model
                - callBackUrl
                - input
            examples:
              '1':
                value:
                  model: gpt-image-2-6/flare-image-to-image
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    prompt: restyle as cinematic still
                    input_urls:
                      - https://example.com/a.png
                    resolution: 1K
                    output_format: png
                description: Image to image
              '2':
                value:
                  model: gpt-image-2-6/flare-image-to-image
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    prompt: a waving flag
                    input_urls:
                      - https://example.com/a.png
                    output_format: gif
                    frame_count: 9
                    frame_duration_ms: 200
                description: GIF
              '3':
                value:
                  model: gpt-image-2-6/flare-image-to-image
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    prompt: a simple maple leaf icon
                    input_urls:
                      - https://example.com/a.png
                    output_format: svg
                    svg:
                      model: gpt-5.6-luna
                description: SVG
      responses:
        '200':
          description: Request Successful
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  code:
                    type: integer
                    description: >-
                      Response status code


                      - **200**: Success - Request has been processed
                      successfully

                      - **401**: Unauthorized - Authentication credentials are
                      missing or invalid

                      - **402**: Insufficient Credits - Account does not have
                      enough credits to perform the operation

                      - **404**: Not Found - The requested resource or endpoint
                      does not exist

                      - **422**: Validation Error - The request parameters
                      failed validation checks

                      - **429**: Rate Limited - Request limit has been exceeded
                      for this resource

                      - **433**: Request Limit - Sub-key Usage Exceeds Limit

                      - **455**: Service Unavailable - System is currently
                      undergoing maintenance

                      - **500**: Server Error - An unexpected error occurred
                      while processing the request

                      - **501**: Generation Failed - Content generation task
                      failed

                      - **505**: Feature Disabled - The requested feature is
                      currently disabled
                    enum:
                      - 200
                      - 401
                      - 402
                      - 404
                      - 422
                      - 429
                      - 433
                      - 455
                      - 500
                      - 501
                      - 505
                  msg:
                    type: string
                    description: Response message, error description when failed
                    example: success
                  data:
                    type: object
                    required:
                      - taskId
                    properties:
                      taskId:
                        type: string
                        description: >-
                          Task ID, can be used with Get Task Details endpoint to
                          query task status
                        example: 3f2b8c61d0e94a7b8c5d6e7f80912a3b
                title: response not with recordId
          headers: {}
          x-apidog-name: 成功
      security:
        - BearerAuth: []
          x-apidog:
            schemeGroups:
              - id: kn8M4YUlc5i0A0179ezwx
                schemeIds:
                  - BearerAuth
            required: true
            use:
              id: kn8M4YUlc5i0A0179ezwx
            scopes:
              kn8M4YUlc5i0A0179ezwx:
                BearerAuth: []
      callbacks:
        onImageGenerated:
          '{$request.body#/callBackUrl}':
            post:
              summary: Image Generation Callback
              description: Sent when the task succeeds or fails.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      type: object
                      properties:
                        code:
                          type: integer
                          description: >-
                            200: success. 501: failure; see data.failCode and
                            data.failMsg.
                          enum:
                            - 200
                            - 501
                        msg:
                          type: string
                          description: Status message
                          example: Playground task completed successfully.
                        data:
                          type: object
                          properties:
                            completeTime:
                              type: integer
                              format: int64
                              description: >-
                                Task completion time, represented as a Unix
                                timestamp in milliseconds
                              example: 1786433042000
                            costTime:
                              type: integer
                              description: >-
                                Processing time in seconds. Present on both
                                success and failure callbacks.
                              example: 78
                            createTime:
                              type: integer
                              format: int64
                              description: >-
                                Task creation time, represented as a Unix
                                timestamp in milliseconds
                              example: 1786432963000
                            creditsConsumed:
                              type: number
                              format: double
                              description: >-
                                Credits consumed by the task; 0 for failed
                                tasks.
                              example: 3
                            model:
                              type: string
                              description: Image editing model used for the task
                              example: gpt-image-2-6/flare-image-to-image
                            param:
                              type: string
                              description: >-
                                Parameters submitted when creating the task, in
                                JSON string format
                              example: >-
                                {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"restyle
                                as cinematic
                                still\",\"input_urls\":[\"https://example.com/a.png\"]}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/flare-image-to-image"}
                            resultJson:
                              type: string
                              description: >-
                                Image generation result in JSON string format.
                                Present only when state is success. Contains
                                resultUrls (list of generated image URLs) and
                                usage (token usage).
                              example: >-
                                {"resultUrls":["https://example.com/demo/gpt-image-2-6.png"],"usage":{"input_tokens":41,"output_tokens":924,"total_tokens":965,"input_tokens_details":{"text_tokens":41,"image_tokens":0,"cached_tokens":0},"output_tokens_details":{"text_tokens":0,"image_tokens":924}}}
                            state:
                              type: string
                              description: Task status
                              enum:
                                - success
                                - fail
                              example: success
                            taskId:
                              type: string
                              description: Task ID
                              example: 3fd37da5c726d0c8b1278f391906ac82
                            updateTime:
                              type: integer
                              format: int64
                              description: >-
                                Use completeTime as the completion time;
                                updateTime may equal createTime.
                              example: 1786433042000
                            failCode:
                              type: string
                              description: >-
                                Failure code, a numeric string such as "400" or
                                "500". Present only when state is fail.
                              example: '500'
                            failMsg:
                              type: string
                              description: Failure reason. Present only when state is fail.
                              example: <error detail>
                    examples:
                      success:
                        summary: Success
                        value:
                          code: 200
                          msg: Playground task completed successfully.
                          data:
                            taskId: 3fd37da5c726d0c8b1278f391906ac82
                            model: gpt-image-2-6/flare-image-to-image
                            state: success
                            param: >-
                              {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"restyle
                              as cinematic
                              still\",\"input_urls\":[\"https://example.com/a.png\"]}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/flare-image-to-image"}
                            resultJson: >-
                              {"resultUrls":["https://example.com/demo/gpt-image-2-6.png"],"usage":{"input_tokens":41,"output_tokens":924,"total_tokens":965,"input_tokens_details":{"text_tokens":41,"image_tokens":0,"cached_tokens":0},"output_tokens_details":{"text_tokens":0,"image_tokens":924}}}
                            completeTime: 1786433042000
                            createTime: 1786432963000
                            costTime: 78
                            creditsConsumed: 3
                            updateTime: 1786433042000
                      failure:
                        summary: Failure
                        value:
                          code: 501
                          msg: Playground task failed.
                          data:
                            taskId: 3fd37da5c726d0c8b1278f391906ac82
                            model: gpt-image-2-6/flare-image-to-image
                            state: fail
                            param: >-
                              {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"restyle
                              as cinematic
                              still\",\"input_urls\":[\"https://example.com/a.png\"]}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/flare-image-to-image"}
                            failCode: '500'
                            failMsg: <error detail>
                            completeTime: 1786433042000
                            createTime: 1786432963000
                            costTime: 78
                            creditsConsumed: 0
                            updateTime: 1786433042000
              responses:
                '200':
                  description: Callback received successfully
      x-apidog-folder: docs/en/Market/Image    Models/GPT Image
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1184766/apis/api-46575173-run
components:
  schemas: {}
  securitySchemes:
    BearerAuth:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        All API requests require a Bearer Token. Add the header `Authorization:
        Bearer YOUR_API_KEY` to authenticate requests.
    BearerAuth1:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: >-
        所有 API 请求都需要 Bearer Token。请在请求头中添加 `Authorization: Bearer YOUR_API_KEY`
        进行身份验证。
servers:
  - url: https://api.kie.ai
    description: 正式环境
security:
  - BearerAuth: []
    x-apidog:
      schemeGroups:
        - id: kn8M4YUlc5i0A0179ezwx
          schemeIds:
            - BearerAuth
      required: true
      use:
        id: kn8M4YUlc5i0A0179ezwx
      scopes:
        kn8M4YUlc5i0A0179ezwx:
          BearerAuth: []

```
