Vidu Q4
Generate Vidu Q4 videos from a first frame or ordered image references, with optional reference audio, 3–16 second duration, and output up to 4K.
Vidu Q4 generates video from a single first frame or image references, with optional reference audio; check current pricing and availability before submitting.
Quick example
Replace the example image address with your own publicly accessible image URL.
curl https://reapi.ai/api/v1/videos/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "viduq4-preview",
"first_frame_image": "https://your-cdn.example/first-frame.png",
"prompt": "The cyclist rides forward as the camera follows slowly.",
"duration": 5,
"resolution": "720p",
"audio": true
}'import os
import requests
response = requests.post(
"https://reapi.ai/api/v1/videos/generations",
headers={"Authorization": f"Bearer {os.environ['REAPI_API_KEY']}"},
json={
"model": "viduq4-preview",
"first_frame_image": "https://your-cdn.example/first-frame.png",
"prompt": "The cyclist rides forward as the camera follows slowly.",
"duration": 5,
"resolution": "720p",
"audio": True,
},
timeout=60,
)
response.raise_for_status()
print(response.json())const response = await fetch("https://reapi.ai/api/v1/videos/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "viduq4-preview",
first_frame_image: "https://your-cdn.example/first-frame.png",
prompt: "The cyclist rides forward as the camera follows slowly.",
duration: 5,
resolution: "720p",
audio: true,
}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
func main() {
body, err := json.Marshal(map[string]any{
"model": "viduq4-preview",
"first_frame_image": "https://your-cdn.example/first-frame.png",
"prompt": "The cyclist rides forward as the camera follows slowly.",
"duration": 5,
"resolution": "720p",
"audio": true,
})
if err != nil { panic(err) }
req, err := http.NewRequest("POST",
"https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body))
if err != nil { panic(err) }
req.Header.Set("Authorization", "Bearer " + os.Getenv("REAPI_API_KEY"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 60 * time.Second}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
result, err := io.ReadAll(resp.Body)
if err != nil { panic(err) }
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
panic(fmt.Sprintf("HTTP %d: %s", resp.StatusCode, result))
}
fmt.Println(string(result))
}The submission returns an id. Poll GET /api/v1/tasks/{id} until the task is completed or failed; an accepted submission is not a completed video.
Endpoint
POST /api/v1/videos/generations
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/jsonUse the public model ID viduq4-preview. The page slug is vidu-q4; it is not the request's model ID. See authentication and task polling.
Parameters
The table describes the documented model contract. reAPI forwards model parameters and extensions for generation-time validation. Media inputs must use public HTTP(S) URLs; base64 and data: inputs are rejected. Billing also requires a known resolution rate and a positive integer duration before a task can be charged. Acceptance of an extension does not prove that it affected the output.
| Field | Type | Required / default | Documented behavior |
|---|---|---|---|
model | string | Required | viduq4-preview |
prompt | string | Required for reference video; optional for first-frame video | Up to 20,000 characters; describe motion and refer to reference images and audio by order. |
image_urls | string[] | One image source required | One unlabelled image without reference audio selects first-frame video. Two or more images select reference video. Combined with image_with_roles, reference mode supports 1–15 images. |
image_with_roles | object[] | Optional alternative or addition to image_urls | Each object uses url and optional role. Roles are first_frame, reference_image, or the alias reference, case-insensitive. Omitted or empty roles use image count and reference audio to choose the mode. |
first_frame_image | string | Optional alternative image source | A single first frame. Do not combine an explicit first frame with other images or reference audio. |
audio_urls | string[] | Optional | Reference audio for reference mode. Together with audio_url, at most 3 clips; MP3, 3–12 seconds each, up to 50 MB per clip. |
audio_url | string | Optional | Single reference-audio URL; counts toward the same combined limit. |
aspect_ratio | string | Reference mode defaults to 16:9 | 16:9, 9:16, 1:1, 4:3, or 3:4. First-frame video inherits the image ratio. |
size | string | Optional alias | Compatibility spelling for aspect_ratio. Supply one spelling rather than conflicting values. |
duration | integer | 5 | Documented generation range: 3–16 seconds. |
resolution | string | 720p | 540p, 720p, 1080p, 2K, or 4K; case-insensitive. |
audio | boolean | true | Generate an audio track; explicit false requests silent output. |
seed | integer | Optional | Forwarded when supplied. Omission or 0 requests randomness. A seed is not a guarantee of reproducibility across executions. |
Images should be PNG, JPEG, JPG, or WEBP and no larger than 50 MB each. Keep URLs accessible throughout generation. Audio format and duration issues can fail during processing after submission is accepted.
The separate reAPI output control bitrate_mode accepts default (preserve the generated file), standard, or high (output encoding presets). Omission uses default. Legacy false maps to default and true maps to standard. This is output processing, not a model-generation parameter.
Modes and examples
Animate a first frame
Use first_frame_image, one first_frame role, or one unlabelled image without reference audio. The prompt is optional; the image establishes the output aspect ratio.
{
"model": "viduq4-preview",
"first_frame_image": "https://your-cdn.example/first-frame.png",
"audio": false
}Guide a video with references
Use 1–15 reference images and a prompt. To select reference mode with just one image and no audio, label it reference_image. Reference images and audio keep their order within the supplied arrays.
{
"model": "viduq4-preview",
"prompt": "The person in reference image 1 speaks using reference audio 1, then turns toward the window.",
"image_with_roles": [
{
"url": "https://your-cdn.example/person.png",
"role": "reference_image"
}
],
"audio_urls": ["https://your-cdn.example/line.mp3"],
"aspect_ratio": "9:16",
"duration": 8,
"resolution": "1080p",
"audio": true
}Q4 does not document text-only generation or first/last-frame transitions. Two unlabelled images are references, not the start and end of a transition. An explicit first frame mixed with reference material is outside the documented contract. Additional fields are forwarded rather than treated as proof of an additional supported mode.
Pricing dimensions
The bill scales with output duration and resolution. Image-to-video and reference-to-video use the same resolution rate. Audio on/off uses the same rate, and reference image/audio inputs do not add a separate reference fee. See the Vidu Q4 pricing table for current rates.
Bill formula
credits = ceil(per_second_usd × duration_seconds × 1000)One credit equals $0.001 USD. Each task settles once; a failed task refunds its reserved generation credits. Polling a task does not create another generation. Repeating a submission creates another task even if the request body or Idempotency-Key is repeated.
Output schema
Example completed task:
{
"id": "task_example",
"model": "viduq4-preview",
"status": "completed",
"created_at": 1792627200,
"output": {
"video_urls": ["https://your-cdn.example/generated-video.mp4"]
},
"error": null
}Read URLs from output.video_urls only after status becomes completed. A failed task includes error.code and error.message. Download the result while its link is available; do not assume permanent storage.
Errors
Request errors use { "error": { "code", "message", "request_id" } }. The error catalog is authoritative for the complete list.
| Code | Meaning |
|---|---|
20003 | Invalid request shape or a media URL that violates the public HTTP(S) rule. |
20004 | The requested model is unavailable on this endpoint. |
30001 | Insufficient credits. |
30002 | The request cannot be priced, such as an unpriced resolution or unmeasurable duration. |
80001 | Submission failed. |
80002 | Task polling timed out. |
80003 | Generation failed. |
80006 | Content-policy rejection. |
80007 | A model parameter or combination was rejected during generation. |
Tips
- Use a first frame when its composition should determine the opening shot; use references when images describe subjects or a scene.
- Number subjects and audio references consistently in the prompt. Changing reference order changes what those numbers refer to.
- Start with a short draft to inspect motion and sound, then choose the duration and resolution required for delivery.
- Inspect the generated file when testing optional fields. An accepted request alone cannot confirm their visual or audio effect.
Related
- Vidu Q4 model page
- Vidu Q3 for text-only or first/last-frame workflows
- Task polling
- Error catalog