> ## 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.

# Create video generation tasks

> Creates asynchronous video generation tasks. Generation behavior is inferred from the required prompt, frame images, and typed reference assets.

## Authorizations

<ParamField header="Authorization" type="string" required default={'Bearer ${YOUR_API_KEY}'}>
  Neural4D API key using the Bearer scheme.
</ParamField>

## Body <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 model.

      Available options: `bytedance/seedance-2.0`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Required text instruction describing the video to generate.

      Required string length: `1 - 1000`.
    </ParamField>

    <ParamField body="output_with_audio" type="boolean" default={true}>
      Whether to generate native audio with the video.
    </ParamField>

    <ParamField body="resolution" type="enum<string>" default="720p">
      Available options: `480p`, `720p`, `1080p`, `4K`.
    </ParamField>

    <ParamField body="aspect_ratio" type="enum<string>" default="16:9">
      Available options: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`.
    </ParamField>

    <ParamField body="duration" type="enum<integer>" default={5}>
      Duration in seconds.

      Available options: `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 model.

      Available options: `bytedance/seedance-2.0-fast`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Required text instruction describing the video to generate.

      Required string length: `1 - 1000`.
    </ParamField>

    <ParamField body="output_with_audio" type="boolean" default={true}>
      Whether to generate native audio with the video.
    </ParamField>

    <ParamField body="resolution" type="enum<string>" default="720p">
      Available options: `480p`, `720p`.
    </ParamField>

    <ParamField body="aspect_ratio" type="enum<string>" default="16:9">
      Available options: `1:1`, `16:9`, `9:16`, `4:3`, `3:4`.
    </ParamField>

    <ParamField body="duration" type="enum<integer>" default={5}>
      Duration in seconds.

      Available options: `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 model.

      Available options: `google/veo-3.1`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Required text instruction describing the video to generate.

      Required string length: `1 - 1000`.
    </ParamField>

    <ParamField body="output_with_audio" type="boolean" default={true}>
      Whether to generate native audio with the video.
    </ParamField>

    <ParamField body="resolution" type="enum<string>" default="720p">
      Available options: `720p`, `1080p`, `4K`.
    </ParamField>

    <ParamField body="aspect_ratio" type="enum<string>" default="16:9">
      Available options: `16:9`, `9:16`.
    </ParamField>

    <ParamField body="duration" type="enum<integer>" default={8}>
      Duration in seconds.

      Available options: `4`, `5`, `6`, `7`, `8`.
    </ParamField>
  </Tab>

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

      Available options: `xai/grok-imagine`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Required text instruction describing the video to generate.

      Required string length: `1 - 1000`.
    </ParamField>

    <ParamField body="resolution" type="enum<string>" default="720p">
      Available options: `480p`, `720p`.
    </ParamField>

    <ParamField body="aspect_ratio" type="enum<string>" default="16:9">
      Available options: `1:1`, `16:9`, `9:16`, `2:3`, `3:2`.
    </ParamField>

    <ParamField body="duration" type="enum<integer>" default={6}>
      Duration in seconds.

      Available options: `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}>
  Number of video generation tasks to create.

  Required range: `1 <= x <= 4`.
</ParamField>

<ParamField body="frame_images" type="object[]">
  First-frame and last-frame images uploaded through `POST /openapi/v1/files`. Supported formats are JPG, JPEG, PNG, and WEBP. Each `frame_type` may appear at most once.

  Allowed array length: `1 - 2` elements.

  <Expandable title="Child attributes" defaultOpen>
    <ParamField body="type" pre={["frame_images."]} type="enum<string>" required>
      Media type of the frame asset.

      Available options: `image`.
    </ParamField>

    <ParamField body="frame_type" pre={["frame_images."]} type="enum<string>" required>
      Position represented by the image.

      Available options: `first_frame`, `last_frame`.
    </ParamField>

    <ParamField body="file_id" pre={["frame_images."]} type="string<uuid>" required>
      File ID returned by the file upload endpoint. Supported formats are JPG, JPEG, PNG, and WEBP.

      Example: `"550e8400-e29b-41d4-a716-446655440000"`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="input_references" type="object[]">
  Uploaded image, video, and audio references. The endpoint accepts up to six images, four videos, and two audio files. Audio must be accompanied by at least one image or video.

  <Tabs sync={false}>
    <Tab title="Option 1">
      <Expandable title="Child attributes" defaultOpen>
        <ParamField body="type" pre={["input_references."]} type="enum<string>" required>
          Image reference.

          Available options: `image`.
        </ParamField>

        <ParamField body="file_id" pre={["input_references."]} type="string<uuid>" required>
          File ID for a JPG, JPEG, PNG, or WEBP image.
        </ParamField>
      </Expandable>
    </Tab>

    <Tab title="Option 2">
      <Expandable title="Child attributes" defaultOpen>
        <ParamField body="type" pre={["input_references."]} type="enum<string>" required>
          Video reference.

          Available options: `video`.
        </ParamField>

        <ParamField body="file_id" pre={["input_references."]} type="string<uuid>" required>
          File ID for an MP4 or MOV video.
        </ParamField>
      </Expandable>
    </Tab>

    <Tab title="Option 3">
      <Expandable title="Child attributes" defaultOpen>
        <ParamField body="type" pre={["input_references."]} type="enum<string>" required>
          Audio reference.

          Available options: `audio`.
        </ParamField>

        <ParamField body="file_id" pre={["input_references."]} type="string<uuid>" required>
          File ID for an MP3 or WAV audio file. Each file must be 2 to 15 seconds and no larger than 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>

