Moma Cloud API
A small, predictable REST API for Seedance video and Byta image generation. Every generation is an asynchronous job: submit once with an idempotency key, poll, then download.
https://moma-cloud.com. All prices are USD, deducted from your prepaid balance. The same balance is used by the canvas.Quickstart
- Create an account and add credit (minimum $10).
- Create a key in Dashboard → API keys. It is shown once; store it in a secret manager.
- Submit a job, poll its status, and fetch the result.
# 1. Submit a video (HTTP 202)
curl https://moma-cloud.com/v1/videos \
-H "Authorization: Bearer $MOMA_API_KEY" \
-H "Idempotency-Key: episode-01-shot-01" \
-H "Content-Type: application/json" \
-d '{"model":"seedance2.5-per-v","prompt":"A cinematic flight over desert dunes","seconds":10,"ratio":"16:9"}'
# 2. Poll until "completed"
curl https://moma-cloud.com/v1/videos/vid_YOUR_ID -H "Authorization: Bearer $MOMA_API_KEY"
# 3. Get the download link
curl https://moma-cloud.com/v1/videos/vid_YOUR_ID/content -H "Authorization: Bearer $MOMA_API_KEY"Authentication
Send your key in the Authorization header on every request. Keys start with mc_, belong to your account, are stored only as hashes and can be revoked at any time (up to 20 active keys). Never put a key in browser code or a public repository.
Authorization: Bearer $MOMA_API_KEYModels
Lists enabled models with prices and limits (requires a key). The same catalog is public at GET /api/catalog.
| Model ID | Type | Limits | Price |
|---|---|---|---|
seedance2.5-per-v | Video | 4–30 s, 720p, 30 images · 10 videos · 10 audio, 100 MB each | $1.50 / video |
seedance2.0-fast-per-v | Video | 4–15 s, 720p, text-only or up to 9 images, 20 MB each | $0.80 / video |
byta-image-2-0-pro | Image | auto/1k/2k/4k; PNG, JPEG, WebP, SVG, GIF | $0.15 / request GIF $0.30 (2–9 frames), $0.45 (10–16) |
byta-image-1-6-pro | Image | auto/1k/2k/4k; PNG | $0.15 / request |
byta-image-1-5 | Image | auto; PNG | $0.10 / request |
Create a video
Reserves the model price from your balance and queues the job. Returns 202.
| Field | Description |
|---|---|
model | seedance2.5-per-v (default) or seedance2.0-fast-per-v |
prompt | Required, 1–10,000 characters |
seconds | Integer. 4–30 for Seedance 2.5, 4–15 for Seedance 2.0 Fast. Defaults to 30, so always set it for Fast. |
ratio | 16:9 (default), 9:16, 1:1, 4:3, 3:4, 21:9 |
references | Optional array of { upload_id, index } from reference uploads. Seedance 2.0 Fast accepts images only (max 9, 20 MB each). |
The Idempotency-Key header is required (up to 128 characters). Use one unique key per intended generation. If a request times out, repeat it with the same body and the same key: you get the original job back instead of a second charge. Reusing a key with a different body returns 409.
curl https://moma-cloud.com/v1/videos \
-H "Authorization: Bearer $MOMA_API_KEY" \
-H "Idempotency-Key: product-teaser-007" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance2.0-fast-per-v",
"prompt": "The bottle rotates slowly on wet black stone, soft rim light",
"seconds": 8,
"ratio": "9:16",
"references": [{ "upload_id": "RETURNED_UPLOAD_ID", "index": 0 }]
}'{
"id": "vid_3f1c…",
"object": "video",
"model": "seedance2.0-fast-per-v",
"status": "queued",
"seconds": 8,
"price_usd": 0.8,
"refunded": false,
"created_at": 1795600000,
"error": null
}Poll a video
Poll every 7–10 seconds until status is completed or failed. There is no guaranteed completion time. GET /v1/videos returns your latest 100 video jobs.
Download a video
After completion, returns owner-authenticated links. While the file is being prepared it returns 202 with {"status":"delivery_preparing","retry_after":10}; wait and retry the same call — it never creates a new generation.
{
"url": "https://moma-cloud.com/api/assets/asset_…",
"download_url": "https://moma-cloud.com/api/assets/asset_…",
"expires_at": 1795686400
}Request the URL with your API key and follow redirects. Generated files expire 24 hours after completion; after that the endpoint returns 410 while the job record remains.
Reference uploads (video)
Allocate private, signed upload slots for the files you want to use as video references. Give each file name and size in bytes; video and audio also need duration in seconds. Up to 30 images, 10 videos and 10 audio files, 100 MB each. Formats: JPG, PNG, WebP, MP4, MOV, WebM, MP3, WAV, M4A, OGG. Requires a balance of at least $0.80.
curl https://moma-cloud.com/api/uploads \
-H "Authorization: Bearer $MOMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"files":[
{"name":"character.jpg","size":124000},
{"name":"motion.mp4","size":2500000,"duration":5.2}
]}'The response has an upload id and an ordered files array with upload_url, method (PUT) and headers. Upload each file directly, then reference it by position.
# For each returned file: PUT raw bytes with exactly the returned headers.
# Do NOT send your API key or cookies to the storage URL.
curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/jpeg" --data-binary @character.jpgUse the references in POST /v1/videos within one hour. Only HTTPS destinations under *.r2.cloudflarestorage.com are returned; treat signed URLs as secrets.
Create an image
One charge per request, whatever number of images the model returns. Idempotency-Key is required with the same rules as video. Returns 202 with an img_ job.
| Field | Description |
|---|---|
model | byta-image-1-5 (default), byta-image-1-6-pro, byta-image-2-0-pro |
prompt | Required, 1–10,000 characters |
aspect_ratio | 1:1 (default), 16:9, 9:16, 3:2, 2:3, auto |
resolution | auto (default); 1.6 Pro and 2.0 Pro also accept 1k, 2k, 4k |
asset_ids | Optional, at most one owned JPG/PNG/WebP reference up to 20 MB (see reference images) |
n | Always 1 |
curl https://moma-cloud.com/v1/images/generations \
-H "Authorization: Bearer $MOMA_API_KEY" \
-H "Idempotency-Key: logo-mark-v3" \
-H "Content-Type: application/json" \
-d '{
"model": "byta-image-2-0-pro",
"prompt": "A minimal violet paper-crane logo mark",
"aspect_ratio": "1:1",
"resolution": "2k",
"output_format": "png",
"background": "transparent",
"thinking_mode": "high",
"n": 1
}'Byta Image 2.0 Pro options
| Field | Values |
|---|---|
output_format | png (default), jpeg, webp, svg, gif |
background | auto, opaque, transparent — transparent requires PNG or WebP |
thinking_mode | auto, low, medium, high, xhigh, max |
frame_count | GIF only, 2–16 (provider default 9) |
frame_duration_ms | GIF only, 20–655,350 ms per frame, rounded to 10 ms |
- Animated GIF needs
aspect_ratio: "1:1",resolution: "auto"and no reference image. Price: $0.30 for 2–9 frames, $0.45 for 10–16 frames. - SVG is text-to-image only; remove
asset_ids. - Static formats, transparency and thinking modes keep the $0.15 price. These fields are rejected for other models.
{
"model": "byta-image-2-0-pro",
"prompt": "A tiny paper boat bobbing on gentle waves, seamless loop",
"aspect_ratio": "1:1",
"resolution": "auto",
"output_format": "gif",
"frame_count": 9,
"frame_duration_ms": 120
}Poll and download images
When completed, outputs lists every returned image. Fetch each url with your API key. Files are private and expire 24 hours after completion.
{
"id": "img_9b2e…",
"object": "image_generation",
"model": "byta-image-2-0-pro",
"status": "completed",
"price_usd": 0.15,
"billing_unit": "generation",
"outputs": [{
"asset_id": "asset_…",
"url": "/api/assets/asset_…",
"mime": "image/png",
"size": 1042348,
"expires_at": 1795686400,
"expired": false
}]
}Reference images
Upload raw bytes to create a private asset, then pass its ID in asset_ids. Send Content-Type and a URL-encoded X-Filename. Supported: JPG, PNG, WebP, MP4, MOV, WebM, MP3, WAV, M4A, OGG up to 100 MB (image references for generation: 20 MB).
curl https://moma-cloud.com/api/assets \
-H "Authorization: Bearer $MOMA_API_KEY" \
-H "Content-Type: image/png" \
-H "X-Filename: product.png" \
--data-binary @product.png
# → { "id": "asset_…", "expires_at": …, … } then send "asset_ids": ["asset_…"]To reuse a generated image as a longer-lived reference, call POST /api/assets/{asset_id}/reference with an Idempotency-Key. It creates a separate copy that follows reference retention; the original output keeps its 24-hour expiry.
Generation history
Your latest 100 image and video jobs in one list, newest first, in the same shapes as the job endpoints.
Storage and retention
- Generated images and videos: kept for 24 hours after completion. Viewing does not extend it.
- Reference files: kept for 4 days after their last use in the canvas or API.
- Quota: 10 GB of retained media per account; when exceeded, the oldest files are removed first.
- Expired media returns
410. Jobs, projects and billing history are kept.
GET /api/storage reports used_bytes and limit_bytes. POST /api/assets/status with {"asset_ids":[…]} returns availability and expiry without refreshing it.
Job states
| Status | Meaning |
|---|---|
queued | Accepted and paid; waiting to be sent to the model |
submitting | Being sent to the model |
processing | Generating, or preparing the file |
completed | Done; outputs are ready to download |
failed | Confirmed failure; the charge was refunded (refunded: true) |
uncertain | The submission outcome is unknown and is under review. It will be linked to its result or refunded. |
uncertain job with a new idempotency key — that would be a second, separately charged generation. Keep polling the same ID.Errors and limits
Errors return JSON with a human-readable detail.
| Code | Meaning |
|---|---|
401 | Missing, invalid or revoked API key |
402 | Insufficient prepaid balance for this request |
403 | Browser request from another origin |
404 | Job, asset or project not found for your account |
409 | Idempotency-Key reused with a different body, or job not completed yet |
410 | Media expired or removed for storage space |
413 | Request or file too large (JSON 1 MB, media 100 MB) |
422 | Invalid field, unsupported option, or reference limit exceeded |
429 | Rate limit: 30 submissions per minute, 50 outstanding jobs, 180 requests per minute |
502 / 503 | Temporary upstream or delivery problem; retry reads with backoff |