Theme
Create Image
POST
https://www.kkiai.com/v1/images/generations
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 | The model used to generate images. |
prompt | string | Required | A text description of the desired image. Maximum length is 1000 characters. |
size | string | Optional | The size of the generated image: 960x960, 720x1280, 1280x720, 1168x784, 784x1168 |
Request Example
json
{
"model": "grok-3-image",
"prompt": "a cat",
"size": "960x960"
}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": "grok-3-image",
"prompt": "a cat",
"size": "960x960"
}'Response
🟢 200 Success
Response Example
json
{
"created": 1773127037,
"data": [
{
"url": "https://pub-85624410c6c44bdb802187ae2bd8afff.r2.dev/grok/8903fc79-152b-4b80-b384-d74ae6775b07.jpg"
}
],
"usage": {
"generated_images": 1,
"output_tokens": 16384,
"total_tokens": 16384
}
}