## Response

<Tabs sync={false}>
  <Tab title="202">
    Generation tasks accepted

    <ResponseField name="id" type="string" required>
      Batch task ID returned by the generation request.

      Example: `"normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d"`.
    </ResponseField>

    <ResponseField name="data" type="object[]" required>
      Generated child items created by the request.

      Allowed array length: `1 - unbounded` elements.

      <Expandable title="child attributes">
        <ResponseField name="uuid" pre={["data[]."]} type="string<uuid>" required>
          Generated child item UUID.
        </ResponseField>

        <ResponseField name="status" pre={["data[]."]} type="enum<string>" required>
          Normalized task lifecycle status.

          Available options: `queued`, `processing`, `succeeded`, `failed`.
        </ResponseField>

        <ResponseField name="created_at" pre={["data[]."]} type="integer<int64>" required>
          Unix timestamp in seconds.
        </ResponseField>

        <ResponseField name="updated_at" pre={["data[]."]} type="integer<int64>">
          Unix timestamp in seconds.
        </ResponseField>

        <ResponseField name="usage" pre={["data[]."]} type="object">
          Credits charged for this task when available.

          <Expandable title="child attributes">
            <ResponseField name="credits" pre={["data[].usage."]} type="number<float>" required>
              Credits charged for the task or submission.

              Required range: `0 <= x <= infinity`.

              Example: `26`.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="error" pre={["data[]."]} type="object">
          Error details when the task fails.

          <Expandable title="child attributes">
            <ResponseField name="code" pre={["data[].error."]} type="string" required>
              Stable machine-readable task failure code.
            </ResponseField>

            <ResponseField name="message" pre={["data[].error."]} type="string" required>
              Human-readable explanation of the task failure.
            </ResponseField>

            <ResponseField name="failed_at" pre={["data[].error."]} type="integer<int64>">
              Unix timestamp in seconds when the task failed.
            </ResponseField>

            <ResponseField name="retryable" pre={["data[].error."]} type="boolean">
              Whether retrying the same operation may succeed.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="status" type="enum<string>" required>
      Current status shared by the submitted video tasks.

      Available options: `queued`, `processing`, `succeeded`, `failed`.
    </ResponseField>

    <ResponseField name="created_at" type="integer<int64>" required>
      Unix timestamp in seconds when the batch task was created.
    </ResponseField>

    <ResponseField name="mode" type="enum<string>" required>
      Video generation mode shared by the submitted tasks.

      Available options: `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>
      Video generation model used by the submitted tasks.

      Available options: `bytedance/seedance-2.0`, `bytedance/seedance-2.0-fast`, `google/veo-3.1`, `xai/grok-imagine`.
    </ResponseField>

    <ResponseField name="usage" type="object">
      Total credits charged for the submitted tasks when available.

      <Expandable title="child attributes">
        <ResponseField name="credits" pre={["usage."]} type="number<float>" required>
          Credits charged for the task or submission.

          Required range: `0 <= x <= infinity`.

          Example: `26`.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="400">
    Invalid request

    <ResponseField name="error" type="object" required>
      Structured error details.

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          Stable machine-readable error code.

          Example: `"invalid_prompt"`.
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          Human-readable explanation of the error.

          Example: `"prompt is required and must be a non-empty string"`.
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          Optional documentation URL with more information about the error.

          Example: `"https://api.neural4d.com/docs/errors#invalid_prompt"`.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="401">
    Authentication failed

    <ResponseField name="error" type="object" required>
      Structured error details.

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          Stable machine-readable error code.

          Example: `"invalid_prompt"`.
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          Human-readable explanation of the error.

          Example: `"prompt is required and must be a non-empty string"`.
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          Optional documentation URL with more information about the error.

          Example: `"https://api.neural4d.com/docs/errors#invalid_prompt"`.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="403">
    The authenticated user cannot access this resource or has insufficient credits

    <ResponseField name="error" type="object" required>
      Structured error details.

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          Stable machine-readable error code.

          Example: `"invalid_prompt"`.
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          Human-readable explanation of the error.

          Example: `"prompt is required and must be a non-empty string"`.
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          Optional documentation URL with more information about the error.

          Example: `"https://api.neural4d.com/docs/errors#invalid_prompt"`.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="429">
    Request or quota limit exceeded

    <ResponseField name="error" type="object" required>
      Structured error details.

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          Stable machine-readable error code.

          Example: `"invalid_prompt"`.
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          Human-readable explanation of the error.

          Example: `"prompt is required and must be a non-empty string"`.
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          Optional documentation URL with more information about the error.

          Example: `"https://api.neural4d.com/docs/errors#invalid_prompt"`.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="500">
    Internal or upstream service error

    <ResponseField name="error" type="object" required>
      Structured error details.

      <Expandable title="child attributes">
        <ResponseField name="code" pre={["error."]} type="string" required>
          Stable machine-readable error code.

          Example: `"invalid_prompt"`.
        </ResponseField>

        <ResponseField name="message" pre={["error."]} type="string" required>
          Human-readable explanation of the error.

          Example: `"prompt is required and must be a non-empty string"`.
        </ResponseField>

        <ResponseField name="doc_url" pre={["error."]} type="string<uri> | null">
          Optional documentation URL with more information about the error.

          Example: `"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>
