# HappyHorse 1.0 Text-to-Video

> Video Generation

Submit an asynchronous text-to-video generation task.

## Endpoint

`POST https://api.modelverse.cn/v1/tasks/submit`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-DashScope-Async | header | string | Yes | Enables asynchronous task submission as shown in the source request example. |

## Request Body

## Responses

- **200** — Task submitted successfully.
- **400** — Invalid request parameters.
- **default** — Error response.

## OpenAPI Definition

```json
{
  "openapi": "3.1.0",
  "x-language": "en-US",
  "info": {
    "title": "ModelVerse HappyHorse-1.0-T2V Video Task API",
    "version": "1.0.0",
    "description": "Self-contained OpenAPI 3.1 schema for the ModelVerse HappyHorse-1.0-T2V\ntext-to-video asynchronous task API.\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint documented for this model."
    }
  ],
  "tags": [
    {
      "name": "HappyHorse-1.0-T2V",
      "description": "Text-to-video asynchronous task operations for HappyHorse-1.0-T2V."
    }
  ],
  "paths": {
    "/v1/tasks/submit": {
      "post": {
        "tags": [
          "HappyHorse-1.0-T2V"
        ],
        "operationId": "submitHappyHorse10T2VTask",
        "summary": "HappyHorse 1.0 Text-to-Video",
        "description": "Submit an asynchronous text-to-video generation task.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "X-DashScope-Async",
            "in": "header",
            "required": true,
            "description": "Enables asynchronous task submission as shown in the source request example.",
            "schema": {
              "type": "string",
              "const": "enable"
            },
            "example": "enable"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HappyHorse10T2VSubmitRequest"
              },
              "examples": {
                "documented": {
                  "summary": "Source text-to-video request",
                  "value": {
                    "model": "happyhorse-1.0-t2v",
                    "input": {
                      "prompt": "一座由硬纸板和瓶盖搭建的微型城市，在夜晚焕发出生机。"
                    },
                    "parameters": {
                      "resolution": "720P",
                      "ratio": "16:9",
                      "duration": 5
                    }
                  }
                },
                "withOptionalControls": {
                  "summary": "Text-to-video request with optional controls",
                  "value": {
                    "model": "happyhorse-1.0-t2v",
                    "input": {
                      "prompt": "A tiny cardboard city comes alive at night."
                    },
                    "parameters": {
                      "resolution": "1080P",
                      "ratio": "1:1",
                      "duration": 8,
                      "watermark": false,
                      "seed": 12345
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task submitted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HappyHorse10T2VSubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "Submitted task",
                    "value": {
                      "output": {
                        "task_id": "task_id"
                      },
                      "request_id": "request_id"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HappyHorse10T2VErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/HappyHorse10T2VParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HappyHorse10T2VErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/HappyHorse10T2VParamError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "tags": [
          "HappyHorse-1.0-T2V"
        ],
        "operationId": "getHappyHorse10T2VTaskStatus",
        "summary": "HappyHorse 1.0 Text-to-Video Status",
        "description": "Query the status and result URLs for an asynchronous text-to-video task.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "Asynchronous task identifier returned by `/v1/tasks/submit`.",
            "schema": {
              "type": "string"
            },
            "example": "task_id"
          }
        ],
        "responses": {
          "200": {
            "description": "Task status response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HappyHorse10T2VStatusResponse"
                },
                "examples": {
                  "success": {
                    "summary": "Successful task",
                    "value": {
                      "output": {
                        "task_id": "task_id",
                        "task_status": "Success",
                        "urls": [
                          "https://xxxxx/xxxx.mp4"
                        ],
                        "submit_time": 1756959000,
                        "finish_time": 1756959050
                      },
                      "usage": {
                        "duration": 5,
                        "output_video_duration": 5,
                        "video_count": 1,
                        "SR": 720,
                        "ratio": "16:9"
                      },
                      "request_id": "request_id"
                    }
                  },
                  "failure": {
                    "summary": "Failed task",
                    "value": {
                      "output": {
                        "task_id": "task_id",
                        "task_status": "Failure",
                        "submit_time": 1756959000,
                        "finish_time": 1756959019,
                        "error_message": "error_message"
                      },
                      "usage": {
                        "duration": 5,
                        "output_video_duration": 0,
                        "video_count": 0,
                        "SR": 720,
                        "ratio": "16:9"
                      },
                      "request_id": "request_id"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid task identifier or request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HappyHorse10T2VErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/HappyHorse10T2VParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HappyHorse10T2VErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/HappyHorse10T2VParamError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "ModelVerse API key sent as `Authorization: Bearer <YOUR_API_KEY>`."
      }
    },
    "schemas": {
      "HappyHorse10T2VSubmitRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "happyhorse-1.0-t2v",
              "happyhorse-1.1-t2v"
            ],
            "description": "Model name. The source document lists `happyhorse-1.0-t2v` and `happyhorse-1.1-t2v`."
          },
          "input": {
            "$ref": "#/components/schemas/HappyHorse10T2VInput"
          },
          "parameters": {
            "$ref": "#/components/schemas/HappyHorse10T2VParameters"
          }
        }
      },
      "HappyHorse10T2VInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "prompt"
        ],
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "description": "Text prompt describing the desired generated video."
          }
        }
      },
      "HappyHorse10T2VParameters": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "resolution": {
            "type": "string",
            "enum": [
              "720P",
              "1080P"
            ],
            "default": "1080P",
            "description": "Generated video resolution tier."
          },
          "ratio": {
            "type": "string",
            "enum": [
              "16:9",
              "9:16",
              "1:1"
            ],
            "default": "16:9",
            "description": "Generated video aspect ratio."
          },
          "duration": {
            "type": "integer",
            "minimum": 3,
            "maximum": 15,
            "default": 5,
            "description": "Generated video duration in seconds."
          },
          "watermark": {
            "type": "boolean",
            "default": true,
            "description": "Whether to add a watermark to the generated video."
          },
          "seed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2147483647,
            "description": "Random seed."
          }
        }
      },
      "HappyHorse10T2VSubmitResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/HappyHorse10T2VSubmitOutput"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier."
          }
        }
      },
      "HappyHorse10T2VSubmitOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Unique identifier of the asynchronous task."
          }
        }
      },
      "HappyHorse10T2VStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/HappyHorse10T2VStatusOutput"
          },
          "usage": {
            "$ref": "#/components/schemas/HappyHorse10T2VUsage"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier."
          }
        }
      },
      "HappyHorse10T2VStatusOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "task_status"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Unique identifier of the asynchronous task."
          },
          "task_status": {
            "$ref": "#/components/schemas/HappyHorse10T2VTaskStatus"
          },
          "urls": {
            "type": "array",
            "description": "Video result URL list.",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "submit_time": {
            "type": "integer",
            "format": "int64",
            "description": "Task submission timestamp."
          },
          "finish_time": {
            "type": "integer",
            "format": "int64",
            "description": "Task completion timestamp."
          },
          "error_message": {
            "type": "string",
            "description": "Error message returned when the task fails."
          }
        }
      },
      "HappyHorse10T2VTaskStatus": {
        "type": "string",
        "enum": [
          "Pending",
          "Running",
          "Success",
          "Failure"
        ],
        "description": "Current asynchronous task status."
      },
      "HappyHorse10T2VUsage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "duration": {
            "type": "integer",
            "description": "Billed video duration in seconds."
          },
          "output_video_duration": {
            "type": "number",
            "description": "Output video duration in seconds."
          },
          "video_count": {
            "type": "integer",
            "description": "Number of output videos."
          },
          "SR": {
            "type": "integer",
            "description": "Output video resolution height, for example `720` or `1080`."
          },
          "ratio": {
            "type": "string",
            "description": "Output video aspect ratio."
          }
        }
      },
      "HappyHorse10T2VErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/HappyHorse10T2VErrorObject"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier, if available."
          }
        }
      },
      "HappyHorse10T2VErrorObject": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "message",
          "type"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message."
          },
          "type": {
            "type": "string",
            "description": "Error type."
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Error code."
          },
          "param": {
            "type": [
              "string",
              "null"
            ],
            "description": "Related request parameter, if any."
          }
        }
      }
    },
    "examples": {
      "HappyHorse10T2VParamError": {
        "summary": "Invalid parameter error",
        "value": {
          "error": {
            "message": "Invalid param",
            "type": "invalid_request_error",
            "code": "param_error",
            "param": "input.prompt"
          },
          "request_id": "request_id"
        }
      }
    }
  }
}
```
