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

# 创建视频生成任务

> 创建异步视频生成任务。生成方式根据必填提示词、帧图片和带类型的参考素材推断。

## 授权

<ParamField header="Authorization" type="string" required default={'Bearer ${YOUR_API_KEY}'}>
  使用 Bearer 方式发送的 Neural4D API 密钥。
</ParamField>

## 请求体 <span className="api-content-type">application/json</span>

<Tabs sync={false}>
  <Tab title="Option 1">
    <ParamField body="model" type="enum<string>" required>
      Seedance 2.0 模型。

      可选值：`bytedance/seedance-2.0`。
    </ParamField>

    <ParamField body="prompt" type="string" required>
      描述待生成视频的必填文本提示词。

      字符串长度：`1 - 1000`。
    </ParamField>

    <ParamField body="output_with_audio" type="boolean" default={true}>
      是否为视频生成原生音频。
    </ParamField>

    <ParamField body="resolution" type="enum<string>" default="720p">
      可选值：`480p`、`720p`、`1080p`、`4K`。
    </ParamField>

    <ParamField body="aspect_ratio" type="enum<string>" default="16:9">
      可选值：`1:1`、`16:9`、`9:16`、`4:3`、`3:4`。
    </ParamField>

    <ParamField body="duration" type="enum<integer>" default={5}>
      视频时长，单位为秒。

      可选值：`4`、`5`、`6`、`7`、`8`、`9`、`10`、`11`、`12`、`13`、`14`、`15`。
    </ParamField>
  </Tab>

  <Tab title="Option 2">
    <ParamField body="model" type="enum<string>" required>
      Seedance 2.0 Fast 模型。

      可选值：`bytedance/seedance-2.0-fast`。
    </ParamField>

    <ParamField body="prompt" type="string" required>
      描述待生成视频的必填文本提示词。

      字符串长度：`1 - 1000`。
    </ParamField>

    <ParamField body="output_with_audio" type="boolean" default={true}>
      是否为视频生成原生音频。
    </ParamField>

    <ParamField body="resolution" type="enum<string>" default="720p">
      可选值：`480p`、`720p`。
    </ParamField>

    <ParamField body="aspect_ratio" type="enum<string>" default="16:9">
      可选值：`1:1`、`16:9`、`9:16`、`4:3`、`3:4`。
    </ParamField>

    <ParamField body="duration" type="enum<integer>" default={5}>
      视频时长，单位为秒。

      可选值：`4`、`5`、`6`、`7`、`8`、`9`、`10`、`11`、`12`、`13`、`14`、`15`。
    </ParamField>
  </Tab>

  <Tab title="Option 3">
    <ParamField body="model" type="enum<string>" required>
      Veo 3.1 模型。

      可选值：`google/veo-3.1`。
    </ParamField>

    <ParamField body="prompt" type="string" required>
      描述待生成视频的必填文本提示词。

      字符串长度：`1 - 1000`。
    </ParamField>

    <ParamField body="output_with_audio" type="boolean" default={true}>
      是否为视频生成原生音频。
    </ParamField>

    <ParamField body="resolution" type="enum<string>" default="720p">
      可选值：`720p`、`1080p`、`4K`。
    </ParamField>

    <ParamField body="aspect_ratio" type="enum<string>" default="16:9">
      可选值：`16:9`、`9:16`。
    </ParamField>

    <ParamField body="duration" type="enum<integer>" default={8}>
      视频时长，单位为秒。

      可选值：`4`、`5`、`6`、`7`、`8`。
    </ParamField>
  </Tab>

  <Tab title="Option 4">
    <ParamField body="model" type="enum<string>" required>
      Grok Imagine 模型。

      可选值：`xai/grok-imagine`。
    </ParamField>

    <ParamField body="prompt" type="string" required>
      描述待生成视频的必填文本提示词。

      字符串长度：`1 - 1000`。
    </ParamField>

    <ParamField body="resolution" type="enum<string>" default="720p">
      可选值：`480p`、`720p`。
    </ParamField>

    <ParamField body="aspect_ratio" type="enum<string>" default="16:9">
      可选值：`1:1`、`16:9`、`9:16`、`2:3`、`3:2`。
    </ParamField>

    <ParamField body="duration" type="enum<integer>" default={6}>
      视频时长，单位为秒。

      可选值：`6`、`7`、`8`、`9`、`10`、`11`、`12`、`13`、`14`、`15`、`16`、`17`、`18`、`19`、`20`、`21`、`22`、`23`、`24`、`25`、`26`、`27`、`28`、`29`、`30`。
    </ParamField>
  </Tab>
