Videos
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.*;
String payload = String.join("\n",
"{",
" \"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\"",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"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"
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'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"
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""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""
}";
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(
payload,
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": [
{
"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": [
{
"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": [
{
"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": [
{
"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.*;
String payload = String.join("\n",
"{",
" \"model\": \"bytedance/seedance-2.0\",",
" \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",",
" \"frame_images\": [",
" {",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"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
}`)
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": [
{
"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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""model"": ""bytedance/seedance-2.0"",
""prompt"": ""The camera slowly pushes in while soft wind moves the leaves"",
""frame_images"": [
{
""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
}";
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(
payload,
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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000",
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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.*;
String payload = String.join("\n",
"{",
" \"model\": \"bytedance/seedance-2.0-fast\",",
" \"prompt\": \"Move naturally from the opening frame to the closing frame\",",
" \"frame_images\": [",
" {",
" \"frame_type\": \"first_frame\",",
" \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"",
" },",
" {",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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
}`)
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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""model"": ""bytedance/seedance-2.0-fast"",
""prompt"": ""Move naturally from the opening frame to the closing frame"",
""frame_images"": [
{
""frame_type"": ""first_frame"",
""file_id"": ""550e8400-e29b-41d4-a716-446655440000""
},
{
""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
}";
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(
payload,
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.*;
String payload = String.join("\n",
"{",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"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
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""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
}";
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(
payload,
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 must not exceed 10 MB"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}
Authorizations
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.
Omitted optional parameters use the selected model’s current defaults.
Each first frame, last frame, and reference image must be at most 10 MiB, whether supplied by file_id or url.
- seedance-2.0
- seedance-2.0-fast
- veo-3.1
- kling-3.0
- grok-imagine
Required text instruction describing the video to generate.Required string length:
1 - 1000.Duration in seconds.Available options:
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15.Return an image of the generated video’s final frame.When enabled, get the image URL from
output.videos[].last_frame_url in Retrieve a task.Enable person references for
frame_images and input_references. Generated videos are private by default when enabled. Processing time may increase; enable it only when person references are needed.Provide at least one non-empty array: frame_images or input_references. Does not support copyrighted faces that require verification.Required text instruction describing the video to generate.Required string length:
1 - 1000.Duration in seconds.Available options:
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15.Return an image of the generated video’s final frame.When enabled, get the image URL from
output.videos[].last_frame_url in Retrieve a task.Enable person references for
frame_images and input_references. Generated videos are private by default when enabled. Processing time may increase; enable it only when person references are needed.Provide at least one non-empty array: frame_images or input_references. Does not support copyrighted faces that require verification.Required text instruction describing the video to generate.Required string length:
1 - 1000.Kling 3.0 model.Available option:
kuaishou/kling-3.0.Supports text-to-video and first-frame image-to-video. For image input, provide one item with type: "image" and frame_type: "first_frame" in frame_images. Last-frame images and input_references return unsupported_input_mode.Required text instruction describing the video to generate.Required string length:
1 - 1000.Whether to generate native audio. Enabling audio may affect the credits charged, which are returned in
usage.credits.Required text instruction describing the video to generate.Required string length:
1 - 1000.First-frame and last-frame images supplied by
file_id or url. Supported formats are JPG, JPEG, PNG, and WEBP, with a 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
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 #....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. 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.
- Image
- Video
- Audio
Hide Child attributes
Hide Child attributes
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
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
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.*;
String payload = String.join("\n",
"{",
" \"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\"",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"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"
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'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"
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""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""
}";
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(
payload,
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": [
{
"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": [
{
"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": [
{
"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": [
{
"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.*;
String payload = String.join("\n",
"{",
" \"model\": \"bytedance/seedance-2.0\",",
" \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",",
" \"frame_images\": [",
" {",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"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
}`)
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": [
{
"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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""model"": ""bytedance/seedance-2.0"",
""prompt"": ""The camera slowly pushes in while soft wind moves the leaves"",
""frame_images"": [
{
""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
}";
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(
payload,
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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000",
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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.*;
String payload = String.join("\n",
"{",
" \"model\": \"bytedance/seedance-2.0-fast\",",
" \"prompt\": \"Move naturally from the opening frame to the closing frame\",",
" \"frame_images\": [",
" {",
" \"frame_type\": \"first_frame\",",
" \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"",
" },",
" {",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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
}`)
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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""model"": ""bytedance/seedance-2.0-fast"",
""prompt"": ""Move naturally from the opening frame to the closing frame"",
""frame_images"": [
{
""frame_type"": ""first_frame"",
""file_id"": ""550e8400-e29b-41d4-a716-446655440000""
},
{
""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
}";
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(
payload,
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.*;
String payload = String.join("\n",
"{",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"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
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""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
}";
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(
payload,
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
Batch task ID returned by the generation request.Example:
"normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d".Generated child items created by the request.Allowed array length:
1 - unbounded elements.Show child attributes
Show child attributes
Normalized task lifecycle status.Available options:
queued, processing, succeeded, failed.Error details when the task fails.
Show child attributes
Show child attributes
Current status shared by the submitted video tasks.Available options:
queued, processing, succeeded, failed.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.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, kuaishou/kling-3.0.Invalid request
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.
unsupported_person_reference: The selected model or route does not supportinput_with_person: true.invalid_input_references: Person references are enabled but neitherframe_imagesnorinput_referencesis provided.
Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".Authentication failed
Structured error details.
Show child attributes
Show child attributes
Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".The authenticated user cannot access this resource or has insufficient credits
Structured error details.
Show child attributes
Show child attributes
Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".Reference download timed out
Reference file too large
Structured error details.
Hide Child attributes
Hide Child attributes
Invalid or unsupported reference file
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.
Reference download failed
Structured error details.
Hide Child attributes
Hide Child attributes
Request or quota limit exceeded
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".Internal or upstream service errorWhen
error.details.submission_accepted is true, your generation task is already queued but a later operation failed.
error.details.task retains the task ID, UUIDs, and known credit usage. retryable is false; do not resubmit the generation request, as doing so can charge you again.
If registration succeeded, you can query the task by its ID. If error.details.registration_failed is true, the error code is task_registration_failed and task lookup may return 404 until registration is repaired.
When error.details.submission_uncertain is true, the response retains the attempted task ID; check the original submission before resubmitting. Credit usage is omitted when the final charge is unknown.Structured error details.
Show child attributes
Show child attributes
Human-readable explanation of the error.Example:
"prompt is required and must be a non-empty string".{
"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 must not exceed 10 MB"
}
}
{
"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.*;
String payload = String.join("\n",
"{",
" \"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\"",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"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"
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'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"
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""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""
}";
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(
payload,
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": [
{
"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": [
{
"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": [
{
"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": [
{
"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.*;
String payload = String.join("\n",
"{",
" \"model\": \"bytedance/seedance-2.0\",",
" \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",",
" \"frame_images\": [",
" {",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"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
}`)
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": [
{
"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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""model"": ""bytedance/seedance-2.0"",
""prompt"": ""The camera slowly pushes in while soft wind moves the leaves"",
""frame_images"": [
{
""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
}";
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(
payload,
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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000",
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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.*;
String payload = String.join("\n",
"{",
" \"model\": \"bytedance/seedance-2.0-fast\",",
" \"prompt\": \"Move naturally from the opening frame to the closing frame\",",
" \"frame_images\": [",
" {",
" \"frame_type\": \"first_frame\",",
" \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"",
" },",
" {",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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
}`)
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": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'JSON'
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""model"": ""bytedance/seedance-2.0-fast"",
""prompt"": ""Move naturally from the opening frame to the closing frame"",
""frame_images"": [
{
""frame_type"": ""first_frame"",
""file_id"": ""550e8400-e29b-41d4-a716-446655440000""
},
{
""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
}";
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(
payload,
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.*;
String payload = String.join("\n",
"{",
" \"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",
"}"
);
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(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"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
}`)
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"
) do |http|
http.request(request)
end
puts response.body
<?php
$payload = <<<'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
}
JSON;
$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 => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
var payload = @"{
""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
}";
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(
payload,
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 must not exceed 10 MB"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}