⌘K

Kirin V4 - Image to Video

kirin_v4_i2v

Kirin V4 generates videos from first, middle, and last frame images, with 720p or 1080p resolution and 3–30 second output

API Notes

kirin_v4_i2v accepts first, middle, and last frame images in contents, referenced using @id

kirin_v4_i2v 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_i2v


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

typePurposeItem requirements
promptPromptRequires text
first_frameFirst-frame imageRequires url; optional id
middle_frameMiddle-frame imageRequires url; optional id
last_frameLast-frame imageRequires url; optional id

Include image media, up to 10 images. The prompt item may be omitted. Give each image a distinct id and describe transitions in the prompt

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

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

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_i2v",
  "error": {
    "code": "example_error_code",
    "message": "Example failure message"
  }
}

Billing

Select the no-video-input price tier by output resolution. Pricing uses actual output seconds and prices frozen at creation. Consult platform pricing and account bills for current prices and account discounts

Billable quantity equals actual output duration. For example, a requested duration of 5 seconds may produce 5.041 seconds of output, giving quantity=5.041. Retain fractional seconds for billing

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