lowpoly retires Oct 30, 2026. meshy-7 for 3D generation retires Dec 31, 2026; as a texture model it stays available. Please switch models before these dates to avoid request errors. See all deprecations

Text to Motion API

Generate a character animation from a text prompt, then play it on any two-legged character you rigged with the Rigging API.


POST/openapi/v2/text-to-motion

Create a Text to Motion task

Creates a Text to Motion 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.

To play the motion on a character, see Apply the motion to a character.

PreviewChange a value under “Try and preview” to update
FormatFBX
Cost10 credits
Request
curl https://api.meshy.ai/openapi/v2/text-to-motion \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "prompt": "a person waves hello",
    "duration": 6
  }'
Response
Loading…

Parameters

  • Name
    prompt
    Type
    string
    Required
    Description

    Text that describes the motion to generate, up to 400 characters. For example, A person waves with the right hand, then takes a bow. Longer text returns 400.

    Try and preview

    You can write the prompt in other languages.

  • Name
    duration
    Type
    number
    Required
    Description

    The clip length in seconds, from 2 to 10 in steps of 0.5, for example 3 or 4.5. Any other value returns 400.

    Try and preview
  • Name
    mode
    Type
    string
    default prime
    Description

    The motion model, which also sets the clip's file format.

    Try and preview

    Available values:

    • prime: returns an FBX clip
    • swift: returns a BVH clip

    Any other value returns 400. The two modes cost different amounts. See Pricing.

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 Tasks
  • Retry-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:

    • prompt is missing, blank (prompt must not be empty), or longer than 400 characters
    • duration is missing, outside 2 to 10 seconds, or not a multiple of 0.5 (duration must be between 2 and 10 seconds in 0.5 second steps)

    The error message says which problem it found. See Errors.

  • Name
    401 - Unauthorized
    Description

    The API key is missing or invalid. Check the Authorization header.

  • 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

    Content moderation blocked the prompt. The message is explicit content or prohibited content. Change the prompt, then send the request 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.

Apply the motion to a character

The clip in output.motion_url has the motion on its own, with no character. To play it on your character, wait until the Text to Motion task's status is SUCCEEDED. Then create an Animation task with these parameters:

  • motion_task_id: the Text to Motion task's id
  • rig_task_id: the id of a Rigging task

Create the Animation task within 3 days after the Text to Motion task finishes. After that, Meshy deletes the clip, like other task files, and Animation returns 404. Enterprise accounts keep their files.

Meshy charges for each task separately. See Pricing.

Text to Motion, then Animation

# 1. Generate a 3-second motion
curl https://api.meshy.ai/openapi/v2/text-to-motion \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "prompt": "A person waves with the right hand, then takes a bow",
    "duration": 3
  }'

# 2. When it succeeds, play it on a rigged character
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": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "motion_task_id": "<Text to Motion task ID>"
  }'

Get the result

Read Text to Motion tasks the same way as every other v2 task, through the Tasks routes. To list only Text to Motion tasks, filter by type=text-to-motion.


Text to Motion output

When the task succeeds, output holds these fields. The rest of the task object is the same for every task type. The URL in output stops working at expires_at.

Request
curl https://api.meshy.ai/openapi/v2/tasks/01a157df-f3c8-7433-b18a-5f1304c246d4 \
  -H "Authorization: Bearer ${MESHY_API_KEY}"
Response
Loading…
  • Name
    motion_url
    Type
    string | null
    Description

    Signed URL to the motion clip, an FBX file for prime or a BVH file for swift.

  • Name
    motion_format
    Type
    string
    Description

    The clip's file format, fbx or bvh.

  • Name
    duration_ms
    Type
    integer
    Description

    The clip length you asked for, in milliseconds.

  • Name
    mode
    Type
    string
    Description

    The mode Meshy used to make the clip, prime or swift.