Theme
Create Image
POST
https://www.kkiai.com/v1/images/generations
Given a prompt and/or input image, the model will generate new images.
Related guide: Image Generation
Create images based on a prompt.
Request Parameters
Header Parameters
| Parameter Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | Supported: Text-to-Image doubao-seedream-3-0-t2i-250415 Supported: Image Editing doubao-seededit-3-0-i2i-250628 Supported: Text-to-Image, Image-to-Image doubao-seedream-5-0-260128 doubao-seedream-4-5-251128 doubao-seedream-4-0-250828 |
prompt | string | Required | Prompt text used to generate the image. |
image | Optional | Input image information, supporting URL or Base64 encoding. * Image URL: Ensure the image URL is accessible. * Base64 encoding: Please follow this format data:image/<image_format>;base64,<Base64_encoding>. Note that <image_format> must be lowercase, such as data:image/png;base64,<base64_image>. | |
size | Optional | ||
seed | integer | Optional | Only supported by doubao-seedream-3.0-t2i/seededit-3.0-i2i. Random seed used to control the randomness of model-generated content. Value range: [-1, 2147483647]. Note: Under the same request, if the model receives different seed values, such as: not specifying a seed value or setting seed to -1 (which uses a random number instead), or manually changing the seed value, different results will be generated. Under the same request, if the model receives the same seed value, similar results will be generated, but complete consistency is not guaranteed. |
sequential_image_generation | string | Optional | Only supported by doubao-seedream-5.0-lite/4.5/4.0. Controls whether to disable the image series feature; based on your input content, generates a set of related images. auto: Auto mode, the model automatically determines whether to return image series and the number of images included. disabled: Disable image series feature, the model will only generate one image. Default value disabled |
sequential_image_generation_options | object | Optional | Only supported by doubao-seedream-5.0-lite/4.5/4.0. Configuration for the image series feature. Only takes effect when sequential_image_generation is set to auto. |
└ max_images | integer | Optional | Specifies the maximum number of images that can be generated in this request. Value range: [1, 15]. Default value 15 |
guidance_scale | number | Optional | The degree of consistency between model output and prompt, the degree of freedom in generating images, also known as text weight; the larger the value, the smaller the model's freedom, and the stronger the relevance to the user's input prompt. Value range: [1, 10]. doubao-seedream-3.0-t2i default value 2.5 doubao-seededit-3.0-i2i default value 5.5 doubao-seedream-5.0-lite/4.5/4.0 not supported |
output_format | string | Optional | Only supported by doubao-seedream-5.0. Specifies the file format of the generated image. Optional values: png jpeg Default value jpeg |
response_format | string | Optional | Specifies the return format of the generated image. Supports the following two return methods: url: Returns image download link; the link is valid for 24 hours after image generation, please download the image in time. b64_json: Returns image data in JSON format as a Base64 encoded string. Default value url |
watermark | boolean | Optional | Whether to add a watermark to the generated image. false: Do not add watermark. true: Add a watermark with "AI Generated" text in the bottom right corner of the image. Default value true |
Request Example
json
{
"model": "doubao-seedream-5-0-260128",
"prompt": "充满活力的特写编辑肖像,模特眼神犀利,头戴雕塑感帽子,色彩拼接丰富,眼部焦点锐利,景深较浅,具有Vogue杂志封面的美学风格,采用中画幅拍摄,工作室灯光效果强烈。",
"size": "2K",
"output_format": "png",
"response_format": "url",
"watermark": false
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/v1/images/generations' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "doubao-seedream-5-0-260128",
"prompt": "充满活力的特写编辑肖像,模特眼神犀利,头戴雕塑感帽子,色彩拼接丰富,眼部焦点锐利,景深较浅,具有Vogue杂志封面的美学风格,采用中画幅拍摄,工作室灯光效果强烈。",
"size": "2K",
"output_format": "png",
"response_format": "url",
"watermark": false
}'Response
🟢200 Create image
Response Body
| Parameter Name | Type | Required | Description |
|---|---|---|---|
created | integer | Required | |
data | array[object] | Required | |
└ url | string | Required |
Response Example
json
{
"created": 1749819664,
"data": [
{
"content_filter_results": {
"hate": {
"filtered": false,
"severity": "safe"
},
"self_harm": {
"filtered": false,
"severity": "safe"
},
"sexual": {
"filtered": false,
"severity": "safe"
},
"violence": {
"filtered": false,
"severity": "safe"
}
},
"prompt_filter_results": {
"hate": {
"filtered": false,
"severity": "safe"
},
"profanity": {
"detected": false,
"filtered": false
},
"self_harm": {
"filtered": false,
"severity": "safe"
},
"sexual": {
"filtered": false,
"severity": "safe"
},
"violence": {
"filtered": false,
"severity": "safe"
}
},
"revised_prompt": "A young, adorable sea otter floating in the ocean",
"url": "https://dalleproduse.blob.core.windows.net/private/images/6b0ee3bd-fe24-46c7-8ab8-85be87b00eaf/generated_00.png?se=2025-06-14T13%3A01%3A13Z&sig=9pLM1cLo1Af6FKRZc2AZSVxfSQBBBIyzfg0cOiT7C%2B0%3D&ske=2025-06-13T23%3A43%3A31Z&skoid=09ba021e-c417-441c-b203-c81e5dcd7b7f&sks=b&skt=2025-06-06T23%3A43%3A31Z&sktid=33e01921-4d64-4f8c-a055-5bdaffd5e33d&skv=2020-10-02&sp=r&spr=https&sr=b&sv=2020-10-02"
}
]
}