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

API v1 stops working on March 15, 2027. View this page for v2 ยท Migrate to v2

Model Edit API

Change the shape of a 3D model by describing the change in a sentence. Edit the whole model, or select the faces around which the change happens.

Model Edit regenerates the model's geometry and returns an untextured GLB file with a preview image. To texture the edited model, send its task ID to the Retexture API.


POST/openapi/v1/model-edit

Create a Model Edit task

Creates a Model Edit task, which reshapes a model as prompt describes. With selection_face_indices, the change stays around the faces you select. Without it, any part of the model can change.

Meshy checks the model while it handles your request, so a model it can't edit returns 400 before Meshy creates a task. The task then runs in the background, as described in Task lifecycle.

The model must meet all of these requirements:

  • Source: a task listed under input_task_id, or a GLB file you send as model_url
  • Texture: none. A textured model returns 400.
  • Size: at most 4,000,000 faces and 4,000,000 vertices, and at most 134,217,728 bytes (128 MiB) of geometry, counted as 12 bytes per vertex plus 24 bytes per face. A model_url file over 4,000,000 faces returns 400. An input_task_id model over the other two limits returns 400. A model_url file over them, or an input task whose size Meshy has no record of, fails the task with the message The source model is too large to edit, and Meshy refunds its credits.
  • Watertight: a model_url file, or the result of a Repair Printability task, must be a closed surface with no holes. A model_url file that isn't returns 400. To fix it, run Repair Printability on it, then send that task's id as input_task_id. A Repair Printability task whose model still has holes returns 400, and Meshy can't edit that model. A model whose shape Meshy can't measure also returns 400.

A task costs 20 credits. Meshy charges them when it creates the task, and refunds them if the task fails. See Pricing.

Request

POST
/openapi/v1/model-edit
# Edit the faces you selected on a Meshy task's model
curl https://api.meshy.ai/openapi/v1/model-edit \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "input_task_id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
    "prompt": "Add a short horn to the top of the head",
    "selection_face_indices": [1204, 1205, 1206, 1311, 1312]
  }'

# Edit the whole model from a public GLB URL, with a reference image
curl https://api.meshy.ai/openapi/v1/model-edit \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "model_url": "https://example.com/models/dog.glb",
    "prompt": "Give the dog a pair of boots",
    "reference_image_urls": ["https://example.com/images/boots.png"]
  }'

Response

{
  "result": "019ad9e2-5b7c-7a41-9c3e-2f8d6b1a4e07"
}

Parameters

  • Name
    input_task_id
    Type
    string
    Required
    Description

    Required unless you send model_url. The ID of a task whose GLB to edit. The task must be one you created with the API and have the status SUCCEEDED. It must be one of these:

    • A Text to 3D preview task, or an Image to 3D or Multi-Image to 3D task with should_texture: false, made with meshy-6 or a Meshy 7 model, such as meshy-7.1 or latest
    • A Remesh task made with input_task_id from a task in the first item, if it has no texture
    • A Repair Printability task
    • An earlier Model Edit task

    Meshy 6 Lite, Smart Topology (meshy-t2 and meshy-t2.5), and geometry_resolution: "4k" models return 400. A task of another kind, such as Retexture, returns 400 too, except a Relief task, which returns 403.

  • Name
    model_url
    Type
    string
    Required
    Description

    Required unless you send input_task_id. The model to edit, as a public URL or a data URI (data:model/gltf-binary;base64,...). Sending both input_task_id and model_url returns 400.

    The model must be a GLB file of at most 400 MB from an http or https URL whose path ends in .glb, or 100 MB as a data URI. It must not use Draco compression. To edit another format, run Convert to GLB first, download the GLB, and send it as model_url.

  • Name
    prompt
    Type
    string
    Required
    Description

    The change to make, in one sentence, up to 600 characters. Describe a change of shape, such as adding, removing, enlarging, or reshaping a part, for example Give the dog a pair of boots. Longer text returns 400.

    To change color or material, use Retexture.

  • Name
    selection_face_indices
    Type
    integer[]
    Description

    The faces around which to make the change, as indices of the model's triangles. For how Meshy numbers the faces, see Select faces. Leave it out to let any part of the model change.

    Send 1 to 500,000 indices, each from 0 to the model's face count minus 1. Order and repeats don't matter. An empty array, an index past the last face, or a selection too small to change returns 400.

  • Name
    reference_image_urls
    Type
    string[]
    Description

    Up to 5 images that show what the change should look like, each as a public URL or a data URI (data:image/png;base64,...). Each image must be a PNG, JPEG, or WebP file of at most 20 MB. More than 5 images returns 400.

