Skip to content

Images API

Generate one image using the exact size and quality supported by the selected published image model.

POST /v1/images/generations

Authorization
Bearer $CHUA_API_KEY
Content-Type
application/json for request bodies
Idempotency-Key
1–160 characters from A-Z a-z 0-9 . _ : -; required for generation requests.
X-CHUA-Request-ID
Save this response header as the request receipt when returned.
{"model":"YOUR_IMAGE_MODEL","prompt":"A blue ceramic cup on white","n":1}

Request fields

model
Required published image model.
prompt
Required, 1–800 trimmed characters.
n
Only 1; default 1.
size
1024x1024, 2048x2048, or auto; must match the model specification.
quality
low or standard; must match the model specification.

Response

A successful response contains exactly one Base64 image in data[0].b64_json, its size, and confirmed usage. Keep X-CHUA-Request-ID.