Video generation
Create video generation tasks
Creates asynchronous video generation tasks from a prompt and optional frame or reference assets supplied by file ID or HTTPS URL.
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": "reference_too_large",
"message": "Reference file exceeds the allowed size"
}
}
{
"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
With no references, the request uses text-to-video. With onlyframe_images, it uses first-frame or first-and-last-frame generation. Adding input_references selects reference-to-video. The model must support the selected mode.
- 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 supplied by
file_id or url. Supported formats are JPG, JPEG, PNG, and WEBP, with a default maximum of 10 MiB per image. Images must pass content moderation. Each frame_type may appear at most once; last_frame requires first_frame.Allowed array length: 1 - 2 elements when provided. Provide exactly one of file_id or url per item.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
POST /openapi/v1/files for an image owned by your account. Required when url is omitted; do not send both.Example: "550e8400-e29b-41d4-a716-446655440000".Public HTTPS file URL on port 443, up to 2,048 characters by default. Required when
file_id is omitted; do not send both.The file must be downloadable without cookies or extra authorization headers. Signed URLs are supported; keep them valid during download. Do not include a username, password, or #....object[]
Image, video, and audio references supplied by
file_id or url. Provide exactly one source per item; you can mix sources across items. Audio must be accompanied by at least one image or video, including a frame image.Allowed array length: 1 - 12 elements when provided, subject to the per-type limits.- Images: up to 6 per request, including
frame_images; JPG/JPEG, PNG, or WEBP; up to 10 MiB per file by default. Images must pass content moderation. - Videos: up to 4 per request; MP4 or MOV; up to 100 MiB per file by default.
- Audio: up to 2 per request; MP3 or WAV; up to 15 MiB per file by default.
- Option 1
- Option 2
- Option 3
Hide Child attributes
Hide Child attributes
Image reference.Available options:
image.File ID for your uploaded image file. Required when
url is omitted; do not send both.Public HTTPS file URL on port 443, up to 2,048 characters by default. Required when
file_id is omitted; do not send both.The file must be downloadable without cookies or extra authorization headers. Signed URLs are supported; keep them valid during download. Do not include a username, password, or #....Hide Child attributes
Hide Child attributes
Video reference.Available options:
video.File ID for your uploaded video file. Required when
url is omitted; do not send both.Public HTTPS file URL on port 443, up to 2,048 characters by default. Required when
file_id is omitted; do not send both.The file must be downloadable without cookies or extra authorization headers. Signed URLs are supported; keep them valid during download. Do not include a username, password, or #....Hide Child attributes
Hide Child attributes
Audio reference.Available options:
audio.File ID for your uploaded audio file. Required when
url is omitted; do not send both.Public HTTPS file URL on port 443, up to 2,048 characters by default. Required when
file_id is omitted; do not send both.The file must be downloadable without cookies or extra authorization headers. Signed URLs are supported; keep them valid during download. Do not include a username, password, or #....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
Identify errors byerror.code, not by matching message text.
- 202
- 400
- 401
- 403
- 408
- 413
- 415
- 422
- 429
- 500
- 503
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".URL reference errors:invalid_reference_source: Provide exactly one offile_idorurlper reference.invalid_reference_url: The URL format or length is invalid.unsafe_reference_url: The URL or redirect destination is not allowed. Use a public file URL that meets the requirements above.file_rejected: The image failed content moderation. Use another image.
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".Reference download timed out
Reference file too large
object
required
Invalid or unsupported reference file
object
required
Structured error details.
Hide Child attributes
Hide Child attributes
invalid_reference_file: The file is empty or its content cannot be inspected.invalid_reference_file_type: The format is unsupported or does not match the reference type or responseContent-Type.
Human-readable explanation. Use
error.code to identify the cause.Reference download failed
object
required
Structured error details.
Hide Child attributes
Hide Child attributes
Request or quota limit exceeded
object
required
Structured error details.
Show child attributes
Show child attributes
Stable machine-readable error code.Example:
"invalid_prompt".URL reference errors:reference_import_busy: Reference import is busy. Retry after the interval in theRetry-Afterresponse header.
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": "reference_too_large",
"message": "Reference file exceeds the allowed size"
}
}
{
"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": "reference_too_large",
"message": "Reference file exceeds the allowed size"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}

