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

# 文生视频

> 文字生成视频

这是 **HappyHorse 视频 API** 的文生视频接口。


## OpenAPI

````yaml openapi/cn/happyhorse.json POST /happyhorse/api/v1/services/aigc/video-generation/video-synthesis
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/services/aigc/video-generation/video-synthesis:
    post:
      description: 文字生成视频
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateRequest'
      responses:
        '200':
          $ref: '#/components/responses/HappyHorseSuccessResponse'
          description: 成功响应
      security:
        - CustomApiKey: []
components:
  schemas:
    GenerateRequest:
      type: object
      properties:
        model:
          type: string
          description: 模型名称。支持 happyhorse-1.0-t2v 和 happyhorse-1.1-t2v。
          default: happyhorse-1.0-t2v
          example: happyhorse-1.0-t2v
          enum:
            - happyhorse-1.0-t2v
            - happyhorse-1.1-t2v
        input:
          type: object
          description: 模型的输入信息
          properties:
            prompt:
              type: string
              description: >-
                文本提示词，用于描述期望生成的视频内容。支持任何语言输入，长度不超过 5000 个非中文字符或 2500
                个中文字符，超过部分将自动截断。
          required:
            - prompt
        parameters:
          type: object
          description: 视频处理参数，如设置视频分辨率、设置视频时长等。
          properties:
            resolution:
              type: string
              description: 指定生成视频的分辨率档位。
              default: 1080P
              enum:
                - 720P
                - 1080P
              example: 720P
            ratio:
              type: string
              description: 指定生成视频的宽高比。
              default: '16:9'
              enum:
                - '16:9'
                - '9:16'
                - '1:1'
                - '4:3'
                - '3:4'
              example: '16:9'
            duration:
              type: integer
              description: 指定生成视频的时长，单位为秒。取值为[3, 15]之间的整数。默认值为 5。
              default: 5
              minimum: 3
              maximum: 15
              example: 5
            watermark:
              type: boolean
              description: >-
                是否在生成的视频上添加水印标识。水印位于视频右下角，文案固定为"Happy Horse"。true:
                默认值，添加水印；false: 不添加水印。
              default: true
              example: false
            seed:
              type: integer
              description: >-
                随机数种子，取值范围为 [0, 2147483647]。未指定时，系统自动生成随机种子。若需提升生成结果的可复现性，建议固定
                seed 值。请注意，由于模型生成具有概率性，即使使用相同 seed，也不能保证每次生成结果完全一致。
              minimum: 0
              maximum: 2147483647
              example: 12345
      required:
        - model
        - input
  responses:
    HappyHorseSuccessResponse:
      description: 请求成功
      content:
        application/json:
          schema:
            type: object
            properties:
              output:
                type: object
                description: 任务输出信息
                properties:
                  task_status:
                    type: string
                    description: 任务状态
                    enum:
                      - PENDING
                      - RUNNING
                      - SUCCEEDED
                      - FAILED
                      - CANCELED
                      - UNKNOWN
                    example: PENDING
                  task_id:
                    type: string
                    description: 任务 ID。查询有效期 24 小时。
                    example: 0385dc79-5ff8-4d82-bcb6-xxxxxx
              request_id:
                type: string
                description: 请求唯一标识。可用于请求明细溯源和问题排查。
                example: 4909100c-7b5a-9f92-bfe5-xxxxxx
            example:
              output:
                task_status: PENDING
                task_id: 0385dc79-5ff8-4d82-bcb6-xxxxxx
              request_id: 4909100c-7b5a-9f92-bfe5-xxxxxx
            required:
              - output
              - request_id
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````