> ## 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-生成结果查询 [非官转]

> 查询画图结果



## OpenAPI

````yaml openapi/cn/openai.json get /openai/gpt/fetch
openapi: 3.1.0
info:
  title: Open AI API DOCS
  version: 1.0.0
  description: TTAPI Open AI API 接口服务
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /openai/gpt/fetch:
    get:
      description: 查询画图结果
      parameters:
        - name: jobId
          in: query
          required: true
          schema:
            type: string
          description: 生成接口同步返回的jobId（支持URL参数/请求体传递）
          example: 0ccf0606-3f32-4090-85bd-1786e4593be5
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - SUCCESS
                      - ON_QUEUE
                      - FAILED
                    description: 任务状态：ON_QUEUE-处理中，SUCCESS-成功，FAILED-失败
                    example: SUCCESS
                  message:
                    type:
                      - string
                      - 'null'
                    description: 响应信息：成功时返回success，失败时返回具体错误原因，处理中返回null
                    example: success
                  jobId:
                    type: string
                    description: 任务唯一标识ID，用于查询任务状态/接收回调通知
                    example: 5ecc5080-b1d7-4b9f-8184-435e46ebb5cb
                  data:
                    description: 任务数据（不同状态返回字段值不同）
                    oneOf:
                      - title: SUCCESS
                        type: object
                        properties:
                          prompt:
                            type: string
                            description: 生成图像的提示词
                            example: >-
                              画一张美女模特该衣服平面照拍摄照片，要求高像素，高逼真度，完美还原衣服所有细节，全身照专业姿势，身材性感，穿着潮流，面带微笑，欧美女性皮肤白皙
                          referImages:
                            type: array
                            items:
                              type: string
                            description: 参考图片地址列表
                            example:
                              - >-
                                https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                          imageUrl:
                            type: string
                            description: >-
                              生成结果图片地址（成功时必返回）。有效期详见[存储与持久化](/grids/cn/faq/storage)
                            example: >-
                              https://cdnc.ttapi.io/2025-03-31/cd3f3ce5-06be-4b3a-9aed-014045ca1804.png
                          model:
                            type: string
                            description: 调用模型
                            example: gpt-image-2
                          quota:
                            type: string
                            description: 消耗配额
                            example: '2'
                          finishTime:
                            type: string
                            description: 任务完成时间（格式：YYYY-MM-DD HH:mm:ss）
                            example: '2025-03-31 04:25:33'
                          hookUrl:
                            type: string
                            description: 回调地址
                            example: >-
                              https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
                        required:
                          - prompt
                          - referImages
                          - imageUrl
                          - quota
                          - finishTime
                          - hookUrl
                      - title: ON_QUEUE
                        type: object
                        properties:
                          prompt:
                            type: string
                            description: 生成图像的提示词
                            example: >-
                              画一张美女模特该衣服平面照拍摄照片，要求高像素，高逼真度，完美还原衣服所有细节，全身照专业姿势，身材性感，穿着潮流，面带微笑，欧美女性皮肤白皙
                          referImages:
                            type: array
                            items:
                              type: string
                            description: 参考图片地址列表
                            example:
                              - >-
                                https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                          imageUrl:
                            type: string
                            description: 生成结果图片地址（处理中返回null）
                          model:
                            type: string
                            description: 调用模型
                            example: gpt-image-2
                          quota:
                            type: string
                            description: 消耗配额
                            example: '2'
                          finishTime:
                            type: string
                            description: 任务完成时间（处理中返回null）
                          hookUrl:
                            type: string
                            description: 回调地址
                            example: >-
                              https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
                        required:
                          - prompt
                          - referImages
                          - quota
                          - hookUrl
                      - title: FAILED
                        type: object
                        properties:
                          prompt:
                            type: string
                            description: 生成图像的提示词
                            example: >-
                              画一张模特采光棚真实试衣场景，要求高像素，高逼真度，全身照专业姿势，中国模特美女，身材比例协调，面带微笑，皮肤白皙
                          referImages:
                            type: array
                            items:
                              type: string
                            description: 参考图片地址列表
                            example:
                              - >-
                                https://cdn.ttapi.io/demo/2025-03-30/5d17dd5207daeeac86bcecd2d6405a0.jpg
                          imageUrl:
                            type: string
                            description: 生成结果图片地址（失败时返回null）
                          model:
                            type: string
                            description: 调用模型
                            example: gpt-image-2
                          quota:
                            type: string
                            description: 消耗配额（失败时返回0）
                            example: '0'
                          finishTime:
                            type: string
                            description: 任务完成时间（格式：YYYY-MM-DD HH:mm:ss）
                            example: '2025-03-31 04:10:21'
                          hookUrl:
                            type: string
                            description: 回调地址
                            example: >-
                              https://webhook-test.com/b129b43b6619f977b3227387fc290f7d
                        required:
                          - prompt
                          - referImages
                          - quota
                          - finishTime
                          - hookUrl
                required:
                  - status
                  - message
                  - jobId
                  - data
              examples:
                SUCCESS:
                  summary: 成功状态
                  value:
                    status: SUCCESS
                    message: success
                    jobId: 5ecc5080-b1d7-4b9f-8184-435e46ebb5cb
                    data:
                      prompt: >-
                        画一张美女模特该衣服平面照拍摄照片，要求高像素，高逼真度，完美还原衣服所有细节，全身照专业姿势，身材性感，穿着潮流，面带微笑，欧美女性皮肤白皙
                      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: 处理中状态
                  value:
                    status: ON_QUEUE
                    message: null
                    jobId: 0ccf0606-3f32-4090-85bd-1786e4593be5
                    data:
                      prompt: >-
                        画一张美女模特该衣服平面照拍摄照片，要求高像素，高逼真度，完美还原衣服所有细节，全身照专业姿势，身材性感，穿着潮流，面带微笑，欧美女性皮肤白皙
                      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: 失败状态
                  value:
                    status: FAILED
                    message: job failed
                    jobId: b45fcf32-71a5-4df2-82c7-2e6300e32e29
                    data:
                      prompt: >-
                        画一张模特采光棚真实试衣场景，要求高像素，高逼真度，全身照专业姿势，中国模特美女，身材比例协调，面带微笑，皮肤白皙
                      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: 参数错误
      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: 授权失败
      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: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````