supports containing image_generation — see model discovery.
The example below uses FLUX.1-schnell.
Example
Request fields
| Field | Required | Notes |
|---|---|---|
model | Yes | Must have image_generation in supports. |
prompt | Yes | — |
n | No | Must be 1 (the default). Multiple images per request are not currently supported. |
size | No | One of 512x512, 768x768, 1024x1024, 1024x1792, 1792x1024. Default 1024x1024. |
response_format | No | b64_json only. OpenAI’s url format is not supported — the field is accepted for SDK compatibility but anything other than b64_json is a 400. |
Response
b64_json with your language’s base64 helper and write the bytes as a .png.
Billing
Image models bill per output image, not per token — see thepricing[] rows on the model entry in GET /api/models, or the billing reference.