curl --request POST \
--url https://api.goenhance.ai/api/v1/videos/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "viduq4_preview",
"prompt": "Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly",
"image_url": "https://your-cdn.com/first-frame.jpg",
"duration": 8,
"resolution": "720p",
"generate_audio": true
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "viduq4_preview",
"prompt": "Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly",
"image_url": "https://your-cdn.com/first-frame.jpg",
"duration": 8,
"resolution": "720p",
"generate_audio": True
}
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',
prompt: 'Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly',
image_url: 'https://your-cdn.com/first-frame.jpg',
duration: 8,
resolution: '720p',
generate_audio: true
})
};
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',
'prompt' => 'Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly',
'image_url' => 'https://your-cdn.com/first-frame.jpg',
'duration' => 8,
'resolution' => '720p',
'generate_audio' => true
]),
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\",\n \"prompt\": \"Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly\",\n \"image_url\": \"https://your-cdn.com/first-frame.jpg\",\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"generate_audio\": true\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\",\n \"prompt\": \"Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly\",\n \"image_url\": \"https://your-cdn.com/first-frame.jpg\",\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"generate_audio\": true\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\",\n \"prompt\": \"Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly\",\n \"image_url\": \"https://your-cdn.com/first-frame.jpg\",\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"generate_audio\": true\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 (Image to Video)
Vidu Q4 Preview image-to-video — Vidu’s newest model, with a native audio track (dialogue and sound effects) and output up to 4K. image_url is required and is used as the first frame; the output follows its aspect ratio.
This model is image-to-video only: there is no text-to-video or start-end frame mode, so requests without image_url, or with image_end_url, are rejected. For reference-image generation use viduq4_preview_reference — passing image_urls 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 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",
"prompt": "Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly",
"image_url": "https://your-cdn.com/first-frame.jpg",
"duration": 8,
"resolution": "720p",
"generate_audio": true
}
'import requests
url = "https://api.goenhance.ai/api/v1/videos/generations"
payload = {
"model": "viduq4_preview",
"prompt": "Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly",
"image_url": "https://your-cdn.com/first-frame.jpg",
"duration": 8,
"resolution": "720p",
"generate_audio": True
}
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',
prompt: 'Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly',
image_url: 'https://your-cdn.com/first-frame.jpg',
duration: 8,
resolution: '720p',
generate_audio: true
})
};
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',
'prompt' => 'Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly',
'image_url' => 'https://your-cdn.com/first-frame.jpg',
'duration' => 8,
'resolution' => '720p',
'generate_audio' => true
]),
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\",\n \"prompt\": \"Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly\",\n \"image_url\": \"https://your-cdn.com/first-frame.jpg\",\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"generate_audio\": true\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\",\n \"prompt\": \"Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly\",\n \"image_url\": \"https://your-cdn.com/first-frame.jpg\",\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"generate_audio\": true\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\",\n \"prompt\": \"Rain keeps falling, steam rises from the ramen shop, the neon sign flickers softly\",\n \"image_url\": \"https://your-cdn.com/first-frame.jpg\",\n \"duration\": 8,\n \"resolution\": \"720p\",\n \"generate_audio\": true\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.
viduq4_preview First-frame image URL (required). png / jpeg / jpg / webp, max 50MB. The output video follows the image's aspect ratio.
Optional text prompt describing the motion and sound of the video.
Video 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 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"