Returns

202 Accepted. The result field of the response holds the ID of the new Model Edit task.

Failure modes

  • Name
    400 - Bad Request
    Description

    The request can't run. For example:

    • Missing input: Neither input_task_id nor model_url was sent, or prompt is only spaces.
    • Invalid parameters: A value breaks a field rule. prompt is missing or longer than 600 characters, selection_face_indices has a negative index or more than 500,000 indices, or there are more than 5 reference_image_urls. The message lists these rules: Invalid parameters: send a prompt of 1 to 600 characters, at most 500000 selection_face_indices of 0 or more, and at most 5 reference_image_urls. The v2 endpoint names each problem instead. See Model Edit API (v2).
    • Conflicting inputs: Both input_task_id and model_url were sent. The message is Provide either input_task_id or model_url, not both.
    • Empty selection: selection_face_indices is an empty array. Leave it out to edit the whole model.
    • Face out of range: An index in selection_face_indices isn't a face of the model. For example, the message is selection_face_indices: face 5000 is out of range: the model has 3322 faces. Number the faces as Select faces describes.
    • Selection too small: The selected faces cover no part of the model that Meshy can change. Select a larger area.
    • Not watertight: The model_url file has holes. The message is model_url: the model is not watertight; repair it with POST /openapi/v1/print/repair first. Run Repair Printability on it, then send that task's id as input_task_id.
    • Still not watertight after repair: The input_task_id Repair Printability task's model still has holes. The message is input_task_id: the repaired model is still not watertight, so it cannot be edited.
    • Can't measure the model: Meshy can't measure the model's shape. For example, the message is model_url: the model could not be measured, so it cannot be edited.
    • Textured model: The model has a texture. The message is Model editing requires an untextured model.
    • Too many faces: The model has more than 4,000,000 faces.
    • Model too large: The input_task_id model is over the vertex or size limit. The message is The source model is too large to edit.
    • Unreadable model: Meshy can't read the GLB file, for example because it uses Draco compression.
    • Unsupported input task: The input_task_id task isn't one this endpoint edits, or hasn't succeeded. For example, the message is Model editing does not support Meshy 6 Lite models.
    • Input task files removed: Meshy deleted the input_task_id task's files after its expires_at. The message is Missing model file. Create the input task again.
    • Unreachable URL: Meshy can't download the model_url file or a reference_image_urls image.
    • Model file too large: The model_url file is over 400 MB from an http or https URL, or over 100 MB as a data URI.
    • Unusable image: A reference_image_urls image is larger than 20 MB, or Meshy can't read it.

    Fix the request, then send it again. See Errors.

  • Name
    401 - Unauthorized
    Description

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

  • Name
    402 - Payment Required
    Description

    For example:

    • Insufficient credits: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry.
    • Free plan: Creating a task requires a paid plan. Upgrade your plan in your subscription settings, then retry.
  • Name
    403 - Forbidden
    Description

    One of these applies:

    • Content moderation blocked the prompt or a reference image. Change the input, then retry.
    • input_task_id is a bas-relief model, which this endpoint can't edit. The message is This model type does not support this operation. Send a different model.
  • Name
    404 - Not Found
    Description

    input_task_id doesn't match any of your tasks. Check the task ID, then send the request again.

  • Name
    429 - Too Many Requests
    Description

    For example:

    • Selection processing is busy: Meshy is converting too many selections. The message is Selection processing is busy; try again shortly. Wait a few seconds, then retry.
    • Rate limit: You exceeded your rate limit, or you have too many pending tasks. Wait, then retry. See Rate limits.
  • Name
    503 - Service Unavailable
    Description

    Meshy couldn't check whether the model is watertight. The message is Could not check whether the model is watertight; try again shortly. Wait a few seconds, then retry.

Meshy charges nothing for a request that returns an error. A task that Meshy created can still fail. For the reasons, see task_error in the Model Edit task object.


Select faces

selection_face_indices names faces by their index among the triangles of the GLB file that the task edits. That file is the input_task_id task's model_urls.glb, or your model_url file.

