Meshy 7

This guide shows how to generate 3D assets using the Meshy 7 model via the Leonardo.AI REST API.

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v2/generations \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "model": "meshy/meshy-7",
  "public": false,
  "parameters": {
    "prompt": "A stylized fantasy knight in silver armor with a blue cape",
    "quantity": 1,
    "output_format": "glb",
    "topology": "quad",
    "target_polycount": 30000,
    "geometry_resolution": "standard",
    "symmetry_mode": "auto",
    "pose_mode": "a-pose",
    "should_texture": true,
    "enable_pbr": true,
    "enable_rigging": true,
    "rigging_height_meters": 1.8,
    "enable_animation": true,
    "animation_action_id": 0
  }
}
'

Recipe

API Request Endpoint, Headers, Parameters

Endpoint

https://cloud.leonardo.ai/api/rest/v2/generations

Headers

--header "accept: application/json" \
--header "authorization: Bearer <YOUR_API_KEY>" \
--header "content-type: application/json"

Body Parameters

ParameterTypeDefinition
animation_action_idintegerID of the animation to apply from the Meshy animation library. 0 is Idle. Range: 0–696. Default is 92. Applies only when enable_animation is true.
enable_animationbooleanApplies an animation from the Meshy animation library to the rigged character. Requires enable_rigging to be true. Default is false.
enable_pbrbooleanAdds metallic, roughness, and normal maps for physically based rendering. Applies only when should_texture is true. Default is false.
enable_riggingbooleanAdds a humanoid skeleton to the mesh so that it can be animated. Works best with humanoid characters that have clearly defined limbs. Default is false.
geometry_resolutionstringGeometry detail level. Valid values are standard and 2k (captures finer surface detail). Default is standard.
guidances.image_referencearrayReference images of the object to generate. Maximum 4 items. Each item includes an image object and an optional order (integer, minimum 0). image.type accepts UPLOADED, GENERATED, VARIATION, URL, or BASE64. Use image.id for UPLOADED, GENERATED, and VARIATION, image.url for URL, and image.data (base64-encoded image bytes) for BASE64.
modelstringSpecifies the model used for generation. Set to meshy/meshy-7.
output_formatstringMesh file format for the generated 3D asset. Set to glb.
pose_modestringPose constraint for character meshes. Valid values are none, a-pose, and t-pose. A-pose and T-pose make the mesh easier to rig and animate. Default is none.
promptstringDescribes the object to generate. Required when no image references are provided. When image references are provided, the prompt guides the texturing. Maximum 600 characters.
publicbooleanControls whether the generated asset is public (true) or private (false).
quantityintegerNumber of assets generated per request. Set to 1.
rigging_height_metersnumberApproximate height of the character in meters. Scales the skeleton that rigging adds. Minimum 0.1. Default is 1.7. Applies only when enable_rigging is true.
should_texturebooleanAdds a base color texture to the generated mesh. When false, the mesh is untextured geometry. Default is true.
symmetry_modestringSymmetry of the generated mesh. Valid values are auto (decides from the input), on (enforces symmetry), and off (disables symmetry). Default is auto.
target_polycountintegerTarget number of polygons in the generated mesh. Range: 1000–300000, in multiples of 1000. Default is 30000.
topologystringType of faces in the generated mesh. Valid values are quad (quadrilateral faces, smoother surfaces) and triangle (triangular faces, more detailed geometry). Default is triangle.

Constraints

  • prompt is required when guidances.image_reference is not provided, and accepts up to 600 characters.
  • guidances.image_reference accepts up to 4 reference images per request.
  • quantity is fixed at 1. Only a single asset is generated per request.
  • output_format is fixed at glb.
  • target_polycount accepts values from 1000 to 300000 in multiples of 1000.
  • enable_pbr applies only when should_texture is true.
  • enable_animation requires enable_rigging to be true. animation_action_id applies only when enable_animation is true.
  • rigging_height_meters applies only when enable_rigging is true.

Did this page help you?