Images
Generate one or more images from a text prompt. Synchronous — the result returns in the same response.
POST/v1/images/generations
Request body#
| Field | Type | Description |
|---|---|---|
modelrequired | string | An image model id (e.g. gpt-image-1). |
promptrequired | string | What to generate. |
n | integer | Number of images, 1–10. Default 1. |
size | string | Pixel size, e.g. "1024x1024". Default 1024x1024. |
quality | string | Quality tier (model-dependent), e.g. standard / hd. |
response_format | string | url (default) or b64_json. |
Example#
bash
curl https://api.studio.whalli.com/v1/images/generations \
-H "Authorization: Bearer $WHALLI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-1",
"prompt": "A watercolor whale gliding over a city",
"size": "1024x1024"
}'Response#
json
{
"created": 1782000000,
"data": [
{ "url": "https://.../image.png" }
]
}Set
response_format: "b64_json" to receive base64 bytes inline instead of a URL — useful when you want to store the image yourself without a second request.