MotionLab for developers
MotionLab API reference
Endpoints, actions, job statuses, error codes, rate limits, upload limits and the OpenAPI document for the MotionLab generation API.
Base URL and authentication
All endpoints are under https://www.motionlab.art/api/v1 and accept and return JSON. Send your personal key from API key settings on every request. Keys start with ml_public_, are shown once when created, and expire after the period you chose (30 days, 90 days or 1 year). Keep them on your server.
Authorization: Bearer ml_public_...
Content-Type: application/jsonA "Generate & read" key can call every action. A "Read only" key can read models, estimates, balance and jobs, and cannot create uploads or generations. An account can hold five active keys.
Endpoints
| Endpoint | Purpose |
|---|---|
| GET /api/v1/models | Live models, supported settings and credit costs. |
| GET /api/v1/actions | Actions your key can call, with input and output JSON Schemas per model. |
| POST /api/v1/actions/{actionId} | Run one action. The body is that action's input object. |
| GET /api/v1/actions/openapi.json | OpenAPI 3.1 description of this API. No key required. |
Import the OpenAPI document into your HTTP client or code generator. It is built from the live catalog, so fetch it again when models change.
Response format
A successful call returns HTTP 200 with result. A failed call returns a 4xx or 5xx status with error. Both include requestId, also sent as the X-Request-Id header. Quote it when you contact support.
{ "requestId": "req_...", "result": { ... } }
{ "requestId": "req_...",
"error": { "code": "INVALID_INPUT", "message": "...", "details": { ... } } }Branch on error.code. Messages are for people and their wording can change.
Actions
| Action | What it does | Spends credits |
|---|---|---|
| motionlab_get_capabilities | List the MotionLab models, settings, formats and credit costs currently available to this account. Read it before building a request; availability changes without an API version change. | No |
| motionlab_get_credit_balance | Read this account's current credit balance. Generations reserve credits when accepted and refund automatically on failure. | No |
| motionlab_estimate_cost | Price a generation before creating it and check that the balance covers it. Spends nothing and creates nothing. The create call prices the request again, so an estimate is a quote, not a reservation. | No |
| motionlab_create_upload | Get a short-lived presigned URL for an image, MP4 reference video, or WAV/MP3 reference audio file. Pass the returned owned key to the matching generation input. | No |
| motionlab_generate_image | Create an image from a text prompt (optionally editing uploaded reference images). Spends credits. Returns a job id immediately: retain it, then make separate motionlab_get_job calls until terminal; do not create again while it is pending. | Yes |
| motionlab_animate_image | Animate an owned uploaded image using an enabled MotionLab tier and its live controls. Returns a jobId immediately; poll motionlab_get_job until terminal. | Yes |
| motionlab_generate_video | Generate video using a model and inputs from live capabilities. Select the model's supported controls. Returns a jobId immediately; poll motionlab_get_job until terminal and review the completed video. | Yes |
| motionlab_generate_audio | Create audio using an enabled model and its available operations from live capabilities. Returns a jobId immediately; poll motionlab_get_job until terminal. | Yes |
| motionlab_upscale | Enhance an image or video to a higher resolution, or double a clip's frame rate. Choose a faithful restoration engine or a generative MotionLab re-render; call motionlab_get_capabilities for the engines, limits and prices available to this account. Spends credits. Returns a job id immediately: retain it, then make separate motionlab_get_job calls until terminal; do not create again while it is pending. | Yes |
| motionlab_create_3d | Generate a textured 3D asset (GLB) from an uploaded image. Spends credits. Returns a job id immediately: retain it, then make separate motionlab_get_job calls until terminal; do not create again while it is pending. | Yes |
| motionlab_get_job | Read one job's status, progress and result. Poll every 5-10 seconds while status is PENDING or PROCESSING. Terminal statuses are COMPLETED, FAILED, CANCELED and FLAGGED_NSFW. A COMPLETED job includes outputUrl; a failed job includes error with a stable code and whether its credits were refunded. | No |
| motionlab_list_jobs | List this account's generation jobs, newest first, with optional status filter and cursor pagination. Use it to check several jobs in one request or to find a completed job to reuse as an input. | No |
| motionlab_create_batch | Start 2-6 generations in one call — variations of a prompt, shots in a sequence, or one frame across several models. Each item uses its single-create tool's permissions, validation and current price. Items run sequentially and may partially succeed; insufficient credits or rate limits stop remaining items. The result lists each job id or failure in order. Poll each jobId with motionlab_get_job. Reuse the same idempotencyKey to retrieve existing jobs without charging again. | Yes |
Every action that spends credits requires an idempotencyKey. Exact fields differ by model: read the action's modelSchemas entry for the model you selected.
Idempotency
idempotencyKey is 8–120 characters of letters, digits, periods, underscores, colons or hyphens. Save it before sending the request. Sending the same action again with the same key returns the original job with idempotent: true and does not charge again. Use a new key for each new creation. Reusing a key for a different operation returns DUPLICATE_REQUEST.
Jobs
Creation returns result.jobId immediately. Poll motionlab_get_job every 5–10 seconds until status is terminal. To follow many jobs, call motionlab_list_jobs once instead of polling each job.
| Status | Meaning |
|---|---|
| PENDING | Accepted and waiting to start. |
| PROCESSING | Generating. stage, progress and statusMessage describe where it is. |
| COMPLETED | Finished. outputUrl holds the result. Terminal. |
| FAILED | Did not finish. error explains why. Terminal. |
| CANCELED | Canceled before finishing. Terminal. |
| FLAGGED_NSFW | Blocked by the content-safety system. Terminal. |
progress is a percentage or null when the model reports none; progressSource says whether it was reported, estimated or a milestone. Only COMPLETED means 100.
A job that did not complete has an error object with code, message and refunded. refunded: true means its credits were returned to your balance.
| error.code | Meaning |
|---|---|
| CONTENT_SAFETY | Blocked by the content-safety system. |
| INPUT_NOT_ACCESSIBLE | An input file could not be read. Upload it again. |
| INPUT_INVALID | An input file is invalid or unsupported. |
| AUDIO_INPUT_MISSING | Audio-driven generation was requested without an audio file. |
| PROVIDER_TIMEOUT | Rendering timed out. Retry as a new request. |
| PROVIDER_UNAVAILABLE | The renderer was temporarily unavailable. Retry as a new request. |
| PROVIDER_REJECTED | The renderer rejected the request. Review the inputs; error.details may name the field. |
| OUTPUT_PERSISTENCE_FAILED | Rendering finished but the output could not be saved. |
| ENGINE_UNAVAILABLE | The selected MotionLab engine was temporarily unavailable. |
| CANCELED | The job was canceled. |
| INTERNAL_ERROR | An unexpected failure during generation. |
Output files
Download outputUrl to your own storage when the job completes. Outputs are kept for 30 days after the job was created; outputExpiresAt on the job gives the scheduled removal time. Audio jobs can also return audioTracks with one URL per track.
Uploads
Call motionlab_create_upload with filename, contentType and fileSizeBytes. PUT the raw bytes to the returned uploadUrl with the same Content-Type, then pass the returned key to a generation input. Inputs must be keys from your own account; third-party URLs are not accepted.
| Limit | Value |
|---|---|
| Content types | image/png, image/jpeg, image/webp, image/gif, image/avif, video/mp4, audio/wav, audio/mpeg |
| Maximum file size | 50 MB |
| Upload URL lifetime | 5 minutes |
| Upload URLs | 20 per 10 minutes per account |
Rate limits
| Limit | Value |
|---|---|
| All requests | 60 per minute |
| Credit-spending actions | 10 per minute |
| JSON body | 2 MiB |
A 429 response carries a Retry-After header in seconds, repeated in error.details.retryAfterSeconds. Polling counts toward the request limit, so poll with a delay and prefer motionlab_list_jobs for batches.
Request error codes
| Code | HTTP | Meaning |
|---|---|---|
| AUTHENTICATION_REQUIRED | 401 | The Bearer key is missing, malformed, expired or revoked. error.details.reason says which: key_missing_or_malformed, key_unknown, key_revoked or key_expired. |
| INSUFFICIENT_SCOPE | 403 | The key lacks a permission this action needs. A read-only key cannot create. |
| SERVICE_DISABLED | 503 | The API or this action is switched off right now. Retry later. |
| FEATURE_NOT_AVAILABLE_ON_PLAN | 403 | The account cannot use this feature. |
| INVALID_INPUT | 400 | The body failed validation. error.details.issues lists each field and reason. Fix the request before retrying. |
| ASSET_NOT_FOUND | 404 | A referenced upload key or source job does not exist. |
| ASSET_ACCESS_DENIED | 403 | A referenced upload or job belongs to another account. |
| ACCOUNT_SUSPENDED | 403 | API access is suspended for this account. Contact support. |
| JOB_NOT_FOUND | 404 | No job with this ID exists for this account. |
| JOB_ACCESS_DENIED | 403 | The job belongs to another account. |
| INSUFFICIENT_CREDITS | 402 | The balance does not cover the request. Nothing was charged. |
| RATE_LIMITED | 429 | Too many requests. Wait for the Retry-After header (also error.details.retryAfterSeconds). |
| DUPLICATE_REQUEST | 409 | This idempotencyKey was already used for a different operation. |
| UPLOAD_FAILED | 500 | The upload URL could not be created. Retry. |
| GENERATION_FAILED | 500 | The generation could not be started. Retry with the same idempotencyKey. |
| TEMPORARY_PROVIDER_FAILURE | 503 | A temporary failure. Retry with the same idempotencyKey. |
| UNKNOWN_ACTION | 404 | No action has this ID. Read GET /api/v1/actions. |
| INTERNAL_ERROR | 500 | An unexpected failure. Retry with the same idempotencyKey and quote requestId to support if it persists. |
| NOT_FOUND | 404 | The URL is not an API endpoint. |
| METHOD_NOT_ALLOWED | 405 | Wrong HTTP method. The Allow header names the right one. |
Continue building
- AI generation API quickstart
Create an API key, discover models, estimate credits and submit your first image with Node.js and cURL.
- AI video generation API
Integrate text-to-video and image-to-video with model discovery, owned uploads, cost estimates and asynchronous results.
- AI image generation and editing API
Build image generation and reference-image editing with live model settings and fractional-credit pricing.
- AI music and audio generation API
Generate music and use song tools through one action, with live model controls, per-operation pricing and multi-track results.
- Image-to-3D API
Turn one uploaded image into a textured GLB model: source image tips, cost estimate, job creation and download.
- AI image and video upscaling API
Upscale images and videos or double frame rate with live engines, source rules and measured pricing.
- fal.ai vs Higgsfield API: Pricing Compared Side by Side
fal.ai vs Higgsfield API prices for the same model and settings, with dated official sources. Plus authentication, polling, webhooks and migration steps.