API Notes
kirin_v4_long_image returns one complete long image per successful task. Omit n, series_amount, and result_type from settings.
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
model string required
Value: kirin_v4_long_image
input array required
Send one object containing params to POST https://cloud.vtrix.ai/model/v1/generation. The fields below belong to input[0].params.
contents array required
Include a prompt item with nonempty text. Choose reference images according to settings.skill. Use a unique material id within the task for each reference, then refer to it in the prompt with @id.
Item type | Fields | Requirements |
|---|---|---|
prompt | text (string) | Required for both skills |
style_refer_image | url (string), id (string) | Optional, up to one for webpage. Guides the visual style and layout |
subject_refer_image | url (string), id (string) | Optional, up to one for webpage. Guides the design around the pictured subject |
refer_image | url (string), id (string) | Provide 1 to 3 product reference images for ecommerce |
For reference images, use an accessible URL or Base64-encoded image data in url. Each image must be JPEG or PNG, no larger than 30 MB, at least 300 px on both sides, and have a width-to-height ratio from 2:5 to 5:2.
English-only prompts have a limit of 166,000 characters. Non-English-only prompts have a limit of 71,000 characters. For mixed prompts, divide each character count by its respective limit. The sum must be at most 1.
settings object required
| Field | Options | Default |
|---|---|---|
skill (string, required) | webpage for web design, ecommerce for product detail pages | Supply a value |
resolution (string) | 1k, 2k | 1k |
length (string) | For ecommerce only. short has about 2 to 5 sections, medium about 6 to 10, and long about 11 to 18 | medium for ecommerce |
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.
Poll GET https://cloud.vtrix.ai/model/v1/generation/task/{task_id} with the platform API key used to submit the request. Replace {task_id} with the id from the creation response.
| Status in the query response | What to do |
|---|---|
in_progress | Continue polling |
completed | Read the image URLs from output[].content[].url |
failed | Read error for details |
Response format
In the creation response, status: "completed" means the submission was accepted. Check the query response for the generation status. All responses shown are examples.
| Field | Description |
|---|---|
id | Platform task ID |
created_at | Unix timestamp in milliseconds |
model | Requested model ID |
request_id | Request identifier returned on submission |
output[].content[].type | image for generated images |
output[].content[].url | Generated image URL |
A query can return generated images while billing is pending. During that time, usage.cost and usage.quantity may be null.