Image Generation
No image models are listed on HyperFlow HI today. This page documents the endpoint for when they join the catalog: check the Marketplace or GET /v1/models for models with "mode": "image".
HyperFlow HI 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 Marketplace, pick the Image type. Each model’s page lists its price.
- From the API,
GET /v1/modelslists the models you can call; image models have"mode": "image".
Generate an image
The samples use the OpenAI SDK set up as in the Quickstart, plus import base64 in Python and import fs from 'node:fs' in TypeScript.
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 inline as base64, in data[].b64_json:
- Images are never returned as links, so
response_formathas no effect. Decode each image and save it. 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.
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 top up.
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.