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

# Vidu Text-to-Video

> Use `POST /vidu/ent/v2/text2video` to submit a pure-text video generation task.

# Vidu Text-to-Video

The official Vidu text-to-video API, submitted as `application/json`.

* The route entry is `POST /vidu/ent/v2/text2video`.
* Currently submitted as `application/json`.
* Supports pure-text video generation.
* After a successful submission, the task `task_id` and `status` are returned. Use [Query Task](./query) to poll for results.

## Supported Models

* `viduq3-pro`: Efficiently generates high-quality audio and video content, making the video more vivid, more realistic, and more three-dimensional
* `viduq2`: Latest model
* `viduq1`: Clear image quality, smooth transitions, and stable camera movement

## Method and Path

```http theme={null}
POST /vidu/ent/v2/text2video
```

## Request Example

<CodeGroup>
  ```bash theme={null}
  curl -X POST https://octopusx.ai/vidu/ent/v2/text2video \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "viduq3-pro",
      "style": "general",
      "prompt": "A cat chasing butterflies on the grass",
      "duration": 5,
      "seed": 0,
      "aspect_ratio": "16:9",
      "resolution": "720p",
      "bgm": false,
      "audio": true,
      "off_peak": false,
      "watermark": false
    }'
  ```

  ```python theme={null}
  import requests

  resp = requests.post(
      "https://octopusx.ai/vidu/ent/v2/text2video",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json={
          "model": "viduq3-pro",
          "style": "general",
          "prompt": "A cat chasing butterflies on the grass",
          "duration": 5,
          "seed": 0,
          "aspect_ratio": "16:9",
          "resolution": "720p",
          "bgm": False,
          "audio": True,
          "off_peak": False,
          "watermark": False
      },
      timeout=60,
  )
  print(resp.json())
  ```
</CodeGroup>

## Response Example

<ResponseExample>
  ```json 200 theme={null}
  {
    "task_id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
    "status": "processing",
    "created_at": 1774494511
  }
  ```
</ResponseExample>

## Authentication

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Body

<ParamField body="model" type="string" required>
  Model name. Supported `viduq3-pro` (efficiently generates high-quality audio and video content), `viduq2` (latest model), `viduq1` (clear image quality, smooth transitions, and stable camera movement).
</ParamField>

<ParamField body="style" type="string">
  Style. `general`: general style; `anime`: anime style. Note: this parameter does not take effect when using q2 or q3 models.
</ParamField>

<ParamField body="prompt" type="string" required>
  Text prompt. The text description for video generation, supporting Chinese and English.
</ParamField>

<ParamField body="duration" type="integer">
  Video duration (seconds). `viduq2`: default 5 seconds, optional 1-10 seconds; other models use the default value.
</ParamField>

<ParamField body="seed" type="integer">
  Random seed. If not provided or set to 0, a random number is used; if set manually, the specified seed is used.
</ParamField>

<ParamField body="aspect_ratio" type="string">
  Aspect ratio. Optional values: `16:9` (default), `9:16`, `3:4`, `4:3`, `1:1`. Note: `3:4` and `4:3` are only supported by q2 and q3 models.
</ParamField>

<ParamField body="resolution" type="string">
  Resolution. The default value depends on the model and video duration. `viduq2` (1-10 seconds): default 720p, optional 540p, 720p, 1080p.
</ParamField>

<ParamField body="bgm" type="boolean">
  Whether to add background music. `true`: the system will automatically select suitable music from the preset BGM library and add it; `false`: do not add BGM. Note: the BGM parameter does not take effect when the duration of the q2 model is 9 or 10 seconds; it does not take effect in the q3 model.
</ParamField>

<ParamField body="audio" type="boolean">
  Audio-video direct output (supported only by q3 models). `true`: audio-video direct output is required, outputting a video with dialogue and background sound; `false`: audio-video direct output is not required, outputting a silent video.
</ParamField>

<ParamField body="off_peak" type="boolean">
  Off-peak mode. `true`: generate videos during off-peak periods, with lower points cost; `false`: generate videos immediately.
</ParamField>

<ParamField body="watermark" type="boolean">
  Whether to add a watermark. `true`: add a watermark; `false`: do not add a watermark. Note: the watermark content is fixed as "Content generated by AI", and it is not added by default.
</ParamField>

<ParamField body="wm_position" type="integer">
  Watermark position. `1`: top-left; `2`: top-right; `3`: bottom-right; `4`: bottom-left.
</ParamField>

<ParamField body="wm_url" type="string">
  Watermark image URL. If not provided, the default watermark is used.
</ParamField>

<ParamField body="payload" type="string">
  Pass-through parameter. No processing is performed; data transmission only.
</ParamField>

<ParamField body="meta_data" type="string">
  Metadata identifier. JSON-formatted string, pass-through field.
</ParamField>

## Response

<ResponseField name="task_id" type="string">
  Task ID, used to query task status.
</ResponseField>

<ResponseField name="status" type="string">
  Task status. Optional values: `processing` (in progress), `failed` (failed), `completed` (completed).
</ResponseField>

<ResponseField name="created_at" type="integer">
  Creation timestamp (Unix timestamp).
</ResponseField>

## Related APIs

* [Vidu Video Overview](./overview)
* [Image-to-Video](./img2video)
* [Start-End Frame Video Generation](./start-end2video)
* [Reference-based Video Generation](./reference2video)
* [Query Task](./query)
