⌘K

Kirin V4 Flash Omni Video

kirin_v4_flash_omni_video

Kirin V4 Flash supports 720p video output with a 3–20 second target duration through the unified asynchronous generation API

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.

ParameterTypeRequiredDescription
modelstringYeskirin_v4_flash_omni_video
inputarrayYesInput list; the examples use one object
input[0].paramsobjectYesModel parameters listed below

Model parameters

All fields below are inside input[0].params.

ParameterTypeRequiredDescription
contentsarrayYesPrompt and media items, described below
settingsobjectNoOutput settings; omission uses model defaults
settings.resolutionstringNoOnly 720p; defaults to 720p
settings.durationintegerNoAn integer from 3 to 20 seconds; see “Target duration” for omission behavior
settings.aspect_ratiostringNo21:9, 16:9, 9:16, 1:1, 4:3, 3:4, adaptive; default adaptive
settings.audiostringNonative generates audio (default); original preserves audio from an input video
options.external_task_idstringNoAccount-unique business ID; does not replace the system ID or guarantee idempotent creation
options.watermark_info.enabledbooleanNoWhether to also generate a watermarked result; defaults to false; custom watermarks are unsupported

Content types

contents[].typePurposeField requirements
promptPromptRequires text
first_frameFirst-frame imageRequires url, accepting an image URL or Base64; optional id
refer_imageReference imageRequires url (URL or Base64); optional id
feature_videoFeature reference videoRequires video url; optional id
base_videoBase video to editRequires video url; optional id; at most one
elementExisting subjectRequires 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:

  1. Explicit settings.duration.
  2. An explicit duration recognized by the model in the prompt.
  3. The base-video duration rounded to integer seconds, if a base_video is provided.
  4. 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.

StatusMeaningAction
in_queueQueuedContinue polling
in_progressProcessingContinue polling
completedCompletedRead output[].content[]
failedFailedRead 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

FieldTypeDescription
idstringSystem task ID for subsequent queries
created_atintegerCreation time as a Unix timestamp in milliseconds
statusstringTask status, listed above
modelstringPublic model ID
progressnumberOptional progress; not proof of completion or payment
output[].content[].typestringvideo
output[].content[].urlstringVideo URL; preserve signed query parameters and store the result promptly
output[].content[].durationstring or numberActual media-file duration, which may include fractional seconds
output[].content[].watermark_urlstringOptional watermarked video URL
errorobjectRead code and message on failure

Usage and amounts

The following fields are under usage; use terminal results.

FieldTypeDescription
durationnumberActual media duration in seconds, for display
output_durationnumberOutput billable duration O, in seconds
input_durationnumberNormalized total input-video billable duration I, including video-character subjects; 0 without video input
quantitynumber or nullFinal billable seconds Q, not a video count; may be null until ready
unit_pricestringThe tier unit price determined for this task, in USD/second
coststring or nullPlatform pricing amount in USD; not proof of the actual charge
payable_amountstring or nullLedger payable amount in USD; may be null or omitted
charged_amountstring or nullLedger charged amount in USD; may be null or omitted
user_discountnumberCompatibility field; 0 does not mean free; do not use it to recalculate the final discount
extra_info.DurationnumberCompatibility field for actual media duration, not output billable duration
extra_info.InputDurationnumberCompatibility field for input-video billable duration
input_tokens / output_tokens / total_tokensnumber or nullThis 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

SituationAction
Authentication, permission, or balance errorCheck the platform Key, model permissions, and available balance
Invalid parameters or mediaCheck 720p, the 3–20 second range, field types, and media access before resubmitting
Query rate limit or network errorIncrease the interval and retry the original task’s GET query
Task failedRead error.message and resolve the cause; generating again requires a new task
Creation POST timed out or disconnectedDo 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.