API notes
With kirin_v4_flash_omni_video, combine prompts, images, reference videos, a base video, and existing subjects in contents, using @id to reference media.
Use the asynchronous task flow: create a task, save its top-level id, poll until completed, then download and store the video. Check model permissions and available balance before calling.
Authentication
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key.
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Create a task
Use POST https://cloud.vtrix.ai/model/v1/generation. Complete curl examples appear on the right; put model parameters in input[0].params.
Replace YOUR_API_KEY with your platform API Key. URLs under https://example.com/... are illustrative and must be replaced with accessible media; replace YOUR_ELEMENT_ID with a subject ID available to your current account.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | kirin_v4_flash_omni_video |
input | array | Yes | Input list; the examples use one object |
input[0].params | object | Yes | Model parameters listed below |
Model parameters
All fields below are inside input[0].params.
| Parameter | Type | Required | Description |
|---|---|---|---|
contents | array | Yes | Prompt and media items, described below |
settings | object | No | Output settings; omission uses model defaults |
settings.resolution | string | No | Only 720p; defaults to 720p |
settings.duration | integer | No | An integer from 3 to 20 seconds; see “Target duration” for omission behavior |
settings.aspect_ratio | string | No | 21:9, 16:9, 9:16, 1:1, 4:3, 3:4, adaptive; default adaptive |
settings.audio | string | No | native generates audio (default); original preserves audio from an input video |
options.external_task_id | string | No | Account-unique business ID; does not replace the system ID or guarantee idempotent creation |
options.watermark_info.enabled | boolean | No | Whether to also generate a watermarked result; defaults to false; custom watermarks are unsupported |
Content types
contents[].type | Purpose | Field requirements |
|---|---|---|
prompt | Prompt | Requires text |
first_frame | First-frame image | Requires url, accepting an image URL or Base64; optional id |
refer_image | Reference image | Requires url (URL or Base64); optional id |
feature_video | Feature reference video | Requires video url; optional id |
base_video | Base video to edit | Requires video url; optional id; at most one |
element | Existing subject | Requires element_id and id |
Media IDs must be unique within the request. Reference them as @image_1, @video_1, or @subject_1 in the prompt. Subjects must be available to the current platform account; subject creation and management are outside this page.
audio="original" requires an explicit base_video or feature_video. Base-video audio takes priority; otherwise, audio from the first feature video is retained. settings.audio is for Omni only.
With adaptive, the model determines the aspect ratio from the prompt and media. Flash Omni uses the six content types above; standalone voice, middle-frame, and last-frame inputs are unavailable.
Target duration
You may omit duration. If supplied, use a JSON integer such as 5, not "5", a fraction, or null.
The target duration follows this priority:
- Explicit
settings.duration. - An explicit duration recognized by the model in the prompt.
- The base-video duration rounded to integer seconds, if a
base_videois provided. - Otherwise, 10 seconds.
Omission does not always mean 10 seconds. Supply the field for a fixed target duration. Final billing uses terminal usage.output_duration, not the media-file duration.
Prompt and media requirements
Prompts allow up to 26,000 English characters or 11,000 non-English characters. Mixed text must satisfy: English characters / 26,000 + non-English characters / 11,000 ≤ 1.
Images support JPG, JPEG, and PNG, up to 30 MB each. Both dimensions must be at least 300 px, with an aspect ratio from 2:5 to 5:2. Supply an image URL or Base64.
Videos support MP4 and MOV, up to 300 MB each. Each dimension must be 700–4553 px, with a total pixel area no greater than 8,294,400, an aspect ratio from 2:5 to 5:2, and a frame rate of 24–60 fps. Supply videos by URL.
- Up to 10 images.
- Up to 5 reference videos, including at most one base video.
- Up to 7 subjects, including at most 3 video-character subjects; videos and video-character subjects combined must not exceed 5.
- Up to 15 images, videos, and subjects combined.
- Each input video and the combined input-video duration must be 3–20 seconds; the total includes video-character subjects.
Media URLs must be directly downloadable without login and remain valid throughout task processing.
Polling
Since result generation takes time, you need to poll the task status after creating the task.
The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.
See the examples on the right for polling requests and responses.
Use GET https://cloud.vtrix.ai/model/v1/generation/task/{task_id}, replacing {task_id} with the top-level id from creation. Keep task IDs as strings and query with an API Key for the same platform account.
| Status | Meaning | Action |
|---|---|---|
in_queue | Queued | Continue polling |
in_progress | Processing | Continue polling |
completed | Completed | Read output[].content[] |
failed | Failed | Read error |
Poll every 5–10 seconds and increase the interval during extended waits or rate limiting. Creation only acknowledges acceptance; HTTP 200 alone does not indicate generation success. Retain the task ID and keep querying the original task after a client-side timeout.
Response fields
| Field | Type | Description |
|---|---|---|
id | string | System task ID for subsequent queries |
created_at | integer | Creation time as a Unix timestamp in milliseconds |
status | string | Task status, listed above |
model | string | Public model ID |
progress | number | Optional progress; not proof of completion or payment |
output[].content[].type | string | video |
output[].content[].url | string | Video URL; preserve signed query parameters and store the result promptly |
output[].content[].duration | string or number | Actual media-file duration, which may include fractional seconds |
output[].content[].watermark_url | string | Optional watermarked video URL |
error | object | Read code and message on failure |
Usage and amounts
The following fields are under usage; use terminal results.
| Field | Type | Description |
|---|---|---|
duration | number | Actual media duration in seconds, for display |
output_duration | number | Output billable duration O, in seconds |
input_duration | number | Normalized total input-video billable duration I, including video-character subjects; 0 without video input |
quantity | number or null | Final billable seconds Q, not a video count; may be null until ready |
unit_price | string | The tier unit price determined for this task, in USD/second |
cost | string or null | Platform pricing amount in USD; not proof of the actual charge |
payable_amount | string or null | Ledger payable amount in USD; may be null or omitted |
charged_amount | string or null | Ledger charged amount in USD; may be null or omitted |
user_discount | number | Compatibility field; 0 does not mean free; do not use it to recalculate the final discount |
extra_info.Duration | number | Compatibility field for actual media duration, not output billable duration |
extra_info.InputDuration | number | Compatibility field for input-video billable duration |
input_tokens / output_tokens / total_tokens | number or null | This model is billed by seconds; null in the examples |
Optional fields may be absent. Null payable_amount or charged_amount does not mean free or uncharged; null quantity or cost must not be treated as zero. Query again later and check the platform ledger.
Failure response example
{
"id": "task_id",
"created_at": 1793836800000,
"status": "failed",
"model": "kirin_v4_flash_omni_video",
"error": {
"code": "example_error_code",
"message": "Example failure message"
}
}
Billing
Let O=usage.output_duration, I=usage.input_duration, and Q=usage.quantity:
Without video input: Q = O
With video input: Q = max(I, O) + O
Use the 720p tier without video input for the first case and the 720p tier with video input for the second. Preserve fractional input seconds. Video-character subjects can also contribute input-video usage.
For example, a media file can last 3.041 seconds while O=3, giving Q=3 without video input. With I=3.04 and O=3, Q=6.04. Do not substitute media duration for O or round I to whole seconds.
The success response on the right illustrates a video-input task with a 5-second output target. Creation examples represent independent tasks and do not share that response’s usage.
The response value unit_price=0.100000 and amounts only illustrate fields and arithmetic; they are not a quote. Prices and account discounts are governed by platform pricing and your account terms. Read charged_amount or the platform ledger for the actual charge.
Error handling
| Situation | Action |
|---|---|
| Authentication, permission, or balance error | Check the platform Key, model permissions, and available balance |
| Invalid parameters or media | Check 720p, the 3–20 second range, field types, and media access before resubmitting |
| Query rate limit or network error | Increase the interval and retry the original task’s GET query |
| Task failed | Read error.message and resolve the cause; generating again requires a new task |
| Creation POST timed out or disconnected | Do not blindly repeat creation; query the ID if available, otherwise retain the time and X-Request-Id and contact platform support |
For troubleshooting, provide the request time and time zone, model ID, task ID, and X-Request-Id. Do not share the full API Key.