Image Generation
HyperFlowSI generates images through the OpenAI Images API: POST /v1/images/generations to create images from a prompt, and POST /v1/images/edits to change an image you send.
Find an image model
- On the Models page, pick the Image type. Each model’s page lists its price.
- From the API,
GET /v1/modelslists the models your key can call; image models have"mode": "image".
Generate an image
The samples use the OpenAI SDK set up as in the Quickstart.
The samples use google/gemini-2.5-flash-image; any model with "mode": "image" works the same way. size and quality are listed under Options; send them only if the model offers them.
Edit an image
POST /v1/images/edits takes one or more images and a prompt describing the change. Add a mask (a PNG the same size as the image) whose transparent areas mark where to edit. It’s sent as a form upload, like OpenAI’s.
Options
Any other field is removed before the request reaches the model.
Sizes, qualities and counts
size, quality and n go to the model as you send them, and the model decides what it accepts. A value it doesn’t offer is rejected with a 400, and a rejected request isn’t charged. You’re held for n images and never get more than n.
Response
Every image comes back as a link, in data[].url:
- Images are never returned as base64, so
response_formathas no effect. - HyperFlowSI stores each image before it answers and returns a link that works for 1 hour. Download the images you want to keep.
usageappears for models billed by tokens.
Best practices
- Be specific. Subject, setting, style, lighting and framing all help: “a ceramic mug on an oak desk, top-down, soft window light” beats “a mug”.
- Start small. Settle the prompt with one image at the model’s defaults, then add
sizeorqualityif the model offers them. - Ask for one image at a time while exploring.
nmultiplies the cost. - Keep your own copy. Links expire after an hour, so download the images you need.
Troubleshooting
400 “The model rejected the request”. The model doesn’t offer the size, quality, n or another option you sent. Leave them out to get the model’s defaults, then change one at a time.
400 ”… is not available right now”. The model can’t be used at the moment. Try another image model.
422. The model answered without an image, for example because it declined the prompt. Rephrase it, or try another image model.
404. The model id is wrong, or it isn’t an image model. Check GET /v1/models.
402. The request is held for every image you ask for; lower n, or deposit.
Billing
Each image model is priced one of two ways, shown on its page:
- Per image. A request is held for
nimages at the model’s per-image price. - By tokens, for models that charge for the prompt and the image’s tokens. A request is held for its prompt plus a reserve for each image.
Either way, you’re charged what the model actually made, and the rest of the hold is released.