⌘K

Kirin V2 Image

kirin_v2_image

Kirin V2 image generation interface, supports text-to-image and optional reference image generation.

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

The model ID used for the request.

Value: kirin_v2_image


prompt string required

Text prompt that describes the image to generate.

Maximum length: 2500 characters.


image string

Reference image. Provide this field when you want to generate an image based on an input image. Omit it for text-to-image generation.

Supports an accessible image URL or a Base64-encoded image string.

Image requirements: Image formats: .jpg, .jpeg, .png. Image size must not exceed 10MB. Image width and height must be at least 300px. Aspect ratio must be within 1:2.5 to 2.5:1.

Base64 requirements: If you use Base64, pass only the raw Base64 string. Do not include a prefix such as data:image/png;base64,.


negative_prompt string

Negative text prompt.

Maximum length: 2500 characters.

For image-to-image requests where image is provided, negative prompts may not be supported.


n integer

Number of images to generate.

Default: 1

Range: 1 - 9


aspect_ratio string

Output image aspect ratio.

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

Default: 16:9


callback_url string

Callback URL for task status changes. If provided, the server sends task updates to this URL.


external_task_id string

Custom task ID. It does not replace the system task ID, but can be used for task lookup.

Keep this value unique for each user.


Polling

Image generation is asynchronous. After creating a task, poll the task status endpoint to get the final result.

The create response returns the task ID and initial status. The generated image URL is returned by the polling endpoint after the task is completed.

Response

error object

Error information. Returned only when the task status is failed.

code string

Error code.

error_message string

Error message.


output array

Generated result. Returned only when the task status is completed.

content array

Generated content list.

type string

Resource type, such as image.

url string

Generated image URL.

jobId string

Remote task ID.


usage object

Usage statistics. Returned only when the task status is completed.