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/json

A "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

HTTP endpoints
EndpointPurpose
GET /api/v1/modelsLive models, supported settings and credit costs.
GET /api/v1/actionsActions 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.jsonOpenAPI 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

Actions available now
ActionWhat it doesSpends credits
motionlab_get_capabilitiesList 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_balanceRead this account's current credit balance. Generations reserve credits when accepted and refund automatically on failure.No
motionlab_estimate_costPrice 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_uploadGet 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_imageCreate 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_imageAnimate 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_videoGenerate 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_audioCreate audio using an enabled model and its available operations from live capabilities. Returns a jobId immediately; poll motionlab_get_job until terminal.Yes
motionlab_upscaleEnhance 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_3dGenerate 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_jobRead 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_jobsList 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_batchStart 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.

Job statuses
StatusMeaning
PENDINGAccepted and waiting to start.
PROCESSINGGenerating. stage, progress and statusMessage describe where it is.
COMPLETEDFinished. outputUrl holds the result. Terminal.
FAILEDDid not finish. error explains why. Terminal.
CANCELEDCanceled before finishing. Terminal.
FLAGGED_NSFWBlocked 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.

Job error codes
error.codeMeaning
CONTENT_SAFETYBlocked by the content-safety system.
INPUT_NOT_ACCESSIBLEAn input file could not be read. Upload it again.
INPUT_INVALIDAn input file is invalid or unsupported.
AUDIO_INPUT_MISSINGAudio-driven generation was requested without an audio file.
PROVIDER_TIMEOUTRendering timed out. Retry as a new request.
PROVIDER_UNAVAILABLEThe renderer was temporarily unavailable. Retry as a new request.
PROVIDER_REJECTEDThe renderer rejected the request. Review the inputs; error.details may name the field.
OUTPUT_PERSISTENCE_FAILEDRendering finished but the output could not be saved.
ENGINE_UNAVAILABLEThe selected MotionLab engine was temporarily unavailable.
CANCELEDThe job was canceled.
INTERNAL_ERRORAn 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.

Upload limits
LimitValue
Content typesimage/png, image/jpeg, image/webp, image/gif, image/avif, video/mp4, audio/wav, audio/mpeg
Maximum file size50 MB
Upload URL lifetime5 minutes
Upload URLs20 per 10 minutes per account

Rate limits

Limits per account, shared by all of its keys
LimitValue
All requests60 per minute
Credit-spending actions10 per minute
JSON body2 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

error.code values on a failed request
CodeHTTPMeaning
AUTHENTICATION_REQUIRED401The 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_SCOPE403The key lacks a permission this action needs. A read-only key cannot create.
SERVICE_DISABLED503The API or this action is switched off right now. Retry later.
FEATURE_NOT_AVAILABLE_ON_PLAN403The account cannot use this feature.
INVALID_INPUT400The body failed validation. error.details.issues lists each field and reason. Fix the request before retrying.
ASSET_NOT_FOUND404A referenced upload key or source job does not exist.
ASSET_ACCESS_DENIED403A referenced upload or job belongs to another account.
ACCOUNT_SUSPENDED403API access is suspended for this account. Contact support.
JOB_NOT_FOUND404No job with this ID exists for this account.
JOB_ACCESS_DENIED403The job belongs to another account.
INSUFFICIENT_CREDITS402The balance does not cover the request. Nothing was charged.
RATE_LIMITED429Too many requests. Wait for the Retry-After header (also error.details.retryAfterSeconds).
DUPLICATE_REQUEST409This idempotencyKey was already used for a different operation.
UPLOAD_FAILED500The upload URL could not be created. Retry.
GENERATION_FAILED500The generation could not be started. Retry with the same idempotencyKey.
TEMPORARY_PROVIDER_FAILURE503A temporary failure. Retry with the same idempotencyKey.
UNKNOWN_ACTION404No action has this ID. Read GET /api/v1/actions.
INTERNAL_ERROR500An unexpected failure. Retry with the same idempotencyKey and quote requestId to support if it persists.
NOT_FOUND404The URL is not an API endpoint.
METHOD_NOT_ALLOWED405Wrong HTTP method. The Allow header names the right one.

Continue building

Explore live models and prices · Create your API key