</Tabs>

<ParamField body="n" type="integer" default={1}>
  创建的视频生成任务数量。

  取值范围：`1 <= x <= 4`。
</ParamField>

<ParamField body="frame_images" type="object[]">
  通过 `POST /openapi/v1/files` 上传的首帧和尾帧图片。支持 JPG、JPEG、PNG 和 WEBP。每个 `frame_type` 最多出现一次。

  数组长度：`1 - 2` 个元素。

  <Expandable title="子属性" defaultOpen>
    <ParamField body="type" pre={["frame_images."]} type="enum<string>" required>
      帧素材的媒体类型。

      可选值：`image`。
    </ParamField>

    <ParamField body="frame_type" pre={["frame_images."]} type="enum<string>" required>
      图片表示的帧位置。

      可选值：`first_frame`、`last_frame`。
    </ParamField>

    <ParamField body="file_id" pre={["frame_images."]} type="string<uuid>" required>
      文件上传接口返回的文件 ID。支持 JPG、JPEG、PNG 和 WEBP 格式。

      示例：`"550e8400-e29b-41d4-a716-446655440000"`。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="input_references" type="object[]">
  已上传的图片、视频和音频参考素材。接口最多接受六张图片、四个视频和两个音频。音频必须与至少一个图片或视频同时使用。

  <Tabs sync={false}>
    <Tab title="Option 1">
      <Expandable title="子属性" defaultOpen>
        <ParamField body="type" pre={["input_references."]} type="enum<string>" required>
          图片参考素材。

          可选值：`image`。
        </ParamField>

        <ParamField body="file_id" pre={["input_references."]} type="string<uuid>" required>
          JPG、JPEG、PNG 或 WEBP 图片的文件 ID。
        </ParamField>
      </Expandable>
    </Tab>

    <Tab title="Option 2">
      <Expandable title="子属性" defaultOpen>
        <ParamField body="type" pre={["input_references."]} type="enum<string>" required>
          视频参考素材。

          可选值：`video`。
        </ParamField>

        <ParamField body="file_id" pre={["input_references."]} type="string<uuid>" required>
          MP4 或 MOV 视频的文件 ID。
        </ParamField>
      </Expandable>
    </Tab>

    <Tab title="Option 3">
      <Expandable title="子属性" defaultOpen>
        <ParamField body="type" pre={["input_references."]} type="enum<string>" required>
          音频参考素材。

          可选值：`audio`。
        </ParamField>

        <ParamField body="file_id" pre={["input_references."]} type="string<uuid>" required>
          MP3 或 WAV 音频的文件 ID。每个文件时长必须为 2 到 15 秒，且不超过 15 MB。
        </ParamField>
      </Expandable>
    </Tab>
  </Tabs>
</ParamField>

