Docs / Image Series / Muse
Muse Image Generation
Call Muse Image through the official OpenAI synchronous Images API with text-to-image and editing (JSON references or multipart uploads, up to 10 reference images), billed per generated image.
Overview#
Muse Image is a Muse-series image generation model. It is called through the official OpenAI synchronous Images API: requests use the OpenAI Images format, the call blocks until generation finishes, and the images are returned inline with no task polling. Text-to-image and image editing / multi-image composition are supported.
The public model name for this page is muse-image. Billing is per generated image; see the platform Model Pricing page for the unit price.
API#
POST /v1/images/generationsRequests must carry an API key:
Authorization: Bearer <token>
Content-Type: application/jsonText-to-image#
curl --request POST \
--url https://api.apimax.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "muse-image",
"prompt": "A red paper boat on a calm blue lake, watercolor style",
"n": 1,
"size": "1024x1024",
"response_format": "url"
}'Image editing / composition#
POST /v1/images/edits accepts reference images in two ways.
A JSON body with an images array whose entries are image URL strings, {"url": ...} or {"image_url": ...} objects, or {"file_id": ...}:
{
"model": "muse-image",
"prompt": "Add a red knitted hat to the character and keep the background unchanged",
"images": [
"https://example.com/subject.png",
{ "url": "https://example.com/scene.jpg" }
],
"n": 1
}Or an OpenAI-compatible multipart form with image or image[N] file fields, up to 10 reference images of at most 10 MiB each:
curl --request POST \
--url https://api.apimax.ai/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--form 'model=muse-image' \
--form 'prompt=Add a red knitted hat to the character and keep the background unchanged' \
--form 'image=@./input.png'Request fields#
Parameters follow the official OpenAI Images API:
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Fixed as muse-image |
prompt | string | Yes | Description of the image content and style |
n | integer | No | Number of images, 1-10, default 1 |
size | string | No | WIDTHxHEIGHT pixel string (2-5 digits per side), e.g. 1024x1024, 1280x720, 720x1280, 1280x960; upstream default canvas when omitted |
response_format | string | No | url or b64_json, default url |
images | (string\object)[] | No | Reference images for edits, at most 10; entries are URL strings, {url} / {image_url} objects, or {file_id} |
This model does not support mask, quality, resolution, aspect_ratio, or streaming requests; sending them returns 400.
Response#
The API answers synchronously in the OpenAI Images format:
{
"created": 1794000000,
"data": [
{
"url": "https://example.com/generated-image.png",
"revised_prompt": "A red paper boat on a calm blue lake, watercolor style"
}
]
}With response_format set to b64_json, data[].b64_json carries the Base64 image data directly.
Billing#
Billed per generated image. The requested n is pre-held at submission and settled by the actual number of returned images; failed requests are not charged; see the platform Model Pricing page for the unit price.
Common errors#
| HTTP | Description |
|---|---|
| 400 | Missing or invalid parameter, e.g. n outside 1-10, unsupported size, or an unsupported field such as quality; or generation failed (including content rejected by upstream moderation) |
| 401 | API key missing or invalid |
| 403 | API key has no access to this model, or the account balance is insufficient |
| 429 | Rate or quota limit reached |
| 502 / 503 | Upstream returned an error or is temporarily unavailable; 503 also means no channel is available for this model in your group (for example a misspelled model name) |
| 504 | Timed out waiting for the synchronous generation. The task is not cancelled: it keeps running in the background and is billed by its actual result |

