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

# 查询任务结果

> 查询任务结果 - 根据任务 ID 查询视频生成任务的状态和结果



## OpenAPI

````yaml openapi/cn/happyhorse.json GET /happyhorse/api/v1/tasks/{task_id}
openapi: 3.1.0
info:
  title: Grok Video DOCS
  version: 1.0.0
  description: Grok Video API 提供高效的视频分析和生成能力，帮助开发者快速集成智能视频功能。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /happyhorse/api/v1/tasks/{task_id}:
    get:
      description: 查询任务结果 - 根据任务 ID 查询视频生成任务的状态和结果
      parameters:
        - name: task_id
          in: path
          required: true
          description: 任务 ID。查询有效期 24 小时。
          schema:
            type: string
      responses:
        '200':
          description: 查询任务结果成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: 请求唯一标识。可用于请求明细溯源和问题排查。
                    example: c11018a8-3f83-9591-a636-xxxxxx
                  output:
                    type: object
                    description: 任务输出信息
                    properties:
                      task_id:
                        type: string
                        description: 任务 ID。查询有效期 24 小时。
                        example: 051c7b40-b2c5-4341-aee4-xxxxxx
                      task_status:
                        type: string
                        description: 任务状态
                        enum:
                          - PENDING
                          - RUNNING
                          - SUCCEEDED
                          - FAILED
                          - CANCELED
                          - UNKNOWN
                        example: SUCCEEDED
                      code:
                        type: string
                        description: 错误码。仅在 task_status 为 FAILED 时返回。
                        example: InvalidParameter
                      message:
                        type: string
                        description: 错误信息。仅在 task_status 为 FAILED 时返回。
                        example: The resolution is not valid
                      submit_time:
                        type: string
                        description: >-
                          任务提交时间。时区为 UTC+8，格式为 YYYY-MM-DD
                          HH:mm:ss.SSS。仅在任务成功时返回。
                        example: '2026-04-26 14:13:14.373'
                      scheduled_time:
                        type: string
                        description: >-
                          任务执行时间。时区为 UTC+8，格式为 YYYY-MM-DD
                          HH:mm:ss.SSS。仅在任务成功时返回。
                        example: '2026-04-26 14:13:14.419'
                      end_time:
                        type: string
                        description: >-
                          任务完成时间。时区为 UTC+8，格式为 YYYY-MM-DD
                          HH:mm:ss.SSS。仅在任务成功时返回。
                        example: '2026-04-26 14:14:13.679'
                      orig_prompt:
                        type: string
                        description: 原始输入的 prompt，对应请求参数 prompt。仅在任务成功时返回。
                        example: 让视频中的马头人身角色穿上图片中的条纹毛衣
                      video_url:
                        type: string
                        description: >-
                          视频 URL。仅在 task_status 为 SUCCEEDED 时返回。链接有效期 24 小时，可通过此
                          URL 下载视频。视频格式为 MP4（H.264 编码）。
                        example: >-
                          https://dashscope-result.oss-cn-beijing.aliyuncs.com/xxxx.mp4
                    required:
                      - task_id
                      - task_status
                    example:
                      task_id: 1469cfc3-3004-4d9e-ab10-xxxxxx
                      task_status: SUCCEEDED
                      submit_time: '2026-04-25 15:03:25.848'
                      scheduled_time: '2026-04-25 15:03:25.884'
                      end_time: '2026-04-25 15:04:05.882'
                      orig_prompt: >-
                        身着红色旗袍的女性character1，镜头先以侧面中景勾勒旗袍修身剪裁与S型曲线，随即切换至低角度仰拍，捕捉她轻抬玉手展开折扇character2时流苏耳坠character3随头部转动轻盈摆动的细节，最后推近至面部特写，定格在她指尖轻点扇骨、眼波流转间的含蓄风情，多视角全方位展现东方韵味。
                      video_url: >-
                        https://dashscope-result.oss-cn-beijing.aliyuncs.com/xxxx.mp4
                  usage:
                    type: object
                    description: 输出信息统计。只对成功的结果计数。
                    properties:
                      duration:
                        type: number
                        description: 生成视频的总视频时长，用于计费。
                        example: 5
                      input_video_duration:
                        type: number
                        description: 输入视频的时长，单位秒。
                        example: 0
                      output_video_duration:
                        type: number
                        description: 输出视频的时长，单位秒。
                        example: 5
                      video_count:
                        type: integer
                        description: 生成视频的数量。固定为 1。
                        example: 1
                      SR:
                        type: integer
                        description: 生成视频的分辨率档位。
                        example: 720
                      ratio:
                        type: string
                        description: 生成视频的宽高比。
                        example: '16:9'
                required:
                  - request_id
                  - output
                example:
                  request_id: 35137489-2862-96cb-b6f2-xxxxxx
                  output:
                    task_id: 1469cfc3-3004-4d9e-ab10-xxxxxx
                    task_status: SUCCEEDED
                    submit_time: '2026-04-25 15:03:25.848'
                    scheduled_time: '2026-04-25 15:03:25.884'
                    end_time: '2026-04-25 15:04:05.882'
                    orig_prompt: >-
                      身着红色旗袍的女性character1，镜头先以侧面中景勾勒旗袍修身剪裁与S型曲线，随即切换至低角度仰拍，捕捉她轻抬玉手展开折扇character2时流苏耳坠character3随头部转动轻盈摆动的细节，最后推近至面部特写，定格在她指尖轻点扇骨、眼波流转间的含蓄风情，多视角全方位展现东方韵味。
                    video_url: >-
                      https://dashscope-result.oss-cn-beijing.aliyuncs.com/xxxx.mp4
                  usage:
                    duration: 5
                    input_video_duration: 0
                    output_video_duration: 5
                    video_count: 1
                    SR: 720
                    ratio: '16:9'
      security:
        - CustomApiKey: []
components:
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````