Theme
Flux Creation (OpenAI dall-e-3 Format)
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 | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | A text description of the desired image. Maximum length is 1000 characters. |
model | string | Optional | The model to use for image generation. |
n | integer | Optional | The number of images to generate. Must be between 1 and 10. |
quality | string | Optional | The quality of the generated images. hd creates images with finer details and higher consistency. This parameter is only supported for dall-e-3. |
response_format | string | Optional | The format in which the generated images are returned. Must be one of url or b64_json. |
style | string | Optional | |
user | string | Optional | The style of the generated images. Must be one of natural or vivid. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to generate more natural, less hyper-real images. This parameter is only supported for dall-e-3. |
size | string | Optional | The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024. |
aspect_ratio | string | Required | Image aspect ratio: Possible enum values: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21 |
Request Example
json
{
"model": "flux-kontext-pro",
"prompt": "a beautiful landscape with a river and mountains",
// "size": "1024x1524",
"n": 1,
"aspect_ratio": "21:9"
}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": "flux-kontext-pro",
"prompt": "a beautiful landscape with a river and mountains",
// "size": "1024x1524",
"n": 1,
"aspect_ratio": "21:9"
}'Response
🟢 200 Create image
Response Body
| Parameter | Type | Required | Description |
|---|---|---|---|
created | integer | Required | |
data | array[object] | Required | |
└ url | string | Required |
Response Example
json
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}