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



        Use this endpoint to create a GPT Image 2.6 Economy text-to-image 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` (default) and `gif`.


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


        - `frame_count` supports `auto` (default), `4`, `9`, `16`, `25`, `36`,
        `64`.


        - `frame_duration_ms`: `auto` (default), or any integer from 20 to 2000
        rounded to a multiple of 10 ms.


        <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-text-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-text-to-image
                  default: gpt-image-2-6/economy-text-to-image
                  description: >-
                    The model name used for generation. This endpoint must use
                    `gpt-image-2-6/economy-text-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 text-to-image task.
                  required:
                    - prompt
                  x-apidog-orders:
                    - prompt
                    - aspect_ratio
                    - background
                    - output_format
                    - frame_count
                    - frame_duration_ms
                  properties:
                    prompt:
                      type: string
                      minLength: 1
                      maxLength: 20000
                      description: >-
                        Text description of the image to generate. Describe the
                        subject, setting, composition, lighting and style. Put
                        any text that should appear in the image in quotes.
                        Required, 1 to 20,000 characters.
                      examples:
                        - >-
                          A sunlit ceramic studio shelf lined with hand-thrown
                          mugs in muted terracotta and sage glazes, soft morning
                          light through a side window, shallow depth of field,
                          clean editorial product photography, with a small
                          paper tag on the middle shelf that reads "BATCH 07".
                    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.
                        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
                        - gif
                      default: png
                      description: >-
                        Output image format. Default `png`. Economy supports
                        `png` and `gif` only.
                      examples:
                        - png
                    frame_count:
                      type: string
                      enum:
                        - auto
                        - '4'
                        - '9'
                        - '16'
                        - '25'
                        - '36'
                        - '64'
                      default: auto
                      description: >-
                        Number of frames. `auto` (default) lets the model
                        choose. Allowed values: `auto`, `4`, `9`, `16`, `25`,
                        `36`, `64`. This parameter is supported only when the
                        output format is GIF.
                      examples:
                        - auto
                    frame_duration_ms:
                      description: >-
                        Duration of each frame in milliseconds. `auto` (default)
                        lets the model choose. You can also pass any integer
                        from 20 to 2000; values are rounded to a multiple of 10
                        ms. This parameter is supported only when the output
                        format is GIF.
                      type: number
            example:
              model: gpt-image-2-6/economy-text-to-image
              callBackUrl: https://your-domain.com/api/callback
              input:
                prompt: >-
                  A sunlit ceramic studio shelf lined with hand-thrown mugs in
                  muted terracotta and sage glazes, soft morning light through a
                  side window, shallow depth of field, clean editorial product
                  photography, with a small paper tag on the middle shelf that
                  reads "BATCH 07".
                aspect_ratio: auto
                background: auto
                output_format: png
                frame_count: auto
                frame_duration_ms: auto
      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: 1786432830000
                            costTime:
                              type: integer
                              description: >-
                                Processing time in seconds. Present on both
                                success and failure callbacks.
                              example: 83
                            createTime:
                              type: integer
                              format: int64
                              description: >-
                                Task creation time, represented as a Unix
                                timestamp in milliseconds
                              example: 1786432746000
                            creditsConsumed:
                              type: number
                              format: double
                              description: >-
                                Credits consumed by the task; 0 for failed
                                tasks.
                              example: 3
                            model:
                              type: string
                              description: Image generation model used for the task
                              example: gpt-image-2-6/economy-text-to-image
                            param:
                              type: string
                              description: >-
                                Parameters submitted when creating the task, in
                                JSON string format
                              example: >-
                                {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"A
                                sunlit ceramic studio shelf lined with
                                hand-thrown mugs in muted terracotta and sage
                                glazes, soft morning light through a side
                                window, shallow depth of field, clean editorial
                                product
                                photography.\"}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/economy-text-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_000000002b24820caef9f1684a4f4747.png"]}
                            state:
                              type: string
                              description: Task status
                              enum:
                                - success
                                - fail
                              example: success
                            taskId:
                              type: string
                              description: Task ID
                              example: ed578231bfed231f0884c564579a965d
                            updateTime:
                              type: integer
                              format: int64
                              description: >-
                                Use completeTime as the completion time;
                                updateTime may equal createTime.
                              example: 1786432830000
                            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: ed578231bfed231f0884c564579a965d
                            model: gpt-image-2-6/economy-text-to-image
                            state: success
                            param: >-
                              {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"A
                              sunlit ceramic studio shelf lined with hand-thrown
                              mugs in muted terracotta and sage glazes, soft
                              morning light through a side window, shallow depth
                              of field, clean editorial product
                              photography.\"}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/economy-text-to-image"}
                            resultJson: >-
                              {"resultUrls":["https://tempfile.aiquickdraw.com/images/chatgpt/file_000000002b24820caef9f1684a4f4747.png"]}
                            completeTime: 1786432830000
                            createTime: 1786432746000
                            costTime: 83
                            creditsConsumed: 3
                            updateTime: 1786432830000
                      failure:
                        summary: Failure
                        value:
                          code: 501
                          msg: Playground task failed.
                          data:
                            taskId: ed578231bfed231f0884c564579a965d
                            model: gpt-image-2-6/economy-text-to-image
                            state: fail
                            param: >-
                              {"input":"{\"aspect_ratio\":\"auto\",\"prompt\":\"A
                              sunlit ceramic studio shelf lined with hand-thrown
                              mugs in muted terracotta and sage glazes, soft
                              morning light through a side window, shallow depth
                              of field, clean editorial product
                              photography.\"}","callBackUrl":"https://your-domain.com/api/callback","model":"gpt-image-2-6/economy-text-to-image"}
                            failCode: '500'
                            failMsg: <error detail>
                            completeTime: 1786432830000
                            createTime: 1786432746000
                            costTime: 83
                            creditsConsumed: 0
                            updateTime: 1786432830000
              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-46598132-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: []

```
