视频生成
创建视频生成任务
创建异步视频生成任务。生成方式根据必填提示词、帧图片和带类型的参考素材推断。
POST
/
openapi
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"id": "normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d",
"status": "queued",
"created_at": 1784044800,
"mode": "text_to_video",
"model": "xai/grok-imagine",
"data": [
{
"uuid": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87",
"status": "queued",
"created_at": 1784044800
}
],
"usage": {
"credits": 90
}
}
{
"error": {
"code": "invalid_prompt",
"message": "prompt is required and must be a non-empty string"
}
}
{
"error": {
"code": "unsupported_model",
"message": "Unsupported modelKey: missing-model"
}
}
{
"error": {
"code": "model_unavailable",
"message": "Model is unavailable: veo-3.1"
}
}
{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid or expired"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits for video generation"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}
授权
string
默认值:"Bearer ${YOUR_API_KEY}"
必填
使用 Bearer 方式发送的 Neural4D API 密钥。
请求体 application/json
- Option 1
- Option 2
- Option 3
- Option 4
enum<string>
必填
Seedance 2.0 模型。可选值:
bytedance/seedance-2.0。string
必填
描述待生成视频的必填文本提示词。字符串长度:
1 - 1000。boolean
默认值:true
是否为视频生成原生音频。
enum<string>
默认值:"720p"
可选值:
480p、720p、1080p、4K。enum<string>
默认值:"16:9"
可选值:
1:1、16:9、9:16、4:3、3:4。enum<integer>
默认值:5
视频时长,单位为秒。可选值:
4、5、6、7、8、9、10、11、12、13、14、15。enum<string>
必填
Seedance 2.0 Fast 模型。可选值:
bytedance/seedance-2.0-fast。string
必填
描述待生成视频的必填文本提示词。字符串长度:
1 - 1000。boolean
默认值:true
是否为视频生成原生音频。
enum<string>
默认值:"720p"
可选值:
480p、720p。enum<string>
默认值:"16:9"
可选值:
1:1、16:9、9:16、4:3、3:4。enum<integer>
默认值:5
视频时长,单位为秒。可选值:
4、5、6、7、8、9、10、11、12、13、14、15。enum<string>
必填
Veo 3.1 模型。可选值:
google/veo-3.1。string
必填
描述待生成视频的必填文本提示词。字符串长度:
1 - 1000。boolean
默认值:true
是否为视频生成原生音频。
enum<string>
默认值:"720p"
可选值:
720p、1080p、4K。enum<string>
默认值:"16:9"
可选值:
16:9、9:16。enum<integer>
默认值:8
视频时长,单位为秒。可选值:
4、5、6、7、8。integer
默认值:1
创建的视频生成任务数量。取值范围:
1 <= x <= 4。object[]
通过
POST /openapi/v1/files 上传的首帧和尾帧图片。支持 JPG、JPEG、PNG 和 WEBP。每个 frame_type 最多出现一次。数组长度:1 - 2 个元素。object[]
已上传的图片、视频和音频参考素材。接口最多接受六张图片、四个视频和两个音频。音频必须与至少一个图片或视频同时使用。
- Option 1
- Option 2
- Option 3
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
响应
- 202
- 400
- 401
- 403
- 429
- 500
已接受生成任务
string
必填
生成请求返回的批次任务 ID。示例:
"normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d"。object[]
必填
本次请求创建的生成结果子项。数组长度:至少
1 个元素。显示 child attributes
显示 child attributes
生成结果子项 UUID。
标准化后的任务生命周期状态。可选值:
queued、processing、succeeded、failed。Unix 时间戳(秒)。
Unix 时间戳(秒)。
可用时返回此任务扣除的点数。
显示 child attributes
显示 child attributes
该任务或请求扣除的点数。取值范围:
0 <= x <= infinity。示例:26。enum<string>
必填
本次提交的视频任务的当前状态。可选值:
queued、processing、succeeded、failed。integer<int64>
必填
批次任务创建时间的 Unix 时间戳,单位为秒。
enum<string>
必填
本次提交任务使用的视频生成模式。可选值:
text_to_video、first_frame_image_to_video、first_last_frame_image_to_video、reference_to_video。enum<string>
必填
本次提交任务使用的视频生成模型。可选值:
bytedance/seedance-2.0、bytedance/seedance-2.0-fast、google/veo-3.1、xai/grok-imagine。请求无效
认证失败
当前已认证用户无权访问该资源或点数不足
已超过请求或配额限制
{
"id": "normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d",
"status": "queued",
"created_at": 1784044800,
"mode": "text_to_video",
"model": "xai/grok-imagine",
"data": [
{
"uuid": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87",
"status": "queued",
"created_at": 1784044800
}
],
"usage": {
"credits": 90
}
}
{
"error": {
"code": "invalid_prompt",
"message": "prompt is required and must be a non-empty string"
}
}
{
"error": {
"code": "unsupported_model",
"message": "Unsupported modelKey: missing-model"
}
}
{
"error": {
"code": "model_unavailable",
"message": "Model is unavailable: veo-3.1"
}
}
{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid or expired"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits for video generation"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}
⌘I
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "xai/grok-imagine",
"prompt": "A cinematic tracking shot through a neon-lit street at night",
"duration": 6,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"xai/grok-imagine\",\n \"prompt\": \"A cinematic tracking shot through a neon-lit street at night\",\n \"duration\": 6,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\"\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "bytedance/seedance-2.0",
"prompt": "The camera slowly pushes in while soft wind moves the leaves",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"bytedance/seedance-2.0\",\n \"prompt\": \"The camera slowly pushes in while soft wind moves the leaves\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "bytedance/seedance-2.0-fast",
"prompt": "Move naturally from the opening frame to the closing frame",
"frame_images": [
{
"type": "image",
"frame_type": "first_frame",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "image",
"frame_type": "last_frame",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
],
"duration": 5,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"bytedance/seedance-2.0-fast\",\n \"prompt\": \"Move naturally from the opening frame to the closing frame\",\n \"frame_images\": [\n {\n \"type\": \"image\",\n \"frame_type\": \"first_frame\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"image\",\n \"frame_type\": \"last_frame\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n }\n ],\n \"duration\": 5,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl --request POST \
--url https://api.neural4d.com/openapi/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}
'
import requests
response = requests.request(
"POST",
"https://api.neural4d.com/openapi/v1/videos/generations",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
},
)
print(response.json())
const response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
const response: Response = await fetch("https://api.neural4d.com/openapi/v1/videos/generations", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}),
});
const data = await response.json();
console.log(data);
import java.net.URI;
import java.net.http.*;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.neural4d.com/openapi/v1/videos/generations"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
payload := strings.NewReader("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}")
req, _ := http.NewRequest("POST", "https://api.neural4d.com/openapi/v1/videos/generations", payload)
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
bodyBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(bodyBytes))
require "net/http"
require "json"
uri = URI("https://api.neural4d.com/openapi/v1/videos/generations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = {
"model": "google/veo-3.1",
"prompt": "Create a cohesive cinematic sequence using the supplied references",
"input_references": [
{
"type": "image",
"file_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"type": "video",
"file_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
},
{
"type": "audio",
"file_id": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87"
}
],
"duration": 8,
"n": 1,
"resolution": "720p",
"aspect_ratio": "16:9",
"output_with_audio": true
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
<?php
$ch = curl_init("https://api.neural4d.com/openapi/v1/videos/generations");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => "{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}",
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.neural4d.com/openapi/v1/videos/generations");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\n \"model\": \"google/veo-3.1\",\n \"prompt\": \"Create a cohesive cinematic sequence using the supplied references\",\n \"input_references\": [\n {\n \"type\": \"image\",\n \"file_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n },\n {\n \"type\": \"video\",\n \"file_id\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n },\n {\n \"type\": \"audio\",\n \"file_id\": \"7d1fa4bb-41e6-4a5d-88d8-1851f5342e87\"\n }\n ],\n \"duration\": 8,\n \"n\": 1,\n \"resolution\": \"720p\",\n \"aspect_ratio\": \"16:9\",\n \"output_with_audio\": true\n}", Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"id": "normal-video-c50fe63e-699d-4d61-93f5-2099ab159d6d",
"status": "queued",
"created_at": 1784044800,
"mode": "text_to_video",
"model": "xai/grok-imagine",
"data": [
{
"uuid": "7d1fa4bb-41e6-4a5d-88d8-1851f5342e87",
"status": "queued",
"created_at": 1784044800
}
],
"usage": {
"credits": 90
}
}
{
"error": {
"code": "invalid_prompt",
"message": "prompt is required and must be a non-empty string"
}
}
{
"error": {
"code": "unsupported_model",
"message": "Unsupported modelKey: missing-model"
}
}
{
"error": {
"code": "model_unavailable",
"message": "Model is unavailable: veo-3.1"
}
}
{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid or expired"
}
}
{
"error": {
"code": "insufficient_credits",
"message": "Insufficient credits for video generation"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the indicated interval."
}
}
{
"error": {
"code": "internal_error",
"message": "An internal error occurred"
}
}