A model that Meshy generates is a single mesh, so face i is the triangle that indices 3i, 3i + 1, and 3i + 2 of its index buffer make.

Select faces with trimesh

import numpy as np
import requests
import trimesh

# Load the GLB as one mesh, keeping the file's face order
mesh = trimesh.load("model.glb", force="mesh", process=False)

# Select the faces whose center is in the top fifth of the model
# (glTF models are Y-up)
centers = mesh.triangles_center
top = mesh.bounds[1][1] - 0.2 * mesh.extents[1]
selection = np.flatnonzero(centers[:, 1] > top).tolist()

# A request takes 1 to 500,000 indices
assert 1 <= len(selection) <= 500_000, len(selection)

response = requests.post(
    "https://api.meshy.ai/openapi/v1/model-edit",
    headers={"Authorization": f"Bearer {YOUR_API_KEY}"},
    json={
        "input_task_id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
        "prompt": "Add a short horn to the top of the head",
        "selection_face_indices": selection,
    },
)
response.raise_for_status()
print(response.json())

Get the indices from a 3D tool

A tool gives the same indices as Meshy when it keeps the file's triangle order. The following tools keep it for a single-mesh model:

  • trimesh: load the file with process=False.
  • Blender: import the file with the default glTF import settings.
  • three.js: read faceIndex from a raycast hit on a model that GLTFLoader loads.

Any other tool that keeps the order gives the same indices. A step that changes the triangles renumbers the faces, for example merging triangles into quads, a game engine's mesh optimization, or exporting the file again.

Files with more than one mesh

For a file with more than one mesh or primitive, Meshy numbers the triangles in this order:

  1. The nodes of the file's default scene, depth first. Each node's own mesh comes before its children, and nodes come in the order the file lists them.
  2. Within a mesh, each primitive whose mode is TRIANGLES, in order. Meshy doesn't number other primitives, such as triangle strips.
  3. Within a primitive, its triangles in the order its index buffer stores them. A primitive without an index buffer makes a triangle of every three vertices, in order.

How far an edit reaches

Meshy turns the selected faces into a grid of 16 ร— 16 ร— 16 cells over the model, the same way the model editor in the Meshy web app does. The edit works on those cells, so the change reaches about one sixteenth of the model's longest side around the faces you select, not only the faces themselves. Selecting one face selects its whole cell, so an edit can't target an area smaller than a cell. A selection that covers no cell returns 400, so select a larger area.

Meshy regenerates the whole mesh, so the parts outside the selection aren't guaranteed to be identical to the input.

Edit the result again

The edited model is a new mesh with new face indices. Before you edit it again, select the faces on the new model, then send the Model Edit task's id as input_task_id. An edit usually adds faces and vertices, so an edited model can be over the size limits even when its input wasn't.

You can also send the task's id as input_task_id to other endpoints, for example to texture the model with Retexture. An edited model usually has more triangles than Rigging takes, so run Remesh on it before you rig it.


GET/openapi/v1/model-edit/:id

Get a Model Edit task

Returns a Model Edit task by its ID.

Request

GET
/openapi/v1/model-edit/:id
curl https://api.meshy.ai/openapi/v1/model-edit/019ad9e2-5b7c-7a41-9c3e-2f8d6b1a4e07 \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

For an example response, see the example Model Edit task object.

Parameters

  • Name
    id
    Type
    path
    Description

    The task ID from the create response.

Returns

The Model Edit task object.


DELETE/openapi/v1/model-edit/:id

Delete a Model Edit task

Permanently deletes a Model Edit task, including its edited model. You can't undo a delete.

Request

DELETE
/openapi/v1/model-edit/:id
curl https://api.meshy.ai/openapi/v1/model-edit/019ad9e2-5b7c-7a41-9c3e-2f8d6b1a4e07 \
  -X DELETE \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Task status

Deleting a PENDING task refunds the credits it used when you created it.

An IN_PROGRESS task can't be deleted. The request returns 409 Conflict, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach SUCCEEDED, FAILED, or CANCELED, then delete it.

Deleting a task in a final status (SUCCEEDED, FAILED, or CANCELED) doesn't refund its credits.


GET/openapi/v1/model-edit

List Model Edit tasks

Returns a list of your Model Edit tasks, newest first unless you set sort_by.

Request

