Skip to main content
Image generation is synchronous and OpenAI-shaped: send a prompt, get back base64-encoded PNGs in the response body. Find image-capable models by their category of image — see model discovery. The example below uses FLUX.1-schnell.

Example

Request fields

Response

Decode 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. Read the active rate from GET /v1/pricing — find the row for your model, where pricing_type is per_image, and take unit_price_usd (rates can vary by resolution tier). The billing reference explains how that becomes a charge.