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

# GPT-Image Result [Unofficial]

> Query image generation result



## OpenAPI

````yaml openapi/en/openai.json get /openai/gpt/fetch
openapi: 3.1.0
info:
  title: Open AI API DOCS
  version: 1.0.0
  description: TTAPI OpenAI API service
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /openai/gpt/fetch:
    get:
      description: Query image generation result
      parameters:
        - name: jobId
          in: query
          required: true
          schema:
            type: string
          description: >-
            Job ID returned synchronously by the generation endpoint (supports
            URL parameters/request body)
          example: 0ccf0606-3f32-4090-85bd-1786e4593be5
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - SUCCESS
                      - ON_QUEUE
                      - FAILED
                    description: >-
                      Task status: ON_QUEUE-processing, SUCCESS-success,
                      FAILED-failed
                    example: SUCCESS
                  message:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Response message: returns success on success, returns
                      specific error reason on failure, returns null during
                      processing
                    example: success
                  jobId:
                    type: string
                    description: >-
                      Unique task identifier for querying task status or
                      receiving callback notifications
                    example: 5ecc5080-b1d7-4b9f-8184-435e46ebb5cb
                  data:
                    description: Task data (different fields returned based on status)
                    oneOf:
                      - title: SUCCESS
                        type: object
                        properties:
                          prompt:
                            type: string
                            description: Text prompt for image generation
                            example: >-
                              A professional full-body flat lay photo of a
                              beautiful female model wearing this outfit. High
                              resolution, photorealistic, perfect detail of all
                              clothing elements, professional pose, attractive
                              figure, trendy style, smiling, fair-skinned
                              Caucasian woman.
                          referImages:
                            type: array
                            items:
                              type: string
                            description: Reference image URL list
                            example:
                              - >-
                                https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                          imageUrl:
                            type: string
                            description: >-
                              Generated result image URL (returned on success).
                              See [Storage & Persistence](/grids/en/faq/storage)
                              for validity period.
                            example: >-
                              https://cdnc.ttapi.io/2025-03-31/cd3f3ce5-06be-4b3a-9aed-014045ca1804.png
                          model:
                            type: string
                            example: gpt-image-2
                          quota:
                            type: string
                            description: Quota consumed
                            example: '2'
                          finishTime:
                            type: string
                            description: 'Task completion time (format: YYYY-MM-DD HH:mm:ss)'
                            example: '2025-03-31 04:25:33'
                          hookUrl:
                            type: string
                            description: Callback URL
                            example: >-
                              https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
                        required:
                          - prompt
                          - referImages
                          - imageUrl
                          - quota
                          - finishTime
                          - hookUrl
                      - title: ON_QUEUE
                        type: object
                        properties:
                          prompt:
                            type: string
                            description: Text prompt for image generation
                            example: >-
                              A professional full-body flat lay photo of a
                              beautiful female model wearing this outfit. High
                              resolution, photorealistic, perfect detail of all
                              clothing elements, professional pose, attractive
                              figure, trendy style, smiling, fair-skinned
                              Caucasian woman.
                          referImages:
                            type: array
                            items:
                              type: string
                            description: Reference image URL list
                            example:
                              - >-
                                https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                          imageUrl:
                            type: string
                            description: >-
                              Generated result image URL (returns null during
                              processing)
                          model:
                            type: string
                            example: gpt-image-2
                          quota:
                            type: string
                            description: Quota consumed
                            example: '2'
                          finishTime:
                            type: string
                            description: >-
                              Task completion time (returns null during
                              processing)
                          hookUrl:
                            type: string
                            description: Callback URL
                            example: >-
                              https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
                        required:
                          - prompt
                          - referImages
                          - quota
                          - hookUrl
                      - title: FAILED
                        type: object
                        properties:
                          prompt:
                            type: string
                            description: Text prompt for image generation
                            example: >-
                              A professional full-body photo of a beautiful
                              Chinese female model in a studio lighting setup
                              trying on clothes. High resolution,
                              photorealistic, professional pose,
                              well-proportioned figure, smiling, fair skin.
                          referImages:
                            type: array
                            items:
                              type: string
                            description: Reference image URL list
                            example:
                              - >-
                                https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                          imageUrl:
                            type: string
                            description: >-
                              Generated result image URL (returns null on
                              failure)
                          model:
                            type: string
                            example: gpt-image-2
                          quota:
                            type: string
                            description: Quota consumed (returns 0 on failure)
                            example: '0'
                          finishTime:
                            type: string
                            description: 'Task completion time (format: YYYY-MM-DD HH:mm:ss)'
                            example: '2025-03-31 04:10:21'
                          hookUrl:
                            type: string
                            description: Callback URL
                            example: >-
                              https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
                        required:
                          - prompt
                          - referImages
                          - quota
                          - finishTime
                          - hookUrl
                required:
                  - status
                  - message
                  - jobId
                  - data
              examples:
                SUCCESS:
                  summary: Success status
                  value:
                    status: SUCCESS
                    message: success
                    jobId: 5ecc5080-b1d7-4b9f-8184-435e46ebb5cb
                    data:
                      prompt: >-
                        A professional full-body flat lay photo of a beautiful
                        female model wearing this outfit. High resolution,
                        photorealistic, perfect detail of all clothing elements,
                        professional pose, attractive figure, trendy style,
                        smiling, fair-skinned Caucasian woman.
                      referImages:
                        - >-
                          https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                      imageUrl: >-
                        https://cdnc.ttapi.io/2025-03-31/cd3f3ce5-06be-4b3a-9aed-014045ca1804.png
                      quota: '2'
                      finishTime: '2025-03-31 04:25:33'
                      hookUrl: >-
                        https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
                ON_QUEUE:
                  summary: Processing status
                  value:
                    status: ON_QUEUE
                    message: null
                    jobId: 0ccf0606-3f32-4090-85bd-1786e4593be5
                    data:
                      prompt: >-
                        A professional full-body flat lay photo of a beautiful
                        female model wearing this outfit. High resolution,
                        photorealistic, perfect detail of all clothing elements,
                        professional pose, attractive figure, trendy style,
                        smiling, fair-skinned Caucasian woman.
                      referImages:
                        - >-
                          https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                      imageUrl: null
                      quota: '2'
                      finishTime: null
                      hookUrl: >-
                        https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
                FAILED:
                  summary: Failure status
                  value:
                    status: FAILED
                    message: job failed
                    jobId: b45fcf32-71a5-4df2-82c7-2e6300e32e29
                    data:
                      prompt: >-
                        A professional full-body photo of a beautiful Chinese
                        female model in a studio lighting setup trying on
                        clothes. High resolution, photorealistic, professional
                        pose, well-proportioned figure, smiling, fair skin.
                      referImages:
                        - >-
                          https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                      imageUrl: null
                      quota: '0'
                      finishTime: '2025-03-31 04:10:21'
                      hookUrl: >-
                        https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  responses:
    400Response:
      description: Parameter error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Authorization failed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>.

````