Moonfactory
GalleryStudio

Moonfactory API

The API lets your own software use the same studio your account uses on the website. A job created through the API is a normal job. It lands in your library beside your website jobs, it follows the same rules, and it is charged the same prices.

Your balance covers everything

API jobs draw from the same balance you top up inside Moonfactory. There is no separate API wallet and no separate top up, and there is no API credit to buy. The balance on your account simply covers website jobs and API jobs alike, and you choose which surface spends it. Your plan, your included budget, and your free clips work the same way on both surfaces. Nothing about API use changes what a job costs.

Getting a key

Sign in, open your account menu, and choose API. Give your key a name and create it. The full key shows one time only, on that one screen, so copy it somewhere safe right away. A key acts with the full power of your account, so keep it like a password and never share it. You can hold up to 20 live keys at once. Revoke a key in the same place whenever you want, and a revoked key stops working at once.

Sending your key

Send your key on every call in the Authorization header, as a Bearer token.

Authorization: Bearer mf_live_your_key_here

Every call below starts from the same base address as the website.

https://magrify--moonfactory-api.us-east.modal.run

Models and prices

GET /api/v1/models

The answer lists the video models and the image models, with the sizes and lengths each one makes and the rate your account pays. It is the same catalog the website serves, priced for your account.

Quote a job

POST /api/v1/quote
POST /api/v1/images/quote

Ask what a job would cost before you create it. A quote charges nothing and creates nothing. Send the same body you would send to create, and the answer is the same quote the website would show your account for the same inputs.

Create a video job

curl -X POST https://magrify--moonfactory-api.us-east.modal.run/api/v1/jobs \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"model": "seedance", "prompt": "A paper boat crosses a pond at dawn", "duration_seconds": 5, "resolution": "720p"}'

A created job answers with the job object and status 202. The job is already in your library, and its charge comes out of your balance the same way a website job charges it.

Create an image job

POST /api/v1/images

{"prompt": "A lighthouse at dusk", "image_model": "nano_banana_2", "image_size": "1K"}

Add image_model and image_size to pick a shelf model and a size, or leave them out to use the built in image maker, which takes an aspect_ratio field instead.

Read your jobs

GET /api/v1/jobs
GET /api/v1/jobs/{job_id}
GET /api/v1/jobs/{job_id}/file

List your jobs, read one job, and download a finished file. A job object carries its status, its model, its prompt, and what it charged. A job moves from queued to running to done, and a failed job carries a plain words error. The file call answers with the finished video or image once the job is done. Poll the job read every few seconds until the status is done.

Read your balance

GET /api/v1/balance

The answer shows your plan, your balance in cents, your free clips used and their limit, and your included budget for the period.

Errors

A failed call answers with an HTTP status and a JSON body with one field, detail, whose value says what went wrong in plain words.

{"detail": "a valid API key is required"}
  • 401 means the key is missing, unknown, or revoked.
  • 402 means your balance or your paid in total cannot cover the job.
  • 403 means a rule refused the job, such as a paid only feature, a missing adult confirmation, or a suspended account.
  • 422 means the request itself is shaped wrong, such as an unknown model or a missing prompt.
  • 429 means you are calling too fast. Slow down and try again.
  • 503 means the model is unavailable right now.

Limits

Each key may make 120 calls in a minute. Job creation shares the website pace limits, and the number of jobs you can have in flight follows your plan, counted across both surfaces together. There is no separate API price and no separate free tier. The free clips on your account are the same free clips, whichever surface spends them.

Rules that still apply

Every guard on the website guards the API too. A prompt that breaks the rules is refused before anything is charged or created. Uploaded images are scanned the same way. Uncensored models need the one time adult confirmation on your account first, and that confirmation happens on the website. A job made through the API counts toward your free clips and your settled costs exactly like a website job.

Moonfactory
HelpTermsPrivacyAcceptable useSupport