API Notes
kirin_v4_t2v generates videos using prompt and settings
kirin_v4_t2v 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 example output URL is a placeholder. Replace YOUR_API_KEY with your platform API Key before making requests
model string required
Model ID for the request
Value: kirin_v4_t2v
input array required
Input list. The examples use one input object
input[0].params object required
Video generation parameters, described below
prompt
stringrequiredDescribe the video, including desired content and negative instructions. See Prompt and media requirements for character limits
settings
objectOutput settings
duration
integerRequested output duration in seconds. Billing uses actual output duration, which may include fractional seconds
Default:
10Range:
3–30resolution
stringOutput resolution, also used to select the pricing tier
Default:
1080pOptions:
720p,1080paspect_ratio
stringOutput video aspect ratio
Default:
16:9Options:
21:9,16:9,9:16,1:1,4:3,3:4
options
objectCommon generation options
external_task_id
stringCustom business task ID, unique within the account. It does not replace the system
idfrom creation and does not guarantee idempotency. Always poll using the systemidwatermark_info
objectWatermarked output settings
enabled
booleanWhether to also generate watermarked results. Custom watermarks are not supported
Default:
false
Prompt and media requirements
Prompt limits apply to prompt:
- Up to
26,000characters for English-only prompts, or11,000characters for non-English-only prompts - Mixed prompts must satisfy: English character count /
26,000+ non-English character count /11,000≤1
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
| Status | Meaning | Client action |
|---|---|---|
in_queue | Queued | Keep polling |
in_progress | Processing | Keep polling |
completed | Generation succeeded | Read output[].content[] and stop polling for generation status |
failed | Generation failed | Read 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
| Field | Type | Description |
|---|---|---|
id | string | Platform task ID; use the same value for creation and queries |
created_at | integer | Creation time as a Unix timestamp in milliseconds |
status | string | Task status, listed above |
model | string | Public model ID used for this request |
progress | number | Optional progress value; not proof of completion or billing |
output | array | Output list after successful generation |
output[].content | array | Video resource list |
output[].content[].type | string | video for video results |
output[].content[].url | string | Video download URL; preserve all signed query parameters and download promptly |
output[].content[].duration | string or number | Actual output duration in seconds, including fractional seconds |
output[].content[].id | string | Optional output resource identifier; not used for task queries |
output[].content[].jobId | string | Optional output correlation identifier; continue querying tasks with the top-level id |
output[].content[].watermark_url | string | Optional watermarked download URL when watermarked output is enabled |
error | object | Failure details in code and message; may be absent or null on success |
usage | object | Usage and pricing information, listed below |
metadata | object | Optional task processing timing and other metadata |
metadata.completed_at | number | Elapsed time from task creation to completion in seconds, not a Unix timestamp |
metadata.in_queue_at / metadata.upload_at | number | Compatibility timing fields; may be 0 when not measured |
usage object
| Field | Type | Description |
|---|---|---|
duration | number | Actual output video duration in seconds, including fractional seconds |
input_duration | number | Total terminal input video duration in seconds; 0 without video input |
quantity | number or null | Total billable seconds calculated by the billing rules, not the number of videos; may be null while terminal pricing evidence is unavailable |
unit_price | string | Price frozen at creation for the resolution and video-input tier, in USD/second |
cost | string or null | Platform pricing amount in USD; not proof of an actual debit |
payable_amount | string or null | Amount payable read from the platform bill, in USD; may be absent |
charged_amount | string or null | Actual debit read from the platform bill, in USD; may be absent |
user_discount | number | Compatibility field; do not use it to recalculate the final discount; 0 does not mean free |
extra_info.Duration | number | Compatibility field for output duration, in seconds |
extra_info.InputDuration | number | Compatibility field for total input video duration, in seconds |
extra_info.final_unit_deduction | number or string | Optional resource-package point deduction, available only in points mode; not the platform customer’s actual debit |
input_tokens / output_tokens / total_tokens | number or null | This 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_t2v",
"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
| Situation | Action |
|---|---|
| Authentication, permission, or balance error | Check the platform Key, model permissions, and available account balance |
| Invalid parameters or media | Check field types, media limits, and URL accessibility before submitting corrected input |
| Temporary query failure, rate limit, or network error | Back off and retry the original task’s GET query |
Task status is failed | Read error.message and address the cause; a new generation requires a new task |
| Creation POST timeout or connection loss | Do 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