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 the id and read the result later (step 2), or use a webhook (step 3).
  • 200 with "status": "done" and the image url, when the image finishes within about 20 seconds.

Add ?wait=false to always answer at once.

FieldValues
promptrequired, up to 4,000 characters
size1K (default) or 2K only; a value like 1024x1024 returns 400
aspect1:1 (default), 3:2, 2:3, 4:3, 3:4, 16:9, 9:16
formatpng (the only format)
seedinteger from 0 to 2147483647; random when omitted
webhookUrlpublic 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://..."
  }
}
  • status is queued, processing, done or error.
  • url is signed for 1 hour. Ask again for a fresh link.
  • Images are deleted 7 days after the job ends (expiresAt); after that the job shows expired: true and no url.
  • width and height are the pixels of the image delivered; seed is 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.

Aspect1K2K
1:11024x10242048x2048
3:21248x8322496x1664
2:3832x12481664x2496
4:31168x8802352x1760
3:4880x11681760x2352
16:91360x7682720x1536
9:16768x13601536x2720

GET /v1/generations/tiers returns this table with the prices.

Pricing and balance

PriceA 1K image costs 45 credits (US$ 0.045)
Charged whenthe image is delivered; failed jobs cost nothing
Pays withbalance (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

StatusWhen
400invalid 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
401missing or invalid API key (remember: no Bearer before mamute-)
402the available balance does not cover the image and auto-recharge is off
403the account is not active
404the image does not belong to your organization
503temporarily unavailable; nothing was held. Try again in a few minutes

Full reference: Image Generation API.


Did this page help you?