Images API
Generate one image using the exact size and quality supported by the selected published image model.
POST /v1/images/generations
AuthorizationBearer $CHUA_API_KEYContent-Typeapplication/jsonfor request bodiesIdempotency-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.
size1024x1024,2048x2048, orauto; must match the model specification.qualityloworstandard; 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.