⌘K

Kirin V4 Omni Video

kirin_v4_omni_video

Kirin V4 Omni Video generates or edits videos using text, images, videos, subjects, and voice references through the unified asynchronous task API

API Notes

kirin_v4_omni_video accepts image references, video references, videos to edit, subjects, and voices in contents, referenced using @id

kirin_v4_omni_video uses asynchronous tasks; save the returned id and query results using the same platform account

Authentication

authorization string required

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

Parameters

Create tasks with POST https://cloud.vtrix.ai/model/v1/generation. Put model parameters in input[0].params

The https://example.com/... media URLs are placeholders. Replace them with real URLs accessible to the generation service, and replace any resource ID placeholders

model string required

Model ID for the request

Value: kirin_v4_omni_video


input array required

Input list. The examples use one input object


input[0].params object required

Video generation parameters, described below

contents array required

List of prompt and media items. Every item requires type

type string required

Item type, listed below

text string conditionally required

Required for type=prompt. Reference a media item’s id in the prompt using forms such as @image_1

url string conditionally required

Required for image or video items. Images accept URLs or Base64; videos use URLs

id string

Reference identifier within this task. IDs must be unique within the task and correspond to @id references in the prompt

element_id string conditionally required

Required for type=element. ID of an existing subject resource accessible to the account

voice_id string conditionally required

Required for type=voice. ID of an existing voice resource accessible to the account

Prepare subject and voice resources before using them; this endpoint references existing resources

typePurposeItem requirements
promptPromptRequires text
first_frameFirst-frame imageRequires url; optional id
middle_frameMiddle-frame imageRequires url; requires id for multiple middle frames
last_frameLast-frame imageRequires url; optional id
refer_imageAppearance, scene, or style referenceRequires url; requires id for multiple reference images
feature_videoFeature reference videoRequires url; optional id
base_videoVideo to editRequires url; optional id; at most 1
elementSubject referenceRequires element_id and id
voiceVoice referenceRequires voice_id and id

Include a prompt item. The request-local reference id is distinct from the existing resource IDs element_id and voice_id

Media count and combination limits:

  • Up to 10 images; up to 15 images, videos, subjects, and voices combined, excluding prompt items
  • Up to 5 videos, including at most 1 base_video; when video-character subjects are used, videos and video-character subjects together are limited to 5
  • Up to 7 subjects, including at most 3 video-character subjects; up to 3 voices
  • Total video input duration is 3–30 seconds, including feature references, videos to edit, and video-character subjects

settings object

Output settings

duration integer

Requested output duration in seconds. Billing uses actual output duration, which may include fractional seconds

Default: 10

Range: 3–30

resolution string

Output resolution, also used to select the pricing tier

Default: 1080p

Options: 720p, 1080p

aspect_ratio string

Output video aspect ratio; adaptive adapts to the input

Default: adaptive

Options: 21:9, 16:9, 9:16, 1:1, 4:3, 3:4, adaptive

options object

Common generation options

external_task_id string

Custom business task ID, unique within the account. It does not replace the system id from creation and does not guarantee idempotency. Always poll using the system id

watermark_info object

Watermarked output settings

enabled boolean

Whether to also generate watermarked results. Custom watermarks are not supported

Default: false

Prompt and media requirements

Prompt limits apply to prompt or contents[].text:

  • Up to 26,000 characters for English-only prompts, or 11,000 characters for non-English-only prompts
  • Mixed prompts must satisfy: English character count / 26,000 + non-English character count / 11,000 ≤ 1

Images support JPG, JPEG, and PNG, up to 30 MB each. Width and height must both be at least 300 px, with an aspect ratio between 2:5 and 5:2. Use an image URL or Base64

Videos support MP4 and MOV, up to 300 MB and 3–30 seconds each. Width and height must both be 700–4553 px, with a total pixel area no greater than 8,294,400, an aspect ratio between 2:5 and 5:2, and a frame rate of 24–60 fps. Provide videos using URLs

Media URLs must be directly accessible to the generation service 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 creation response id. Use an API Key from the same platform account

StatusMeaningClient action
in_queueQueuedKeep polling
in_progressProcessingKeep polling
completedGeneration succeededRead output[].content[] and stop polling for generation status
failedGeneration failedRead error and stop polling

Poll every 5 seconds initially, then increase the interval for longer waits. If the client times out, retain the task ID and query the original task instead of creating a duplicate

