curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "viduq4_preview_reference",
"prompt": "The barista from @1 stands in front of the cafe in @2 and greets the camera",
"image_urls": [
"https://your-cdn.com/barista.jpg",
"https://your-cdn.com/cafe.jpg"
],
"ref_audios": [
"https://your-cdn.com/greeting.mp3"
],
"duration": 8,
"resolution": "720p",
"ratio": "9:16"
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "viduq4_preview_reference",
"prompt": "The barista from @1 stands in front of the cafe in @2 and greets the camera",
"image_urls": ["https://your-cdn.com/barista.jpg", "https://your-cdn.com/cafe.jpg"],
"ref_audios": ["https://your-cdn.com/greeting.mp3"],
"duration": 8,
"resolution": "720p",
"ratio": "9:16"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'viduq4_preview_reference',
prompt: 'The barista from @1 stands in front of the cafe in @2 and greets the camera',
image_urls: ['https://your-cdn.com/barista.jpg', 'https://your-cdn.com/cafe.jpg'],
ref_audios: ['https://your-cdn.com/greeting.mp3'],
duration: 8,
resolution: '720p',
ratio: '9:16'
})
};
fetch('https://api.goenhance.ai/api/v1/videos/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goenhance.ai/api/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'viduq4_preview_reference',
'prompt' => 'The barista from @1 stands in front of the cafe in @2 and greets the camera',
'image_urls' => [
'https://your-cdn.com/barista.jpg',
'https://your-cdn.com/cafe.jpg'
],
'ref_audios' => [
'https://your-cdn.com/greeting.mp3'
],
'duration' => 8,
'resolution' => '720p',
'ratio' => '9:16'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goenhance.ai/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"viduq4_preview_reference\",\n \"prompt\": \"The barista from @1 stands in front of the cafe in @2 and greets the camera\",\n \"image_urls\": [\n \"https://your-cdn.com/barista.jpg\",\n \"https://your-cdn.com/cafe.jpg\"\n ],\n \"ref_audios\": [\n \"https://your-cdn.com/greeting.mp3\"\n ],\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"ratio\": \"9:16\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goenhance.ai/api/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"viduq4_preview_reference\",\n \"prompt\": \"The barista from @1 stands in front of the cafe in @2 and greets the camera\",\n \"image_urls\": [\n \"https://your-cdn.com/barista.jpg\",\n \"https://your-cdn.com/cafe.jpg\"\n ],\n \"ref_audios\": [\n \"https://your-cdn.com/greeting.mp3\"\n ],\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"ratio\": \"9:16\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"viduq4_preview_reference\",\n \"prompt\": \"The barista from @1 stands in front of the cafe in @2 and greets the camera\",\n \"image_urls\": [\n \"https://your-cdn.com/barista.jpg\",\n \"https://your-cdn.com/cafe.jpg\"\n ],\n \"ref_audios\": [\n \"https://your-cdn.com/greeting.mp3\"\n ],\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"ratio\": \"9:16\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"img_uuid": "c12b656c-747a-44fd-9c80-add79b0c52d5",
"cost": 30.88
}
}Vidu Q4 Preview (Reference to Video)
Vidu Q4 Preview reference-image to video. Supply 1-15 reference images via image_urls and refer to them in the prompt as @1, @2, … in array order; the model keeps those subjects consistent across the video. Optionally add up to 3 reference audio clips via ref_audios to guide voices and dialogue. Output includes a native audio track and goes up to 4K.
This model only accepts image_urls. For first-frame image-to-video use viduq4_preview — passing image_url or image_end_url here returns an error.
Pricing — per second of generated video, in tokens (USD at $0.02/token):
| resolution | tokens/s | USD/s |
|---|---|---|
| 540p | 2.925 | $0.0585 |
| 720p | 6.175 | $0.1235 |
| 1080p | 7.8 | $0.156 |
| 2K | 12.35 | $0.247 |
| 4K | 25.35 | $0.507 |
The price is the same for both Vidu Q4 Preview models and does not depend on the number of reference images or audio clips, or on generate_audio.
Example: an 8s 720p video costs 49.4 tokens (= $0.988).
Returns an img_uuid; poll GET /api/v1/jobs/detail (or use custom_callback_url) to get the generated video.
curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "viduq4_preview_reference",
"prompt": "The barista from @1 stands in front of the cafe in @2 and greets the camera",
"image_urls": [
"https://your-cdn.com/barista.jpg",
"https://your-cdn.com/cafe.jpg"
],
"ref_audios": [
"https://your-cdn.com/greeting.mp3"
],
"duration": 8,
"resolution": "720p",
"ratio": "9:16"
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "viduq4_preview_reference",
"prompt": "The barista from @1 stands in front of the cafe in @2 and greets the camera",
"image_urls": ["https://your-cdn.com/barista.jpg", "https://your-cdn.com/cafe.jpg"],
"ref_audios": ["https://your-cdn.com/greeting.mp3"],
"duration": 8,
"resolution": "720p",
"ratio": "9:16"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'viduq4_preview_reference',
prompt: 'The barista from @1 stands in front of the cafe in @2 and greets the camera',
image_urls: ['https://your-cdn.com/barista.jpg', 'https://your-cdn.com/cafe.jpg'],
ref_audios: ['https://your-cdn.com/greeting.mp3'],
duration: 8,
resolution: '720p',
ratio: '9:16'
})
};
fetch('https://api.goenhance.ai/api/v1/videos/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goenhance.ai/api/v1/videos/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'viduq4_preview_reference',
'prompt' => 'The barista from @1 stands in front of the cafe in @2 and greets the camera',
'image_urls' => [
'https://your-cdn.com/barista.jpg',
'https://your-cdn.com/cafe.jpg'
],
'ref_audios' => [
'https://your-cdn.com/greeting.mp3'
],
'duration' => 8,
'resolution' => '720p',
'ratio' => '9:16'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goenhance.ai/api/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"viduq4_preview_reference\",\n \"prompt\": \"The barista from @1 stands in front of the cafe in @2 and greets the camera\",\n \"image_urls\": [\n \"https://your-cdn.com/barista.jpg\",\n \"https://your-cdn.com/cafe.jpg\"\n ],\n \"ref_audios\": [\n \"https://your-cdn.com/greeting.mp3\"\n ],\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"ratio\": \"9:16\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goenhance.ai/api/v1/videos/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"viduq4_preview_reference\",\n \"prompt\": \"The barista from @1 stands in front of the cafe in @2 and greets the camera\",\n \"image_urls\": [\n \"https://your-cdn.com/barista.jpg\",\n \"https://your-cdn.com/cafe.jpg\"\n ],\n \"ref_audios\": [\n \"https://your-cdn.com/greeting.mp3\"\n ],\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"ratio\": \"9:16\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goenhance.ai/api/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"viduq4_preview_reference\",\n \"prompt\": \"The barista from @1 stands in front of the cafe in @2 and greets the camera\",\n \"image_urls\": [\n \"https://your-cdn.com/barista.jpg\",\n \"https://your-cdn.com/cafe.jpg\"\n ],\n \"ref_audios\": [\n \"https://your-cdn.com/greeting.mp3\"\n ],\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"ratio\": \"9:16\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "Success",
"data": {
"img_uuid": "c12b656c-747a-44fd-9c80-add79b0c52d5",
"cost": 30.88
}
}Headers
Body
Model name. Must be viduq4_preview_reference.
viduq4_preview_reference Text prompt describing the video (required). Refer to reference images as @1, @2, … in the order of image_urls.
Reference image URLs (required, 1-15 images). png / jpeg / jpg / webp, max 50MB each.
1 - 15 elementsOptional reference audio URLs (up to 3), e.g. a voice sample or a line of dialogue. Each clip must be an mp3 of 3-12 seconds.
3Video duration in seconds (3-16). Defaults to 5.
3 <= x <= 16Output resolution. Case-insensitive (2k and 2K are both accepted).
540p, 720p, 1080p, 2K, 4K Aspect ratio of the output video. aspect_ratio is accepted as a compatible alias.
16:9, 9:16, 1:1, 4:3, 3:4 Whether the output contains a native audio track (dialogue and sound effects). Defaults to true. Turning it off does not change the price.
Optional. A publicly accessible HTTPS URL. When the task status changes (processing / success / failed), GoEnhance sends a POST request to this URL. The request body is identical to the response of GET /api/v1/jobs/detail. If your server does not respond with HTTP 200, the notification is retried up to 3 times, with a 3-second timeout per attempt.
"https://your-server.com/goenhance/callback"
