# GPT Image 2.6 Economy - 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 Economy - Image to Image
      deprecated: false
      description: >
        ## Create Task



        Use this endpoint to create a GPT Image 2.6 Economy image-to-image
        (image editing) task. Try it online and see pricing on the [GPT Image
        2.6 API page](https://kie.ai/gpt-image-2-6).



        GPT Image 2.6 Economy is the cost-efficient GPT Image 2.6 variant. It
        generates at 1K only, with a smaller set of aspect ratios and output
        formats. For faster iteration with more sizes, use GPT Image 2.6 Flare;
        for more detail and tighter consistency across edits, use GPT Image 2.6
        Sunburst.



        ### Parameter tips



        - `aspect_ratio` supports `auto`, `1:1`, `16:9`, `9:16`, `3:2`, `2:3`,
        `21:9`, `4:3`.


        - `output_format` supports `png` only (default).


        - `background`: `transparent`, `opaque` or `auto` (default `auto`).


        - Pass up to 16 images in `input_urls` and refer to them by order in the
        prompt (for example, "the product from image 1 on the background from
        image 2").



        <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-economy-image-to-image
      tags:
        - docs/en/Market/Image    Models/GPT Image
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - model
                - input
              x-apidog-orders:
                - model
                - callBackUrl
                - input
              properties:
                model:
                  type: string
                  enum:
                    - gpt-image-2-6/economy-image-to-image
                  default: gpt-image-2-6/economy-image-to-image
                  description: >-
                    The model name used for generation. This endpoint must use
                    `gpt-image-2-6/economy-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 for the image-to-image task.
                  required:
                    - prompt
                  x-apidog-orders:
                    - prompt
                    - input_urls
                    - aspect_ratio
                    - background
                    - output_format
                  properties:
                    prompt:
                      type: string
                      minLength: 1
                      maxLength: 20000
                      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 20,000 characters.
                      examples:
                        - >-
                          Keep the shelf, the mug shapes, the window light and
                          the camera angle unchanged. Change the glaze of every
                          mug to matte black, and add a small chalkboard sign on
                          the top shelf that reads "FRESH ROAST" in white chalk
                          lettering.
                    input_urls:
                      type: array
                      items:
                        type: string
                        format: uri
                      maxItems: 16
                      description: >-
                        Publicly accessible URLs of the images to edit or use as
                        references. Optional. Up to 16 images; JPEG, PNG or WebP
                        (including jpg), up to 30 MB each. With several images,
                        refer to them by order in the prompt.
                      examples:
                        - - https://example.com/your-image.png
                    aspect_ratio:
                      type: string
                      enum:
                        - auto
                        - '1:1'
                        - '16:9'
                        - '9:16'
                        - '3:2'
                        - '2:3'
                        - '21:9'
                        - '4:3'
                      default: auto
                      description: >-
                        Aspect ratio of the output image. `auto` (default) lets
                        the model choose the frame that best fits the prompt and
                        input images. Economy supports `auto`, `1:1`, `16:9`,
                        `9:16`, `3:2`, `2:3`, `21:9`, `4:3` only.
                      examples:
                        - auto
                    background:
                      type: string
                      enum:
                        - transparent
                        - opaque
                        - auto
                      default: auto
                      description: >-
                        Background handling.

                        - `transparent`: transparent background, useful for
                        product cut-outs, icons and stickers

                        - `opaque`: always a solid background

                        - `auto` (default): the model decides
                      examples:
                        - auto
                    output_format:
                      type: string
                      enum:
                        - png
                      default: png
                      description: >-
                        Output image format. Default `png`. Economy supports
                        `png` only.
                      examples:
                        - png
                      x-apidog-enum:
                        - value: png
                          name: ''
                          description: ''
            example:
              model: gpt-image-2-6/economy-image-to-image
              callBackUrl: https://your-domain.com/api/callback
              input:
                prompt: >-
                  Keep the shelf, the mug shapes, the window light and the
                  camera angle unchanged. Change the glaze of every mug to matte
                  black, and add a small chalkboard sign on the top shelf that
                  reads "FRESH ROAST" in white chalk lettering.
                input_urls:
                  - https://example.com/your-image.png
                aspect_ratio: auto
                background: auto
                output_format: png
      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: 7a1c3e9b52d84f60a3b1c2d4e5f60718
                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/economy-image-to-image
                            param:
                              type: string
                              description: >-
                                Parameters submitted when creating the task, in
                                JSON string format
                              example: >-
                                {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"Keep
                                the shelf, the mug shapes, the window light and
                                the camera angle unchanged. Change the glaze of
                                every mug to matte black, and add a small
                                chalkboard sign on the top shelf that reads
                                \\\"FRESH
                                ROAST\\\".\",\"input_urls\":[\"https://example.com/a.png\"]}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/economy-image-to-image"}
                            resultJson:
                              type: string
                              description: >-
                                Image generation result in JSON string format.
                                resultUrls contains the list of generated image
                                URLs. Present only when state is success.
                              example: >-
                                {"resultUrls":["https://tempfile.aiquickdraw.com/images/chatgpt/file_000000008b8481f7a0a8618ee2d10b84.png"]}
                            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/economy-image-to-image
                            state: success
                            param: >-
                              {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"Keep
                              the shelf, the mug shapes, the window light and
                              the camera angle unchanged. Change the glaze of
                              every mug to matte black, and add a small
                              chalkboard sign on the top shelf that reads
                              \\\"FRESH
                              ROAST\\\".\",\"input_urls\":[\"https://example.com/a.png\"]}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/economy-image-to-image"}
                            resultJson: >-
                              {"resultUrls":["https://tempfile.aiquickdraw.com/images/chatgpt/file_000000008b8481f7a0a8618ee2d10b84.png"]}
                            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/economy-image-to-image
                            state: fail
                            param: >-
                              {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"Keep
                              the shelf, the mug shapes, the window light and
                              the camera angle unchanged. Change the glaze of
                              every mug to matte black, and add a small
                              chalkboard sign on the top shelf that reads
                              \\\"FRESH
                              ROAST\\\".\",\"input_urls\":[\"https://example.com/a.png\"]}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/economy-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-46598134-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: []

```
