Images
Generates images from a text prompt. The endpoint is OpenAI-compatible: point the OpenAI SDK's images endpoint at AI HUB and pass a published image model id.
POST
https://console.aimodelhub.ai/v1/images/generations
| Field | Type | Notes |
|---|---|---|
model | string | Required. A published image model id (see below). |
prompt | string | Required. What to generate. |
size | string | Optional. Mapped to the model's accepted sizes/aspects; defaults to 1024x1024. |
n | integer | Optional. 1 this milestone; >1 returns 400 where unsupported. |
response_format | string | url (default, hosted in the library) or b64_json. |
brand | string | Optional. A company profile id from the account. Its visual identity is folded into the generation prompt (not a system message, unlike chat). See Brands. |
image | string | Optional. A public https URL of the picture to edit. Only models that take input pictures accept it. See Input pictures. |
reference_images | string[] | Optional. An array of public https URLs for extra pictures. Send it together with image. |
Input pictures
Put the picture to edit in image and any extra pictures in reference_images. Every image model uses these same two fields. The prompt decides the result: the first picture is changed, or all of them are combined into a new one.
{
"model": "qwen-image-3-0-pro",
"prompt": "Put the three products side by side on a marble counter",
"size": "16:9",
"image": "https://example.com/cup.jpg",
"reference_images": [
"https://example.com/teapot.jpg",
"https://example.com/jar.jpg"
]
}Each URL must be public https. Every model has its own limits on format, file size and pixels per side, listed in the table. A picture outside those limits receives a 400 before anything is charged. The price follows the image returned, not the number of pictures sent.
What each model takes per request, counting image and reference_images together:
| Model | Input pictures | Formats | File size | Pixels per side |
|---|---|---|---|---|
| Models are being published and will appear here in a few minutes. | ||||
Brand-aware images
Pass an optional brand (a company profile UUID from GET /v1/brands). The brand's visual identity is folded into the generation prompt; if the brand has "Humanize AI output" on, one extra rewrite pass runs (billed at list price, never blocks generation). An unknown, foreign, or malformed id returns 404 brand_not_found with param: "brand". The library stores the raw prompt as sent. The brand hint never appears in the stored prompt.
Response
{
"created": 1784286658,
"data": [
{ "url": "https://media.aimodelhub.ai/media/user-images/{your_user_id}/XK8y0ASmtEreGRcVQZm7AUhSUXgAkhI6JR9GbBPa.jpg" }
]
}Pass "response_format": "b64_json" to get { "data": [ { "b64_json": "…" } ] } instead of a hosted URL.
The image is also saved to the library (with a "via API" badge). Each successful call is metered once at the model's list price and debited from the wallet. Failed calls are never billed. Errors use the standard error envelope.
Errors
The full status/type table is on the shared errors reference. The ones below are specific to this endpoint.
| Status | Type | When |
|---|---|---|
| 400 | invalid_request_error | The prompt field is missing or empty. |
| 400 | invalid_request_error | reference_images is not an array of URLs, or a picture could not be fetched or is outside the limits under Input pictures. |
| 429 | rate_limit_exceeded | The account already has the maximum number of images generating at once. See Rate limits for the current cap. |
| 422 | invalid_request_error | reference_images was sent without image. |
| 422 | model_capability_unsupported | The model takes no input pictures, or the request sent more pictures than it takes. |
| 502 | upstream_error | The vendor round trip failed or returned an unrecognized shape. Retry. |
Available image models
| Model | Reference |
|---|---|
| Models are being published and will appear here in a few minutes. | |