> ## 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.

# 查询任务结果

> 通过jobId查询当前视频生成结果



## OpenAPI

````yaml openapi/cn/sora.json get /sora/fetch
openapi: 3.1.0
info:
  title: Sora API DOCS
  version: 1.0.0
  description: TTAPI Sora API 接口服务，目前集成了市场上最为领先的视频大模型sora2。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /sora/fetch:
    get:
      description: 通过jobId查询当前视频生成结果
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FetchRequest'
      responses:
        '200':
          description: 创建视频请求成功（任务状态通过status区分：排队中/处理中/成功/失败）
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - PENDING_QUEUE
                      - ON_QUEUE
                      - SUCCESS
                      - FAILED
                    description: 任务状态：PENDING_QUEUE-排队中，ON_QUEUE-处理中，SUCCESS-成功，FAILED-失败
                    example: SUCCESS
                  message:
                    type: string
                    description: 响应信息：成功时为空字符串，失败时返回具体错误原因（如「额度不足」「提示词违规」）
                    example: ''
                  jobId:
                    type: string
                    description: 任务唯一标识ID，用于查询任务状态/接收回调通知
                    example: c679a92e-dae0-462d-b70f-dcfeaf2189fa
                  data:
                    oneOf:
                      - title: 创建视频
                        type: object
                        description: 创建视频
                        properties:
                          model:
                            type: string
                            description: 使用模型
                          prompt:
                            type: string
                            description: 生成视频的描述词
                          referImages:
                            type: array
                            description: 垫图数组
                          videoUrl:
                            type: string
                            description: 视频地址。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          quota:
                            type: string
                            description: 消耗配额
                          hookUrl:
                            type: string
                            description: 回调地址
                          finishTime:
                            type: string
                            description: 完成时间
                      - type: object
                        title: 创建角色
                        description: 创建角色
                        properties:
                          timestamps:
                            type: string
                            description: 视频出现角色时间
                          url:
                            type: string
                            description: 地址。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          userName:
                            type: array
                            description: 角色名称
                          userPictureUrl:
                            type: string
                            description: 角色头像。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          quota:
                            type: string
                            description: 消耗配额
                          hookUrl:
                            type: string
                            description: 回调地址
                          finishTime:
                            type: string
                            description: 完成时间
                      - type: object
                        title: 去水印
                        description: 去水印
                        properties:
                          url:
                            type: string
                            description: 地址。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          videoUrl:
                            type: string
                            description: 视频地址。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          quota:
                            type: string
                            description: 消耗配额
                          hookUrl:
                            type: string
                            description: 回调地址
                          finishTime:
                            type: string
                            description: 完成时间
                required:
                  - status
                  - message
                  - jobId
                example:
                  status: SUCCESS
                  message: ''
                  jobId: c679a92e-dae0-462d-b70f-dcfeaf2189fa
                  data:
                    model: sora-2
                    prompt: >-
                      风格：现代广告，现实主义，iPhone 摄影 场景：市中心的一家咖啡馆。
                      一个穿着浅色衬衫的男人打开笔记本电脑喝咖啡。 摄像机：特写，轻微变焦 灯光：来自窗户的柔和光线，桌子上的反射
                      动作：抬头 微笑 打字
                    referImages: null
                    videoUrl: >-
                      https://cdn.ttapi.io/other/2025-10-10/35f50ab8-6f98-493d-94c4-5587ca246bb3.mp4
                    quota: '3'
                    finishTime: '2025-10-10 07:24:42'
                    hookUrl: null
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    FetchRequest:
      type: object
      properties:
        jobId:
          type: string
          description: 生成的视频的jobId
      required:
        - jobId
  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 密钥。

````