# 执行 文字生成视频 任务。

AI 任务是异步处理的。功能支持 Webhook 时，优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名，收到 `success` 或 `error` 通知后，用收到的 `task_id` 查询任务结果。配置与校验的细节请见 [Webhook 接入指南](/develop/webhook)。
若功能不支持 Webhook，或您的接入方式用不了 Webhook，就请实现轮询。提交 AI 任务后，按固定间隔（例如每 10 秒）轮询状态接口，直到任务状态变为 `success` 或 `error`。

Endpoint: POST /s2s/v2.0/task/text-to-video/youcam
Security: BearerAuthenticationV2

## Security:

  - `BearerAuthenticationV2` (unknown)
    http bearer

## Request fields (application/json):

  - `model` (string)
    模型名称。
    Enum: "youcam-video-v2"

  - `prompt` (string, required)
    文字提示词，描述视频内容与视觉风格。
支持中英文，每个汉字或字母计 1 字符。
    Example: A kitten running in the moonlight.

  - `negative_prompt` (string)
    反向提示词，描述视频中要排除的内容，用于约束输出。
支持中英文。
    Example: low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions.

  - `resolution` (string)
    生成视频的分辨率档位，决定清晰度（总像素数）。
    Enum: "720P", "1080P"

  - `ratio` (string)
    生成视频的宽高比。
各宽高比对应的输出视频分辨率（width*height）见下表：
| 分辨率档位 | 宽高比 | 输出视频分辨率（width*height） |
|  --- | --- | --- |
| **720P** | 16:9 | 1280*720 |
| **720P** | 9:16 | 720*1280 |
| **720P** | 1:1 | 960*960 |
| **720P** | 4:3 | 1104*832 |
| **720P** | 3:4 | 832*1104 |
| **1080P** | 16:9 | 1920*1080 |
| **1080P** | 9:16 | 1080*1920 |
| **1080P** | 1:1 | 1440*1440 |
| **1080P** | 4:3 | 1648*1248 |
| **1080P** | 3:4 | 1248*1648 |
    Enum: "16:9", "9:16", "1:1", "4:3", "3:4"

  - `dst_duration` (integer, required)
    生成视频的时长（秒）。
    Example: 5

  - `prompt_extend` (boolean)
    开启提示词改写。开启后由大语言模型智能改写您输入的提示词，对短提示词效果更好，但耗时更长。
    Enum: "true", "false"

## Response 200:

  - `200` (unknown)
    任务执行成功

## Response 200 fields (application/json):

  - `status` (integer)
    响应状态
    Example: 200

  - `data` (object)

  - `data.task_id` (string)
    该任务的 ID。凭这个 ID 可在 24 小时内查询任务结果。
    Example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe

## Response 400:

  - `400` (unknown)
    任务执行失败

## Response 400 fields (application/json):

  - `status` (integer)
    响应状态
    Example: 400

  - `error` (string)
    错误信息
    Example: The operation could not be completed

  - `error_code` (string)
    错误码：
* InvalidParameters - 请求参数无效
* CreditInsufficiency - 点数不足，无法运行
* BadRequest - 请求参数不符合预期
* InvalidStyleGroup - 风格分组 ID 无效
* InvalidStyle - 风格 ID 无效
    Enum: "InvalidParameters", "CreditInsufficiency", "InvalidStyleGroup", "InvalidStyle", "BadRequest"

## Response 401:

  - `401` (unknown)
    API 密钥无效或缺失

## Response 401 fields (application/json):

  - `status` (integer)
    响应状态
    Example: 401

  - `error` (string)
    Example: Invalid API key

## Response 429:

  - `429` (unknown)
    请求过多

## Response 429 fields (application/json):

  - `status` (integer)
    响应状态
    Example: 429

  - `error` (string)
    Example: Too many requests

