Generating Images
This guide creates images from a text prompt with the image generation API. A 1K image costs 45 credits (US$ 0.045), and only delivered images are charged.
Base URL: https://api.mamutecloud.com. Every call uses your organization API key in the Authorization header, without Bearer:
Authorization: mamute-...
Before you start
- Create an API key (see Authentication) and store it as
MAMUTECLOUD_API_KEY. - Image generation is paid from your balance, free signup credit included, or with auto-recharge. Check what is available with
GET /v1/generations/balance.
1. Create an image
curl -X POST https://api.mamutecloud.com/v1/generations \
-H "Authorization: $MAMUTECLOUD_API_KEY" \
-H "content-type: application/json" \
-d '{"prompt": "A red fox in a snowy forest at dawn, photo", "aspect": "3:2"}'If you still send model, it is ignored and does not return 400. An image takes 1 to 2 minutes, so the call usually answers:
- 202 with
"status": "queued"or"processing": keep theidand read the result later (step 2), or use a webhook (step 3). - 200 with
"status": "done"and the imageurl, when the image finishes within about 20 seconds.
Add ?wait=false to always answer at once.
| Field | Values |
|---|---|
prompt | required, up to 4,000 characters |
size | 1K (default) or 2K only; a value like 1024x1024 returns 400 |
aspect | 1:1 (default), 3:2, 2:3, 4:3, 3:4, 16:9, 9:16 |
format | png (the only format) |
seed | integer from 0 to 2147483647; random when omitted |
webhookUrl | public http or https URL |
2. Read the result
curl https://api.mamutecloud.com/v1/generations/$IMAGE_ID \
-H "Authorization: $MAMUTECLOUD_API_KEY"{
"data": {
"id": "e4b1c6a2-5d3f-4c8e-9a71-0b2d6f8e3c15",
"status": "done",
"size": "1K",
"quality": "standard",
"aspect": "3:2",
"width": 1248,
"height": 832,
"seed": 1849270113,
"format": "png",
"credits": 45,
"priceUsd": 0.045,
"error": null,
"createdAt": "2026-11-05T19:41:02.114Z",
"finishedAt": "2026-11-05T19:42:31.870Z",
"expiresAt": "2026-11-12T19:42:31.870Z",
"url": "https://..."
}
}statusisqueued,processing,doneorerror.urlis signed for 1 hour. Ask again for a fresh link.- Images are deleted 7 days after the job ends (
expiresAt); after that the job showsexpired: trueand nourl. widthandheightare the pixels of the image delivered;seedis the seed of that image.
3. Get notified with a webhook
Send webhookUrl when you create the image. When the job ends, MamuteCloud sends a POST to it:
{ "data": { "id": "e4b1c6a2-...", "status": "done" } }A delivery that fails is retried up to 7 more times over about 7 hours and 40 minutes. Each request carries the attempt number in the X-Mamute-Webhook-Attempt header. Delivery is at least once: dedupe on id. Fetch the full result with GET /v1/generations/{id} when it arrives.
Sizes
size accepts only 1K or 2K. A value like 1024x1024 returns 400. 1K is the area of 1024x1024 and 2K of 2048x2048, spread over the aspect ratio in multiples of 16. The sizes are approximate: the job carries the size actually delivered.
| Aspect | 1K | 2K |
|---|---|---|
1:1 | 1024x1024 | 2048x2048 |
3:2 | 1248x832 | 2496x1664 |
2:3 | 832x1248 | 1664x2496 |
4:3 | 1168x880 | 2352x1760 |
3:4 | 880x1168 | 1760x2352 |
16:9 | 1360x768 | 2720x1536 |
9:16 | 768x1360 | 1536x2720 |
GET /v1/generations/tiers returns this table with the prices.
Pricing and balance
| Price | A 1K image costs 45 credits (US$ 0.045) |
| Charged when | the image is delivered; failed jobs cost nothing |
| Pays with | balance (signup credit included) or auto-recharge |
The price is held from your balance when the job is accepted. If the available balance (balance minus what running jobs hold) cannot cover the image and auto-recharge is off, POST /v1/generations answers 402 and no job is created.
curl https://api.mamutecloud.com/v1/generations/balance -H "Authorization: $MAMUTECLOUD_API_KEY"
# -> { "data": { "totalUsd": 27.98, "reservedUsd": 0.045, "availableUsd": 27.935, "autoRecharge": true } }Content moderation
Prompts go through the provider's content moderation, which now and then blocks harmless prompts. A blocked attempt is retried with a new seed, up to 3 attempts. If every attempt is blocked, the job ends in error with a message starting with content_moderation: and nothing is charged. Rephrase the prompt and try again.
List and monitor
# Newest first; page with ?before=<nextBefore>
curl "https://api.mamutecloud.com/v1/generations?status=failed&limit=50" -H "Authorization: $MAMUTECLOUD_API_KEY"
# This month's images, requests and spend, images per day and per size, and health
curl "https://api.mamutecloud.com/v1/generations/analytics?days=30" -H "Authorization: $MAMUTECLOUD_API_KEY"Errors
| Status | When |
|---|---|
| 400 | invalid body: empty or too long prompt, invalid size (only 1K or 2K; e.g. 1024x1024 returns 400), aspect or format, seed out of range, private webhook URL |
| 401 | missing or invalid API key (remember: no Bearer before mamute-) |
| 402 | the available balance does not cover the image and auto-recharge is off |
| 403 | the account is not active |
| 404 | the image does not belong to your organization |
| 503 | temporarily unavailable; nothing was held. Try again in a few minutes |
Full reference: Image Generation API.
Updated 15 days ago
