API notes
kirin_v4_flash_t2v generates videos by describing scenes, actions, and camera movement in prompt.
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.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | kirin_v4_flash_t2v |
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 |
|---|---|---|---|
prompt | string | Yes | Text prompt, including positive and negative descriptions |
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; default 16:9 |
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 |
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.
- 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.
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_t2v",
"error": {
"code": "example_error_code",
"message": "Example failure message"
}
}
Billing
This model has no video input and uses the 720p tier without video input. Billable quantity Q equals output billable duration O:
O = usage.output_duration
Q = usage.quantity = O
For example, a media file can last 3.041 seconds while O=3, giving Q=3. Do not substitute media duration for O. See the Omni page for video-input billing.
In the success response on the right, the media lasts 5.041 seconds, while the output billable duration and billable quantity are both 5 seconds.
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.