> ## Documentation Index
> Fetch the complete documentation index at: https://api.xcompute.us/llms.txt
> Use this file to discover all available pages before exploring further.

# 可灵文生视频

> 根据文本提示词创建可灵视频任务。

根据文本描述异步生成视频。提交成功后，使用返回的任务 ID 查询结果。

## 请求参数

<ParamField body="model_name" type="string" default="kling-v3">
  可灵模型 ID，也可以使用字段 `model`。
</ParamField>

<ParamField body="prompt" type="string" required>
  视频内容提示词。
</ParamField>

<ParamField body="negative_prompt" type="string">
  不希望出现在视频中的内容。
</ParamField>

<ParamField body="mode" type="string" default="std">
  生成模式，例如 `std` 或 `pro`。
</ParamField>

<ParamField body="duration" type="string" default="5">
  视频时长，单位为秒。
</ParamField>

<ParamField body="aspect_ratio" type="string" default="1:1">
  画面比例，例如 `16:9`、`9:16` 或 `1:1`。
</ParamField>

<ParamField body="camera_control" type="object">
  运镜配置，可包含 `type` 以及 `config.horizontal`、`vertical`、`pan`、`tilt`、`roll`、`zoom`。
</ParamField>

<ParamField body="callback_url" type="string">
  任务状态回调地址。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST 'https://xcompute.us/kling/v1/videos/text2video' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "model_name": "kling-v3",
      "prompt": "清晨的海岸线上，一架纸飞机迎风飞行",
      "mode": "std",
      "duration": "5",
      "aspect_ratio": "16:9"
    }'
  ```
</RequestExample>

## 查询任务

`GET /kling/v1/videos/text2video/{task_id}`，也可以使用[统一任务查询接口](/api-reference/tasks/new-status)。