GET
/openapi/v1/model-edit
curl "https://api.meshy.ai/openapi/v1/model-edit?page_num=1&page_size=10" \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Parameters

  • Name
    page_num
    Type
    integer
    default 1
    Description

    The page number to return, starting at 1.

  • Name
    page_size
    Type
    integer
    default 10
    Description

    The number of tasks per page, up to 100.

  • Name
    sort_by
    Type
    string
    Description

    The sort order.

    Available values:

    • +created_at: oldest first
    • -created_at: newest first

Returns

A list of Model Edit task objects. An empty page is an empty array.


GET/openapi/v1/model-edit/:id/stream

Stream a Model Edit task

Streams a Model Edit task's updates as Server-Sent Events (SSE). To learn sooner that the task finished, use this endpoint instead of polling GET /openapi/v1/model-edit/:id.

Request

GET
/openapi/v1/model-edit/:id/stream
curl https://api.meshy.ai/openapi/v1/model-edit/019ad9e2-5b7c-7a41-9c3e-2f8d6b1a4e07/stream \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -N

Parameters

  • Name
    id
    Type
    path
    Description

    The task ID from the create response.

Returns

A stream of Model Edit task objects as Server-Sent Events.

Each message event holds the full task object, in the same shape the Get endpoint returns. While the task is PENDING or IN_PROGRESS, its result fields don't have values yet. model_urls is empty, and thumbnail_url is "". To follow the task, watch status and progress.

The stream closes after the event of a task that reached SUCCEEDED, FAILED, or CANCELED. An error event ends the stream early, for example when the task isn't found.


The Model Edit task object

A Model Edit task object describes one edit of a 3D model. It holds the status, the progress, and the edited model when the task succeeds.

Example Model Edit Task Object

{
  "id": "019ad9e2-5b7c-7a41-9c3e-2f8d6b1a4e07",
  "type": "model-edit",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/019ad9e2-5b7c-7a41-9c3e-2f8d6b1a4e07/output/model.glb?Expires=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/019ad9e2-5b7c-7a41-9c3e-2f8d6b1a4e07/output/preview.png?Expires=***",
  "texture_urls": null,
  "progress": 100,
  "status": "SUCCEEDED",
  "created_at": 1796421600000,
  "started_at": 1796421605000,
  "finished_at": 1796421672000,
  "expires_at": 1796680872000,
  "task_error": null,
  "consumed_credits": 20
}
  • Name
    id
    Type
    string
    Description

    The task ID. Treat it as an opaque string, and don't rely on its format.

  • Name
    type
    Type
    string
    Description

    The task type, always model-edit.

  • Name
    model_urls
    Type
    object
    Description

    Signed download URLs for the edited model. Model Edit always returns a single glb key. The model has no texture, and its faces are numbered anew.

  • Name
    thumbnail_url
    Type
    string
    Description

    Signed download URL for a PNG preview image of the edited model.

  • Name
    texture_urls
    Type
    array
    Description

    Always null. The edited model has no texture.

  • Name
    progress
    Type
    integer
    Description

    How much of the task is done, as a percentage from 0 to 100.

  • Name
    status
    Type
    string
    Description

    The task status, one of PENDING, IN_PROGRESS, SUCCEEDED, FAILED, or CANCELED.

  • Name
    preceding_tasks
    Type
    integer
    Description

    The number of tasks ahead of this one in the queue. The value is meaningful only while the task is PENDING. The field is left out when the value is 0.

  • Name
    created_at
    Type
    timestamp
    Description

    Time the task was created, in Unix milliseconds.

  • Name
    started_at
    Type
    timestamp
    Description

    Time the task started, in Unix milliseconds. It's 0 until the task starts.

  • Name
    finished_at
    Type
    timestamp
    Description

    Time the task finished, in Unix milliseconds. It's 0 until the task finishes.

  • Name
    expires_at
    Type
    timestamp
    Description

    Time the signed download URLs expire, in Unix milliseconds. Meshy keeps the edited model for 3 days after the task finishes, so download it, or send the task to another endpoint, before then. See Asset retention.

  • Name
    task_error
    Type
    object
    Description

    The error details when the task fails, and null otherwise. Two codes are specific to Model Edit:

    See Errors.

  • Name
    consumed_credits
    Type
    integer
    Description

    The number of credits the task used, 20 for a Model Edit task. It's 0 for a FAILED task, because Meshy refunds the credits when a task fails.