Video generation
Create video generation tasks
Creates asynchronous video generation tasks. Generation behavior is inferred from the required prompt, frame images, and typed reference assets.
POST
/
openapi
/
v1
/
videos
/
generations
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"
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
{
"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
}
}
{
"error": {
"code": "invalid_prompt",
"message": "prompt is required and must be a non-empty string"
}
}
{
"error": {
"code": "unsupported_model",
"message": "Unsupported modelKey: missing-model"
}
}
{
"error": {
"code": "model_unavailable",
"message": "Model is unavailable: veo-3.1"
}
}
{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid or expired"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits for video generation"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}
Authorizations
string
default:"Bearer ${YOUR_API_KEY}"
required
Neural4D API key using the Bearer scheme.
Body application/json
- Option 1
- Option 2
- Option 3
- Option 4
enum<string>
required
Seedance 2.0 model.Available options:
bytedance/seedance-2.0.string
required
Required text instruction describing the video to generate.Required string length:
1 - 1000.boolean
default:true
Whether to generate native audio with the video.
enum<string>
default:"720p"
Available options:
480p, 720p, 1080p, 4K.enum<string>
default:"16:9"
Available options:
1:1, 16:9, 9:16, 4:3, 3:4.enum<integer>
default:5
Duration in seconds.Available options:
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15.enum<string>
required
Seedance 2.0 Fast model.Available options:
bytedance/seedance-2.0-fast.string
required
Required text instruction describing the video to generate.Required string length:
1 - 1000.boolean
default:true
Whether to generate native audio with the video.
enum<string>
default:"720p"
Available options:
480p, 720p.enum<string>
default:"16:9"
Available options:
1:1, 16:9, 9:16, 4:3, 3:4.enum<integer>
default:5
Duration in seconds.Available options:
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15.enum<string>
required
Veo 3.1 model.Available options:
google/veo-3.1.string
required
Required text instruction describing the video to generate.Required string length:
1 - 1000.boolean
default:true
Whether to generate native audio with the video.
enum<string>
default:"720p"
Available options:
720p, 1080p, 4K.enum<string>
default:"16:9"
Available options:
16:9, 9:16.enum<integer>
default:8
Duration in seconds.Available options:
4, 5, 6, 7, 8.enum<string>
required
Grok Imagine model.Available options:
xai/grok-imagine.string
required
Required text instruction describing the video to generate.Required string length:
1 - 1000.enum<string>
default:"720p"
Available options:
480p, 720p.enum<string>
default:"16:9"
Available options:
1:1, 16:9, 9:16, 2:3, 3:2.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.integer
default:1
Number of video generation tasks to create.Required range:
1 <= x <= 4.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.Hide Child attributes
Hide Child attributes
Media type of the frame asset.Available options:
image.Position represented by the image.Available options:
first_frame, last_frame.File ID returned by the file upload endpoint. Supported formats are JPG, JPEG, PNG, and WEBP.Example:
"550e8400-e29b-41d4-a716-446655440000".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.
- Option 1
- Option 2
- Option 3
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"
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
Response
- 202
- 400
- 401
- 403
- 429
- 500
Generation tasks accepted
string
required
Batch task ID returned by the generation request.Example:
"normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d".object[]
required
Generated child items created by the request.Allowed array length:
1 - unbounded elements.Show child attributes
Show child attributes
Generated child item UUID.
Normalized task lifecycle status.Available options:
queued, processing, succeeded, failed.Unix timestamp in seconds.
Unix timestamp in seconds.
Credits charged for this task when available.
Show child attributes
Show child attributes
Credits charged for the task or submission.Required range:
0 <= x <= infinity.Example: 26.Error details when the task fails.
Show child attributes
Show child attributes
enum<string>
required
Current status shared by the submitted video tasks.Available options:
queued, processing, succeeded, failed.integer<int64>
required
Unix timestamp in seconds when the batch task was created.
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.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.Invalid request
object
required
Structured error details.
Show child attributes
Show child attributes
Stable machine-readable error code.Example:
"invalid_prompt".Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".Optional documentation URL with more information about the error.Example:
"https://api.neural4d.com/docs/errors#invalid_prompt".Authentication failed
object
required
Structured error details.
Show child attributes
Show child attributes
Stable machine-readable error code.Example:
"invalid_prompt".Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".Optional documentation URL with more information about the error.Example:
"https://api.neural4d.com/docs/errors#invalid_prompt".The authenticated user cannot access this resource or has insufficient credits
object
required
Structured error details.
Show child attributes
Show child attributes
Stable machine-readable error code.Example:
"invalid_prompt".Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".Optional documentation URL with more information about the error.Example:
"https://api.neural4d.com/docs/errors#invalid_prompt".Request or quota limit exceeded
object
required
Structured error details.
Show child attributes
Show child attributes
Stable machine-readable error code.Example:
"invalid_prompt".Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".Optional documentation URL with more information about the error.Example:
"https://api.neural4d.com/docs/errors#invalid_prompt".Internal or upstream service error
object
required
Structured error details.
Show child attributes
Show child attributes
Stable machine-readable error code.Example:
"invalid_prompt".Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".Optional documentation URL with more information about the error.Example:
"https://api.neural4d.com/docs/errors#invalid_prompt".{
"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
}
}
{
"error": {
"code": "invalid_prompt",
"message": "prompt is required and must be a non-empty string"
}
}
{
"error": {
"code": "unsupported_model",
"message": "Unsupported modelKey: missing-model"
}
}
{
"error": {
"code": "model_unavailable",
"message": "Model is unavailable: veo-3.1"
}
}
{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid or expired"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits for video generation"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}
โI
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"
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
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
}
'
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())
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);
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);
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());
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))
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
$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;
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());
{
"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
}
}
{
"error": {
"code": "invalid_prompt",
"message": "prompt is required and must be a non-empty string"
}
}
{
"error": {
"code": "unsupported_model",
"message": "Unsupported modelKey: missing-model"
}
}
{
"error": {
"code": "model_unavailable",
"message": "Model is unavailable: veo-3.1"
}
}
{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid or expired"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits for video generation"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}