<RequestExample>
  ```bash cURL · text_to_video theme={null}
  curl --request POST \
    --url https://api.neural4d.com/openapi/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '
  {
    "model": "xai/grok-imagine",
    "prompt": "A cinematic tracking shot through a neon-lit street at night",
    "duration": 6,
    "n": 1,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }
  '
  ```

  ```python Python · text_to_video theme={null}
  import requests

  response = requests.request(
      "POST",
      "https://api.neural4d.com/openapi/v1/videos/generations",
      headers={
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json",
      },
      json={
        "model": "xai/grok-imagine",
        "prompt": "A cinematic tracking shot through a neon-lit street at night",
        "duration": 6,
        "n": 1,
        "resolution": "720p",
        "aspect_ratio": "16:9"
      },
  )
  print(response.json())
  ```

  ```javascript JavaScript · text_to_video theme={null}
  const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "model": "xai/grok-imagine",
      "prompt": "A cinematic tracking shot through a neon-lit street at night",
      "duration": 6,
      "n": 1,
      "resolution": "720p",
      "aspect_ratio": "16:9"
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```typescript TypeScript · text_to_video theme={null}
  const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "model": "xai/grok-imagine",
      "prompt": "A cinematic tracking shot through a neon-lit street at night",
      "duration": 6,
      "n": 1,
      "resolution": "720p",
      "aspect_ratio": "16:9"
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```java Java · text_to_video theme={null}
  import java.net.URI;
  import java.net.http.*;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
      .header("Authorization", "Bearer <token>")
      .header("Content-Type", "application/json")
      .method("POST", HttpRequest.BodyPublishers.ofString("{\n      \"model\": \"xai/grok-imagine\",\n      \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n      \"duration\": 6,\n      \"n\": 1,\n      \"resolution\": \"720p\",\n      \"aspect_ratio\": \"16:9\"\n    }"))
      .build();
  HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```go Go · text_to_video theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
    "strings"
  )

  payload := strings.NewReader("{\n  \"model\": \"xai/grok-imagine\",\n  \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n  \"duration\": 6,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\"\n}")
  req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
  req.Header.Set("Authorization", "Bearer <token>")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  bodyBytes, _ := io.ReadAll(resp.Body)
  fmt.Println(string(bodyBytes))
  ```

  ```ruby Ruby · text_to_video theme={null}
  require "net/http"
  require "json"

  uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
  request = Net::HTTP::Post.new(uri)
  request["Authorization"] = "Bearer <token>"
  request["Content-Type"] = "application/json"
  request.body = {
    "model": "xai/grok-imagine",
    "prompt": "A cinematic tracking shot through a neon-lit street at night",
    "duration": 6,
    "n": 1,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }.to_json

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
  puts response.body
  ```

  ```php PHP · text_to_video theme={null}
  <?php

  $ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
  curl_setopt_array($ch, [
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
      CURLOPT_POSTFIELDS => "{\n  \"model\": \"xai/grok-imagine\",\n  \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n  \"duration\": 6,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\"\n}",
  ]);
  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```

  ```csharp C# · text_to_video theme={null}
  using System.Net.Http;
  using System.Text;

  using var client = new HttpClient();
  using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
  request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
  request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
  request.Content = new StringContent("{\n  \"model\": \"xai/grok-imagine\",\n  \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n  \"duration\": 6,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\"\n}", Encoding.UTF8, "application/json");
  using var response = await client.SendAsync(request);
  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```

  ```bash cURL · first_frame_image_to_video theme={null}
  curl --request POST \
    --url https://api.neural4d.com/openapi/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '
  {
    "model": "bytedance/seedance-2.0",
    "prompt": "The camera slowly pushes in while soft wind moves the leaves",
    "frame_images": [
      {
        "type": "image",
        "frame_type": "first_frame",
        "file_id": "550e8400-e29b-41d4-a716-446655440000"
      }
    ],
    "duration": 5,
    "n": 1,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "output_with_audio": true
  }
  '
  ```

  ```python Python · first_frame_image_to_video theme={null}
  import requests

  response = requests.request(
      "POST",
      "https://api.neural4d.com/openapi/v1/videos/generations",
      headers={
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json",
      },
      json={
        "model": "bytedance/seedance-2.0",
        "prompt": "The camera slowly pushes in while soft wind moves the leaves",
        "frame_images": [
          {
            "type": "image",
            "frame_type": "first_frame",
            "file_id": "550e8400-e29b-41d4-a716-446655440000"
          }
        ],
        "duration": 5,
        "n": 1,
        "resolution": "720p",
        "aspect_ratio": "16:9",
        "output_with_audio": true
      },
  )
  print(response.json())
  ```

  ```javascript JavaScript · first_frame_image_to_video theme={null}
  const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "model": "bytedance/seedance-2.0",
      "prompt": "The camera slowly pushes in while soft wind moves the leaves",
      "frame_images": [
        {
          "type": "image",
          "frame_type": "first_frame",
          "file_id": "550e8400-e29b-41d4-a716-446655440000"
        }
      ],
      "duration": 5,
      "n": 1,
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "output_with_audio": true
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```typescript TypeScript · first_frame_image_to_video theme={null}
  const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "model": "bytedance/seedance-2.0",
      "prompt": "The camera slowly pushes in while soft wind moves the leaves",
      "frame_images": [
        {
          "type": "image",
          "frame_type": "first_frame",
          "file_id": "550e8400-e29b-41d4-a716-446655440000"
        }
      ],
      "duration": 5,
      "n": 1,
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "output_with_audio": true
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```java Java · first_frame_image_to_video theme={null}
  import java.net.URI;
  import java.net.http.*;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
      .header("Authorization", "Bearer <token>")
      .header("Content-Type", "application/json")
      .method("POST", HttpRequest.BodyPublishers.ofString("{\n      \"model\": \"bytedance/seedance-2.0\",\n      \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n      \"frame_images\": [\n        {\n          \"type\": \"image\",\n          \"frame_type\": \"first_frame\",\n          \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n        }\n      ],\n      \"duration\": 5,\n      \"n\": 1,\n      \"resolution\": \"720p\",\n      \"aspect_ratio\": \"16:9\",\n      \"output_with_audio\": true\n    }"))
      .build();
  HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```go Go · first_frame_image_to_video theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
    "strings"
  )

  payload := strings.NewReader("{\n  \"model\": \"bytedance/seedance-2.0\",\n  \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n  \"frame_images\": [\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"first_frame\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    }\n  ],\n  \"duration\": 5,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}")
  req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
  req.Header.Set("Authorization", "Bearer <token>")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  bodyBytes, _ := io.ReadAll(resp.Body)
  fmt.Println(string(bodyBytes))
  ```

  ```ruby Ruby · first_frame_image_to_video theme={null}
  require "net/http"
  require "json"

  uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
  request = Net::HTTP::Post.new(uri)
  request["Authorization"] = "Bearer <token>"
  request["Content-Type"] = "application/json"
  request.body = {
    "model": "bytedance/seedance-2.0",
    "prompt": "The camera slowly pushes in while soft wind moves the leaves",
    "frame_images": [
      {
        "type": "image",
        "frame_type": "first_frame",
        "file_id": "550e8400-e29b-41d4-a716-446655440000"
      }
    ],
    "duration": 5,
    "n": 1,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "output_with_audio": true
  }.to_json

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
  puts response.body
  ```

  ```php PHP · first_frame_image_to_video theme={null}
  <?php

  $ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
  curl_setopt_array($ch, [
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
      CURLOPT_POSTFIELDS => "{\n  \"model\": \"bytedance/seedance-2.0\",\n  \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n  \"frame_images\": [\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"first_frame\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    }\n  ],\n  \"duration\": 5,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}",
  ]);
  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```

  ```csharp C# · first_frame_image_to_video theme={null}
  using System.Net.Http;
  using System.Text;

  using var client = new HttpClient();
  using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
  request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
  request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
  request.Content = new StringContent("{\n  \"model\": \"bytedance/seedance-2.0\",\n  \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n  \"frame_images\": [\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"first_frame\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    }\n  ],\n  \"duration\": 5,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
  using var response = await client.SendAsync(request);
  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```

  ```bash cURL · first_last_frame_image_to_video theme={null}
  curl --request POST \
    --url https://api.neural4d.com/openapi/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '
  {
    "model": "bytedance/seedance-2.0-fast",
    "prompt": "Move naturally from the opening frame to the closing frame",
    "frame_images": [
      {
        "type": "image",
        "frame_type": "first_frame",
        "file_id": "550e8400-e29b-41d4-a716-446655440000"
      },
      {
        "type": "image",
        "frame_type": "last_frame",
        "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
      }
    ],
    "duration": 5,
    "n": 1,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "output_with_audio": true
  }
  '
  ```

  ```python Python · first_last_frame_image_to_video theme={null}
  import requests

  response = requests.request(
      "POST",
      "https://api.neural4d.com/openapi/v1/videos/generations",
      headers={
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json",
      },
      json={
        "model": "bytedance/seedance-2.0-fast",
        "prompt": "Move naturally from the opening frame to the closing frame",
        "frame_images": [
          {
            "type": "image",
            "frame_type": "first_frame",
            "file_id": "550e8400-e29b-41d4-a716-446655440000"
          },
          {
            "type": "image",
            "frame_type": "last_frame",
            "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
          }
        ],
        "duration": 5,
        "n": 1,
        "resolution": "720p",
        "aspect_ratio": "16:9",
        "output_with_audio": true
      },
  )
  print(response.json())
  ```

  ```javascript JavaScript · first_last_frame_image_to_video theme={null}
  const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "model": "bytedance/seedance-2.0-fast",
      "prompt": "Move naturally from the opening frame to the closing frame",
      "frame_images": [
        {
          "type": "image",
          "frame_type": "first_frame",
          "file_id": "550e8400-e29b-41d4-a716-446655440000"
        },
        {
          "type": "image",
          "frame_type": "last_frame",
          "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
        }
      ],
      "duration": 5,
      "n": 1,
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "output_with_audio": true
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```typescript TypeScript · first_last_frame_image_to_video theme={null}
  const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "model": "bytedance/seedance-2.0-fast",
      "prompt": "Move naturally from the opening frame to the closing frame",
      "frame_images": [
        {
          "type": "image",
          "frame_type": "first_frame",
          "file_id": "550e8400-e29b-41d4-a716-446655440000"
        },
        {
          "type": "image",
          "frame_type": "last_frame",
          "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
        }
      ],
      "duration": 5,
      "n": 1,
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "output_with_audio": true
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```java Java · first_last_frame_image_to_video theme={null}
  import java.net.URI;
  import java.net.http.*;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
      .header("Authorization", "Bearer <token>")
      .header("Content-Type", "application/json")
      .method("POST", HttpRequest.BodyPublishers.ofString("{\n      \"model\": \"bytedance/seedance-2.0-fast\",\n      \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n      \"frame_images\": [\n        {\n          \"type\": \"image\",\n          \"frame_type\": \"first_frame\",\n          \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n        },\n        {\n          \"type\": \"image\",\n          \"frame_type\": \"last_frame\",\n          \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n        }\n      ],\n      \"duration\": 5,\n      \"n\": 1,\n      \"resolution\": \"720p\",\n      \"aspect_ratio\": \"16:9\",\n      \"output_with_audio\": true\n    }"))
      .build();
  HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```go Go · first_last_frame_image_to_video theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
    "strings"
  )

  payload := strings.NewReader("{\n  \"model\": \"bytedance/seedance-2.0-fast\",\n  \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n  \"frame_images\": [\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"first_frame\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    },\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"last_frame\",\n      \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n    }\n  ],\n  \"duration\": 5,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}")
  req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
  req.Header.Set("Authorization", "Bearer <token>")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  bodyBytes, _ := io.ReadAll(resp.Body)
  fmt.Println(string(bodyBytes))
  ```

  ```ruby Ruby · first_last_frame_image_to_video theme={null}
  require "net/http"
  require "json"

  uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
  request = Net::HTTP::Post.new(uri)
  request["Authorization"] = "Bearer <token>"
  request["Content-Type"] = "application/json"
  request.body = {
    "model": "bytedance/seedance-2.0-fast",
    "prompt": "Move naturally from the opening frame to the closing frame",
    "frame_images": [
      {
        "type": "image",
        "frame_type": "first_frame",
        "file_id": "550e8400-e29b-41d4-a716-446655440000"
      },
      {
        "type": "image",
        "frame_type": "last_frame",
        "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
      }
    ],
    "duration": 5,
    "n": 1,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "output_with_audio": true
  }.to_json

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
  puts response.body
  ```

  ```php PHP · first_last_frame_image_to_video theme={null}
  <?php

  $ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
  curl_setopt_array($ch, [
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
      CURLOPT_POSTFIELDS => "{\n  \"model\": \"bytedance/seedance-2.0-fast\",\n  \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n  \"frame_images\": [\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"first_frame\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    },\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"last_frame\",\n      \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n    }\n  ],\n  \"duration\": 5,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}",
  ]);
  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```

  ```csharp C# · first_last_frame_image_to_video theme={null}
  using System.Net.Http;
  using System.Text;

  using var client = new HttpClient();
  using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
  request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
  request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
  request.Content = new StringContent("{\n  \"model\": \"bytedance/seedance-2.0-fast\",\n  \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n  \"frame_images\": [\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"first_frame\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    },\n    {\n      \"type\": \"image\",\n      \"frame_type\": \"last_frame\",\n      \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n    }\n  ],\n  \"duration\": 5,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
  using var response = await client.SendAsync(request);
  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```

  ```bash cURL · reference_to_video theme={null}
  curl --request POST \
    --url https://api.neural4d.com/openapi/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '
  {
    "model": "google/veo-3.1",
    "prompt": "Create a cohesive cinematic sequence using the supplied references",
    "input_references": [
      {
        "type": "image",
        "file_id": "550e8400-e29b-41d4-a716-446655440000"
      },
      {
        "type": "video",
        "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
      },
      {
        "type": "audio",
        "file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
      }
    ],
    "duration": 8,
    "n": 1,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "output_with_audio": true
  }
  '
  ```

  ```python Python · reference_to_video theme={null}
  import requests

  response = requests.request(
      "POST",
      "https://api.neural4d.com/openapi/v1/videos/generations",
      headers={
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json",
      },
      json={
        "model": "google/veo-3.1",
        "prompt": "Create a cohesive cinematic sequence using the supplied references",
        "input_references": [
          {
            "type": "image",
            "file_id": "550e8400-e29b-41d4-a716-446655440000"
          },
          {
            "type": "video",
            "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
          },
          {
            "type": "audio",
            "file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
          }
        ],
        "duration": 8,
        "n": 1,
        "resolution": "720p",
        "aspect_ratio": "16:9",
        "output_with_audio": true
      },
  )
  print(response.json())
  ```

  ```javascript JavaScript · reference_to_video theme={null}
  const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "model": "google/veo-3.1",
      "prompt": "Create a cohesive cinematic sequence using the supplied references",
      "input_references": [
        {
          "type": "image",
          "file_id": "550e8400-e29b-41d4-a716-446655440000"
        },
        {
          "type": "video",
          "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
        },
        {
          "type": "audio",
          "file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
        }
      ],
      "duration": 8,
      "n": 1,
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "output_with_audio": true
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```typescript TypeScript · reference_to_video theme={null}
  const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "model": "google/veo-3.1",
      "prompt": "Create a cohesive cinematic sequence using the supplied references",
      "input_references": [
        {
          "type": "image",
          "file_id": "550e8400-e29b-41d4-a716-446655440000"
        },
        {
          "type": "video",
          "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
        },
        {
          "type": "audio",
          "file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
        }
      ],
      "duration": 8,
      "n": 1,
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "output_with_audio": true
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```java Java · reference_to_video theme={null}
  import java.net.URI;
  import java.net.http.*;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
      .header("Authorization", "Bearer <token>")
      .header("Content-Type", "application/json")
      .method("POST", HttpRequest.BodyPublishers.ofString("{\n      \"model\": \"google/veo-3.1\",\n      \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n      \"input_references\": [\n        {\n          \"type\": \"image\",\n          \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n        },\n        {\n          \"type\": \"video\",\n          \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n        },\n        {\n          \"type\": \"audio\",\n          \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n        }\n      ],\n      \"duration\": 8,\n      \"n\": 1,\n      \"resolution\": \"720p\",\n      \"aspect_ratio\": \"16:9\",\n      \"output_with_audio\": true\n    }"))
      .build();
  HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```go Go · reference_to_video theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
    "strings"
  )

  payload := strings.NewReader("{\n  \"model\": \"google/veo-3.1\",\n  \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n  \"input_references\": [\n    {\n      \"type\": \"image\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    },\n    {\n      \"type\": \"video\",\n      \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n    },\n    {\n      \"type\": \"audio\",\n      \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n    }\n  ],\n  \"duration\": 8,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}")
  req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
  req.Header.Set("Authorization", "Bearer <token>")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  bodyBytes, _ := io.ReadAll(resp.Body)
  fmt.Println(string(bodyBytes))
  ```

  ```ruby Ruby · reference_to_video theme={null}
  require "net/http"
  require "json"

  uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
  request = Net::HTTP::Post.new(uri)
  request["Authorization"] = "Bearer <token>"
  request["Content-Type"] = "application/json"
  request.body = {
    "model": "google/veo-3.1",
    "prompt": "Create a cohesive cinematic sequence using the supplied references",
    "input_references": [
      {
        "type": "image",
        "file_id": "550e8400-e29b-41d4-a716-446655440000"
      },
      {
        "type": "video",
        "file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
      },
      {
        "type": "audio",
        "file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
      }
    ],
    "duration": 8,
    "n": 1,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "output_with_audio": true
  }.to_json

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
  puts response.body
  ```

  ```php PHP · reference_to_video theme={null}
  <?php

  $ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
  curl_setopt_array($ch, [
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
      CURLOPT_POSTFIELDS => "{\n  \"model\": \"google/veo-3.1\",\n  \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n  \"input_references\": [\n    {\n      \"type\": \"image\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    },\n    {\n      \"type\": \"video\",\n      \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n    },\n    {\n      \"type\": \"audio\",\n      \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n    }\n  ],\n  \"duration\": 8,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}",
  ]);
  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```

  ```csharp C# · reference_to_video theme={null}
  using System.Net.Http;
  using System.Text;

  using var client = new HttpClient();
  using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
  request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
  request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
  request.Content = new StringContent("{\n  \"model\": \"google/veo-3.1\",\n  \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n  \"input_references\": [\n    {\n      \"type\": \"image\",\n      \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n    },\n    {\n      \"type\": \"video\",\n      \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n    },\n    {\n      \"type\": \"audio\",\n      \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n    }\n  ],\n  \"duration\": 8,\n  \"n\": 1,\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
  using var response = await client.SendAsync(request);
  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```
</RequestExample>

## 响应

<Tabs sync={false}>
  <Tab title="202">
    已接受生成任务

    <ResponseField name="id" type="string" required>
      生成请求返回的批次任务 ID。

      示例：`"normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d"`。
    </ResponseField>

    <ResponseField name="data" type="object[]" required>
      本次请求创建的生成结果子项。

      数组长度：至少 `1` 个元素。

      <Expandable title="child attributes">
        <ResponseField name="uuid" pre={["data[]."]} type="string<uuid>" required>
          生成结果子项 UUID。
        </ResponseField>

        <ResponseField name="status" pre={["data[]."]} type="enum<string>" required>
          标准化后的任务生命周期状态。

          可选值：`queued`、`processing`、`succeeded`、`failed`。
        </ResponseField>

        <ResponseField name="created_at" pre={["data[]."]} type="integer<int64>" required>
          Unix 时间戳（秒）。
        </ResponseField>

        <ResponseField name="updated_at" pre={["data[]."]} type="integer<int64>">
          Unix 时间戳（秒）。
        </ResponseField>

        <ResponseField name="usage" pre={["data[]."]} type="object">
          可用时返回此任务扣除的点数。

          <Expandable title="child attributes">
            <ResponseField name="credits" pre={["data[].usage."]} type="number<float>" required>
              该任务或请求扣除的点数。

              取值范围：`0 <= x <= infinity`。

              示例：`26`。
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="error" pre={["data[]."]} type="object">
          任务失败时返回的错误详情。

          <Expandable title="child attributes">
            <ResponseField name="code" pre={["data[].error."]} type="string" required>
              稳定且可供程序读取的任务失败代码。
            </ResponseField>

            <ResponseField name="message" pre={["data[].error."]} type="string" required>
              便于阅读的任务失败说明。
            </ResponseField>

            <ResponseField name="failed_at" pre={["data[].error."]} type="integer<int64>">
              任务失败时的 Unix 时间戳（秒）。
            </ResponseField>

            <ResponseField name="retryable" pre={["data[].error."]} type="boolean">
              重试相同操作是否可能成功。
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="status" type="enum<string>" required>
      本次提交的视频任务的当前状态。

      可选值：`queued`、`processing`、`succeeded`、`failed`。
    </ResponseField>

    <ResponseField name="created_at" type="integer<int64>" required>
      批次任务创建时间的 Unix 时间戳，单位为秒。
    </ResponseField>

    <ResponseField name="mode" type="enum<string>" required>
      本次提交任务使用的视频生成模式。

      可选值：`text_to_video`、`first_frame_image_to_video`、`first_last_frame_image_to_video`、`reference_to_video`。
    </ResponseField>

    <ResponseField name="model" type="enum<string>" required>
      本次提交任务使用的视频生成模型。

      可选值：`bytedance/seedance-2.0`、`bytedance/seedance-2.0-fast`、`google/veo-3.1`、`xai/grok-imagine`。
    </ResponseField>

    <ResponseField name="usage" type="object">
      可用时返回本次提交任务扣除的总点数。

      <Expandable title="child attributes">
        <ResponseField name="credits" pre={["usage."]} type="number<float>" required>
          该任务或请求扣除的点数。

          取值范围：`0 <= x <= infinity`。

          示例：`26`。
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="400">
    请求无效

    <ResponseField name="error" type="object" required>
      结构化错误详情。

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          稳定且可供程序读取的错误码。

          示例：`"invalid_prompt"`。
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          便于阅读的错误说明。

          示例：`"prompt is required and must be a non-empty string"`。
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          包含此错误更多信息的可选文档 URL。

          示例：`"https://api.neural4d.com/docs/errors#invalid_prompt"`。
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="401">
    认证失败

    <ResponseField name="error" type="object" required>
      结构化错误详情。

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          稳定且可供程序读取的错误码。

          示例：`"invalid_prompt"`。
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          便于阅读的错误说明。

          示例：`"prompt is required and must be a non-empty string"`。
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          包含此错误更多信息的可选文档 URL。

          示例：`"https://api.neural4d.com/docs/errors#invalid_prompt"`。
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="403">
    当前已认证用户无权访问该资源或点数不足

    <ResponseField name="error" type="object" required>
      结构化错误详情。

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          稳定且可供程序读取的错误码。

          示例：`"invalid_prompt"`。
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          便于阅读的错误说明。

          示例：`"prompt is required and must be a non-empty string"`。
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          包含此错误更多信息的可选文档 URL。

          示例：`"https://api.neural4d.com/docs/errors#invalid_prompt"`。
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="429">
    已超过请求或配额限制

    <ResponseField name="error" type="object" required>
      结构化错误详情。

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          稳定且可供程序读取的错误码。

          示例：`"invalid_prompt"`。
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          便于阅读的错误说明。

          示例：`"prompt is required and must be a non-empty string"`。
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          包含此错误更多信息的可选文档 URL。

          示例：`"https://api.neural4d.com/docs/errors#invalid_prompt"`。
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="500">
    内部或上游服务错误

    <ResponseField name="error" type="object" required>
      结构化错误详情。

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          稳定且可供程序读取的错误码。

          示例：`"invalid_prompt"`。
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          便于阅读的错误说明。

          示例：`"prompt is required and must be a non-empty string"`。
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          包含此错误更多信息的可选文档 URL。

          示例：`"https://api.neural4d.com/docs/errors#invalid_prompt"`。
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```json 202 Example theme={null}
  {
    "id": "normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d",
    "status": "queued",
    "created_at": 1784044800,
    "mode": "text_to_video",
    "model": "xai/grok-imagine",
    "data": [
      {
        "uuid": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87",
        "status": "queued",
        "created_at": 1784044800
      }
    ],
    "usage": {
      "credits": 90
    }
  }
  ```

  ```json 400 invalid_prompt theme={null}
  {
    "error": {
      "code": "invalid_prompt",
      "message": "prompt is required and must be a non-empty string"
    }
  }
  ```

  ```json 400 unsupported_model theme={null}
  {
    "error": {
      "code": "unsupported_model",
      "message": "Unsupported modelKey: missing-model"
    }
  }
  ```

  ```json 400 model_unavailable theme={null}
  {
    "error": {
      "code": "model_unavailable",
      "message": "Model is unavailable: veo-3.1"
    }
  }
  ```

  ```json 401 Example theme={null}
  {
    "error": {
      "code": "invalid_api_key",
      "message": "The API key is invalid or expired"
    }
  }
  ```

  ```json 403 Example theme={null}
  {
    "error": {
      "code": "insufficient_credits",
      "message": "Insufficient credits for video generation"
    }
  }
  ```

  ```json 429 Example theme={null}
  {
    "error": {
      "code": "rate_limit_exceeded",
      "message": "Too many requests. Retry after the indicated interval."
    }
  }
  ```

  ```json 500 Example theme={null}
  {
    "error": {
      "code": "internal_error",
      "message": "An internal error occurred"
    }
  }
  ```
</ResponseExample>
