Animation API
Make a rigged character move. Apply one animation from the Meshy library, join several library animations into one file, or play a clip from Text to Motion.
Moving from v1? The main changes for Animation:
- The request is the same.
- Results are in
outputinstead ofresult. - A file that wasn't produced is
nullinstead of"". - The animation library is at
GET /openapi/v2/animations/library, and returns the same list.
Create an Animation task
Creates an Animation task and returns the task object. The task runs in the background. To read its result, see Get the result. For how long a task usually takes, see Processing times.
Meshy charges for each animation in a task, so a task with action_ids costs more than one with action_id or motion_task_id. See Pricing.
curl https://api.meshy.ai/openapi/v2/animations \
-X POST \
-H "Authorization: Bearer ${MESHY_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"rig_task_id": "01a15cd5-ddac-75d0-a953-3044624a8ae9",
"action_id": 0
}'Parameters
- Name
- rig_task_id
- Type
- string
- Required
- Description
The ID of the Rigging task whose character to animate. The task must be one of yours and have the status
SUCCEEDED.A Rigging task that hasn't succeeded returns
400with the codeinput_task_not_ready, and the message gives its status. A task of another type returns400with the codeinput_task_unsupported.
Send exactly one of action_id, action_ids, and motion_task_id. Sending more than one returns 400. Sending none returns 400 with the message action_id is required.
- Name
- action_id
- Type
- integer
- Required
- Description
Required unless you send
action_idsormotion_task_id. Theaction_idof one library animation to apply. To find IDs, use List animations or the Animation Library page.Try and previewSend this or
action_idsormotion_task_id. Picking a value here clears the others.The animation's
rig_typemust match the rig, or the request returns400. Anyquadrupedanimation works on any quadruped rig, whatever animal itscategorynames.Meshy names the clip in the file by the animation's
key, for exampleBig_Wave_Hello, as in a download from the Meshy web app. In a clip name, each character other than a letter, a digit, or_becomes_. A key that starts with a digit gets a_in front, for example_360_Power_Spin_Jump.A few library animations don't work with some two-legged rigs. They return
400with the messageThis animation is no longer available.
- Name
- action_ids
- Type
- integer[]
- Required
- Description
Required unless you send
action_idormotion_task_id. Theaction_idvalues of up to 10 library animations to join into one file, with no repeats. More than 10 IDs, or a repeated ID, returns400. A list with one ID works likeaction_id.Meshy joins the animations in the order you send them. It names each clip in the file by the animation's
key, the same way as foraction_id.An animation whose
rig_typedoesn't match the rig returns400.
- Name
- motion_task_id
- Type
- string
- Required
- Description
Required unless you send
action_idoraction_ids. The ID of the Text to Motion task whose clip to play on the character. The task must be one of yours and have the statusSUCCEEDED, and the rig must be abiped.Try and previewSend this or
action_idoraction_ids. Picking a value here clears the others.Use the Text to Motion task within 3 days after it finishes. After that, Meshy deletes its clip, like other task files, and this parameter returns
404. Enterprise accounts keep their files.Meshy names the clip in the file by the Text to Motion task's
id, as in a download from the Meshy web app. Each-becomes_, and an ID that starts with a digit gets a_in front. For example, the clip of task018a210d-1c22-7e0f-9d3a-4a5b6c7d8e9fis named_018a210d_1c22_7e0f_9d3a_4a5b6c7d8e9f.
- Name
- post_process
- Type
- object
- Description
One extra file to make from the animation's FBX file, returned in the matching
outputfield. Leave it out for no extra file.It has these fields:
operation_type: the file to make. Without it, Meshy makes no extra file.change_fps: an FBX file at another frame ratefbx2usdz: a USDZ fileextract_armature: an FBX file with the skeleton only
fps: the frame rate forchange_fps, one of24,25,30, or60. The default is30.
Any other
operation_typeorfpsvalue returns400.With
motion_task_id, the clip can come back as a GLB file only. In that case, apost_processoperation fails the task, and Meshy refunds its credits.
Returns
202 Accepted with the task object. The task starts as PENDING, with your request in input and output set to null.
Two response headers help you read the task:
Location: the task's URL on TasksRetry-After: how many seconds to wait before you first read it
Failure modes
- Name
400 - Bad Request- Description
The request can't run. For example:
- More than one of
action_id,action_ids, andmotion_task_idwas sent - An
action_idisn't in the library action_idshas a repeat or more than 10 IDs- The Rigging task hasn't succeeded
- The Text to Motion task hasn't succeeded (
Motion task has not succeeded) motion_task_idwas sent with a rig that isn't abiped- An animation's
rig_typedoesn't match the rig
The error message says which problem it found. See Errors.
- More than one of
- Name
401 - Unauthorized- Description
The API key is missing or invalid. Check the
Authorizationheader.
- Name
402 - Payment Required- Description
One of these applies:
- The account doesn't have enough credits.
- The account reached a credit limit.
- The account is on the free plan.
Check your credits and plan, then retry.
- Name
403 - Forbidden- Description
The
rig_task_idtask is a bas-relief model, which this endpoint can't animate. The message isThis model type does not support this operation. Rig a different model.
- Name
404 - Not Found- Description
Meshy can't find a task or file the request needs. One of these applies:
rig_task_iddoesn't match any of your tasks (rig_task_id does not match any of your tasks). Check the ID.motion_task_iddoesn't match any of your Text to Motion tasks (Motion task not found). Check the ID.- Meshy deleted the Text to Motion clip (the message starts with
Motion clip has expired). Create another Text to Motion task. - The Rigging task's files were deleted after its
expires_at(codeinput_task_expired). Rig the character again.
- Name
429 - Too Many Requests- Description
One of these limits was reached:
- You sent too many requests. Wait the number of seconds in
Retry-After, then retry. - Too many of your tasks are queued or running. Wait for some to finish, then retry.
- On an unlimited plan with no credits left, you reached the number of tasks that can run without credits. Wait for a task to finish, or add credits.
- You sent too many requests. Wait the number of seconds in
List animations
Returns the animations in the library, with the action_id to send when you create a task. This request costs no credits.
The following filters combine. Leave them all out to get the whole library.
Request
# Find waving animations
curl "https://api.meshy.ai/openapi/v2/animations/library?search=wave" \
-H "Authorization: Bearer ${MESHY_API_KEY}"
Response (shortened)
[
{
"action_id": 28,
"name": "Big Wave Hello",
"key": "Big_Wave_Hello",
"category": "DailyActions",
"sub_category": "Interacting",
"preview_url": "https://cdn.meshy.ai/webapp-assets/feature-demo/animation/preview/biped/Big_Wave_Hello.gif",
"rig_type": "biped"
},
{
"action_id": 290,
"name": "Wave One Hand",
"key": "Wave_One_Hand",
"category": "DailyActions",
"sub_category": "Interacting",
"preview_url": "https://cdn.meshy.ai/webapp-assets/feature-demo/animation/preview/biped/Wave_One_Hand.gif",
"rig_type": "biped"
}
]
Parameters
- Name
- search
- Type
- string
- Description
Text to search for. Meshy returns the animations whose
nameorkeycontains this text, ignoring case.
- Name
- category
- Type
- string
- Description
The category to list. For example:
DailyActionsWalkAndRunFightingBodyMovementsDancing
A
quadrupedanimation's category is an animal, for exampledogorhorse. An unknown category returns an empty list.
- Name
- sub_category
- Type
- string
- Description
The subcategory to list, for example
WalkingorInteracting. You can send it withoutcategory.
- Name
- action_ids
- Type
- string
- Description
The animations to list, as up to 200 comma-separated IDs, for example
28,92. More than 200 IDs returns400.
Returns
An array of animations, ordered by action_id. The response has the whole list, with no pages.
- Name
- action_id
- Type
- integer
- Description
The ID to send as
action_idor inaction_ids.
- Name
- name
- Type
- string
- Description
The animation's display name.
- Name
- key
- Type
- string
- Description
The animation's key.
- Name
- category
- Type
- string
- Description
The animation's category. For a
quadrupedanimation, it's an animal, for exampledogorhorse.
- Name
- sub_category
- Type
- string
- Description
The animation's subcategory.
- Name
- preview_url
- Type
- string
- Description
URL to an animated GIF preview of the animation.
- Name
- rig_type
- Type
- string
- Description
The kind of rig the animation plays on,
bipedorquadruped. It matches theanimation_typeof the Rigging task. A rig takes only animations of its own type.
Failure modes
- Name
400 - Bad Request- Description
action_idshas more than 200 IDs, or an item that isn't an integer. The error message says which problem it found. Fix the list, then send the request again. See Errors.
- Name
401 - Unauthorized- Description
The API key is missing or invalid. Check the
Authorizationheader.
- Name
429 - Too Many Requests- Description
You sent too many requests. Wait the number of seconds in
Retry-After, then retry.
Get the result
Read Animation tasks the same way as every other v2 task, through the Tasks routes. To list only Animation tasks, filter by type=animate.
| To | Call |
|---|---|
| Get one task | GET /openapi/v2/tasks/{id} |
| Wait for updates | GET /openapi/v2/tasks/{id}/stream or a webhook |
| List your tasks | GET /openapi/v2/tasks?type=animate |
| Delete a task | DELETE /openapi/v2/tasks/{id} |
Animation output
When the task succeeds, output holds these fields. The rest of the task object is the same for every task type. The URLs in output stop working at expires_at.
curl https://api.meshy.ai/openapi/v2/tasks/01a15cd6-8f9d-711b-89ff-b3f6b4e7c6c6 \
-H "Authorization: Bearer ${MESHY_API_KEY}"Loading…- Name
- animation_glb_url
- Type
- string | null
- Description
Signed URL to the animated character as a GLB file. With
action_ids, the file has every clip.
- Name
- animation_fbx_url
- Type
- string | null
- Description
Signed URL to the animated character as an FBX file. It can be
nullfor amotion_task_idclip that came back as a GLB file only.
- Name
- processed_animation_fps_fbx_url
- Type
- string | null
- Description
Signed URL to the FBX file at the frame rate you asked for.
nullunless you sent"operation_type": "change_fps".
- Name
- processed_usdz_url
- Type
- string | null
- Description
Signed URL to the animation as a USDZ file.
nullunless you sent"operation_type": "fbx2usdz".
- Name
- processed_armature_fbx_url
- Type
- string | null
- Description
Signed URL to the skeleton and its animation without the mesh, as an FBX file.
nullunless you sent"operation_type": "extract_armature".