Response format

The creation response id is the system task ID used for subsequent queries. An initial status means the task was accepted, not that video generation has completed

FieldTypeDescription
idstringPlatform task ID; use the same value for creation and queries
created_atintegerCreation time as a Unix timestamp in milliseconds
statusstringTask status, listed above
modelstringPublic model ID used for this request
progressnumberOptional progress value; not proof of completion or billing
outputarrayOutput list after successful generation
output[].contentarrayVideo resource list
output[].content[].typestringvideo for video results
output[].content[].urlstringVideo download URL; preserve all signed query parameters and download promptly
output[].content[].durationstring or numberActual output duration in seconds, including fractional seconds
output[].content[].idstringOptional output resource identifier; not used for task queries
output[].content[].jobIdstringOptional output correlation identifier; continue querying tasks with the top-level id
output[].content[].watermark_urlstringOptional watermarked download URL when watermarked output is enabled
errorobjectFailure details in code and message; may be absent or null on success
usageobjectUsage and pricing information, listed below
metadataobjectOptional task processing timing and other metadata
metadata.completed_atnumberElapsed time from task creation to completion in seconds, not a Unix timestamp
metadata.in_queue_at / metadata.upload_atnumberCompatibility timing fields; may be 0 when not measured

usage object

FieldTypeDescription
durationnumberActual output video duration in seconds, including fractional seconds
input_durationnumberTotal terminal input video duration in seconds; 0 without video input
quantitynumber or nullTotal billable seconds calculated by the billing rules, not the number of videos; may be null while terminal pricing evidence is unavailable
unit_pricestringPrice frozen at creation for the resolution and video-input tier, in USD/second
coststring or nullPlatform pricing amount in USD; not proof of an actual debit
payable_amountstring or nullAmount payable read from the platform bill, in USD; may be absent
charged_amountstring or nullActual debit read from the platform bill, in USD; may be absent
user_discountnumberCompatibility field; do not use it to recalculate the final discount; 0 does not mean free
extra_info.DurationnumberCompatibility field for output duration, in seconds
extra_info.InputDurationnumberCompatibility field for total input video duration, in seconds
extra_info.final_unit_deductionnumber or stringOptional resource-package point deduction, available only in points mode; not the platform customer’s actual debit
input_tokens / output_tokens / total_tokensnumber or nullThis model is billed per second; null in the example

payable_amount and charged_amount depend on account type and bill availability. They may be null while billing evidence is unavailable; this does not mean free or uncharged. Query again later and reconcile with platform bills. Do not treat a null quantity or cost as zero

Failed task example

{
  "id": "task_id",
  "created_at": 1792800000000,
  "status": "failed",
  "model": "kirin_v4_omni_video",
  "error": {
    "code": "example_error_code",
    "message": "Example failure message"
  }
}

Billing

The price tier depends on output resolution and whether video input is present. Pricing uses actual billable seconds and prices frozen at creation. Consult platform pricing and account bills for current prices and account discounts

Let O be actual output duration and I be total input video duration:

ScenarioBillable quantity
No video inputO
Video input with I > OI + O
Video input with I ≤ O2 × O

Input duration includes reference videos and video-character subjects, based on terminal usage. Image input does not count as video duration. Actual output may be 5.041 seconds; retain fractional seconds instead of treating the requested 5 seconds as the final quantity

For example: no video input and 5.041 seconds of output gives quantity=5.041; 8 seconds of input and 5.041 seconds of output gives quantity=13.041; 3 seconds of input and 5.041 seconds of output gives quantity=10.082

The success example’s unit_price=0.100000 and amounts illustrate fields and arithmetic only; they are not a model quote. Read charged_amount or platform bills for the actual debit; do not recalculate it using user_discount

Error handling

SituationAction
Authentication, permission, or balance errorCheck the platform Key, model permissions, and available account balance
Invalid parameters or mediaCheck field types, media limits, and URL accessibility before submitting corrected input
Temporary query failure, rate limit, or network errorBack off and retry the original task’s GET query
Task status is failedRead error.message and address the cause; a new generation requires a new task
Creation POST timeout or connection lossDo not automatically create a duplicate; query the existing task ID, or retain the request time and X-Request-Id and contact support if no task ID was received

For troubleshooting, provide the request time, model ID, task ID, and X-Request-Id. Do not disclose the full API Key