Skip to content

Flux Creation (OpenAI dall-e-3 Format)

POST https://www.kkiai.com/v1/images/generations

Images

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

ParameterTypeRequiredDescriptionExample
AuthorizationstringOptionalBearer {{YOUR_API_KEY}}

Body Parameters (application/json)

ParameterTypeRequiredDescription
promptstringRequiredA text description of the desired image. Maximum length is 1000 characters.
modelstringOptionalThe model to use for image generation.
nintegerOptionalThe number of images to generate. Must be between 1 and 10.
qualitystringOptionalThe quality of the generated images. hd creates images with finer details and higher consistency. This parameter is only supported for dall-e-3.
response_formatstringOptionalThe format in which the generated images are returned. Must be one of url or b64_json.
stylestringOptional
userstringOptionalThe 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.
sizestringOptionalThe size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.
aspect_ratiostringRequiredImage 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

ParameterTypeRequiredDescription
createdintegerRequired
dataarray[object]Required
  └ urlstringRequired

Response Example

json
{
    "created": 1589478378,
    "data": [
        {
            "url": "https://..."
        },
        {
            "url": "https://..."
        }
    ]
}