Generate character motion clips from natural-language descriptions. Describe an action — "a character waving", "a zombie shambling forward" — and receive a raw motion clip you can retarget onto rigged characters in your own pipeline or DCC tools.
The output is a standalone motion clip: it does not require, and is not attached to, a character model. To rig a character first, see the Rigging API.
This endpoint creates a new task to generate a motion clip from a text prompt.
A task with modeprime costs 10 credits and generates with our highest-quality motion model. A task with modeswift costs 3 credits and generates faster with our economical motion model.
Parameters
Name
prompt
Type
string
Required
Description
A natural-language description of the motion to generate. Maximum 400 characters.
Name
mode
Type
string
default prime
Description
The motion generation mode. Available values: prime, swift. prime produces the highest quality and outputs FBX; swift is faster and cheaper and outputs BVH.
Name
duration
Type
number
Required
Description
The target duration of the motion clip in seconds. Between 2 and 10, in steps of 0.5 (for example 2, 2.5, 3, … 10).
Returns
The result property of the response contains the task id of the newly created Text to Motion task.
Failure Modes
Name
400 - Bad Request
Description
The request was unacceptable. Common causes:
Missing or empty prompt: prompt is missing, blank, or longer than 400 characters.
Invalid mode: mode is not prime or swift.
Invalid duration: duration is missing, outside 2–10, or not on a 0.5 second step.
Name
401 - Unauthorized
Description
Authentication failed. Please check your API key.
Name
402 - Payment Required
Description
Insufficient credits to perform this task.
Name
403 - Forbidden
Description
The prompt was flagged by content moderation.
Name
429 - Too Many Requests
Description
You have exceeded your rate limit.
Request
POST
/openapi/v1/text-to-motion
# Generate a motion clip with required params onlycurlhttps://api.meshy.ai/openapi/v1/text-to-motion \-XPOST \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "prompt": "a character waving", "duration": 3 }'# Generate a fast, economical clip with Swift modecurlhttps://api.meshy.ai/openapi/v1/text-to-motion \-XPOST \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "prompt": "a character waving", "mode": "swift", "duration": 4.5 }'
This endpoint allows you to retrieve a Text to Motion task given a valid task id. Refer to The Text to Motion Task Object to see which properties are included.
Parameters
Name
id
Type
path
Description
Unique identifier for the Text to Motion task to retrieve.
Note that tasks created through the API are managed through the API — they do not appear in the web app's My Assets. Use this endpoint to find a task whose ID you no longer have.
Every message event carries the full task object. While the task is PENDING or IN_PROGRESS, the result fields are still empty ("" / 0) and finished_at / expires_at are 0; watch status and progress.
The Text to Motion Task object represents the work unit for generating a motion clip from a text prompt.
Properties
Name
id
Type
string
Description
Unique identifier for the task.
Name
type
Type
string
Description
Type of the task. The value is text-to-motion.
Name
status
Type
string
Description
Status of the task. Possible values: PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED.
Name
progress
Type
integer
Description
Progress of the task (0-100).
Name
created_at
Type
timestamp
Description
Timestamp (milliseconds since epoch) when the task was created.
A timestamp represents the number of milliseconds elapsed since January 1, 1970 UTC, following
the RFC 3339 standard.
For example, Friday, September 1, 2023 12:00:00 PM GMT is represented as 1693569600000. This applies
to all timestamps in Meshy API.
Name
started_at
Type
timestamp
Description
Timestamp (milliseconds since epoch) when the task started processing. 0 if not started.
Name
finished_at
Type
timestamp
Description
Timestamp (milliseconds since epoch) when the task finished. 0 if not finished.
Name
expires_at
Type
timestamp
Description
Timestamp (milliseconds since epoch) when the task result assets expire. 0 until the task finishes. The generated clip is retained for 3 days after the task finishes; download it before it expires.
Name
preceding_tasks
Type
integer
Description
The count of preceding tasks in the queue. Meaningful only if status is PENDING; omitted when zero.
Name
consumed_credits
Type
integer
Description
The number of credits consumed by this task. 10 for prime mode, 3 for swift mode. Returns 0 for FAILED tasks (credits are refunded on failure).
Name
task_error
Type
object
Description
Error details for failed tasks; null unless the task FAILED. See Errors for the full task_error object reference.
Name
result
Type
object
Description
Contains the generated motion clip once the task SUCCEEDED; until then the fields are present but empty ("" / 0).
Name
motion_url
Type
string
Description
Downloadable URL for the generated motion clip. The URL is re-signed on every read and expires with the task's retention window.
Name
motion_format
Type
string
Description
File format of the clip: fbx for prime mode, bvh for swift mode.
Name
duration_ms
Type
integer
Description
Duration of the generated clip in milliseconds.
Name
mode
Type
string
Description
The mode the clip was generated with: prime or swift.