Muse Image Generation
Generate and edit images with Muse Image using text prompts, up to 10 reference images, and 10 aspect ratios
Note for users in mainland China: Please use https://toapis.cn as the API endpoint (Base URL). Replace https://toapis.com with https://toapis.cn in the examples below.
- Model ID:
muse-image - Supports text-to-image generation and reference-image editing (passing
image_urlsautomatically switches to image-to-image mode) - Supports
10aspect ratios with flat per-image billing and no separate resolution or quality tier selection - Asynchronous task endpoint returning a unified
generation.task; use the returned taskidto query results
image_urls only accepts publicly accessible HTTP(S) image URLs, not base64 or Data URI payloads. Use the Upload Image API to upload local images and obtain URLs first.
Authentication
All requests require a Bearer Token. Get your API Key from the API Key Management Page.
Authorization: Bearer YOUR_API_KEYRequest Parameters
Image generation model name, fixed to muse-image.
Text description for image generation or editing. Supports both English and Chinese prompts.
Output image aspect ratio (also accepts aspect_ratio). Defaults to 1:1. Supported values (10 ratios):
1:12:3,3:23:4,4:34:5,5:49:16,16:921:9
Output dimensions are determined automatically for the selected aspect ratio. Separate resolution (resolution / image_size) and quality (quality) tiers are not used.
Number of images to generate per request, fixed at 1 (values greater than 1 are rejected).
Array of reference image URL strings for image-to-image generation or editing (also accepts reference_images). Up to 10 images; each URL must be publicly accessible. The reference image count does not change the output image count.
- Omit or pass an empty array for text-to-image
- Pass 1-10 image URLs for image-to-image / image editing
["https://example.com/photo.jpg"]Optional business identifier for your task, such as an order or transaction ID. You can query the task by this value through the same status endpoint.
Optional webhook callback URL invoked when the task completes. Configure and enable Task Webhooks on your API Key first.
Response Fields
Task ID used to query task status and results.
Object type, always generation.task.
Model ID used in the request, always muse-image.
Task status: queued, pending, in_progress, completed, failed.
Task progress as a percentage from 0 to 100.
Task creation time as a Unix timestamp in seconds.
Task metadata.
Request Example
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "muse-image",
"prompt": "Warm morning sunlight across a minimalist wooden cafe table with latte art and a flaky croissant, film photography",
"size": "16:9",
"n": 1
}'curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "muse-image",
"prompt": "Keep the product shape and label unchanged and replace the background with a sunlit coastal wooden table at dawn",
"size": "3:4",
"n": 1,
"image_urls": [
"https://example.com/product.jpg"
]
}'import requests
response = requests.post(
"https://toapis.com/v1/images/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "muse-image",
"prompt": "Warm morning sunlight across a minimalist wooden cafe table with latte art and a flaky croissant, film photography",
"size": "16:9",
"n": 1
}
)
response.raise_for_status()
task = response.json()
print(task["id"])const response = await fetch('https://toapis.com/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'muse-image',
prompt: 'Warm morning sunlight across a minimalist wooden cafe table with latte art and a flaky croissant, film photography',
size: '16:9',
n: 1
})
});
if (!response.ok) {
throw new Error(await response.text());
}
const task = await response.json();
console.log(task.id);Response Example
{
"id": "tsk_img_abc123def456",
"object": "generation.task",
"model": "muse-image",
"status": "queued",
"progress": 0,
"created_at": 1796280000,
"metadata": {}
}Query Results
The id in the submission response is the task ID. Use the Image Task Status API to retrieve task status and final images (once completed, the image URL is returned at result.data[0].url). See Task Webhooks for asynchronous notifications.