Repair Printability API
Repair a 3D model so it's ready to print. Meshy fixes non-manifold edges, degenerate faces, holes, and other topology issues. You can also thicken walls that are too thin at the size you plan to print.
Create a Repair Printability task
Creates a Repair Printability task, which repairs a 3D model's topology and returns a watertight version ready to print. The task runs in the background. For how long a task usually takes, see Processing times.
The repaired model has the same format as the input. For example, for an .stl file in model_url, model_urls.stl holds the repaired mesh, and model_urls has no other format keys. With input_task_id, Meshy always repairs the source task's GLB file, so the output is a .glb file.
Meshy removes the model's textures during repair, because the geometry changes. To add textures back, send the repaired model to the Retexture API.
Request
# Repair an existing task
curl https://api.meshy.ai/openapi/v1/print/repair \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578"
}'
# Or repair a model URL directly
curl https://api.meshy.ai/openapi/v1/print/repair \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"model_url": "https://example.com/model.stl"
}'
# Also thicken walls that are too thin for a 100 mm tall SLA print
curl https://api.meshy.ai/openapi/v1/print/repair \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"printer_type": "sla",
"intended_print_height_mm": 100
}'
Response
{
"result": "0193bfc5-ee4f-73f8-8525-44b398884ce9"
}
Parameters
- Name
- input_task_id
- Type
- string
- Required
- Description
Required unless you send
model_url. The ID of the task whose model you want to repair, for example an Image to 3D, Multi-Image to 3D, Text to 3D, Remesh, Retexture, or Analyze Printability task. The task must be one you created with the API, with the statusSUCCEEDEDand a GLB model.An Analyze Printability task that checked wall thickness also passes on its printer and size. The repair then checks wall thickness and thickens thin walls, even if you send neither. A
printer_typeor print size you send replaces the one from the analysis. An Analyze Printability task of an.stl,.fbx, or.gltffile frommodel_urldoesn't work. Send that file asmodel_urlinstead.
- Name
- model_url
- Type
- string
- Required
- Description
Required unless you send
input_task_id. The model to repair, as a public URL or a data URI. If you send both, Meshy usesinput_task_id.From an
httporhttpsURL, the model must be a.glb,.gltf,.obj,.fbx, or.stlfile of at most 400 MB. A data URI can hold only a base64 GLB (data:model/gltf-binary;base64,...) or glTF (data:model/gltf+json;base64,...) file of at most 100 MB. Send an.obj,.fbx, or.stlfile as anhttporhttpsURL.A file over 100 MB must also follow these rules:
- A GLB, glTF, FBX, or OBJ file can have at most 10,000,000 faces. Meshy counts faces as triangles, so a quad counts as 2, and a mesh drawn more than once counts once per copy.
- An FBX file must be binary FBX 7.1 or newer.
- A GLB or glTF file must not use Draco compression.
A Meshy download URL (
assets.meshy.ai/…?Expires=…&Signature=…) is signed and stops working at its task'sexpires_at. Reading the task again doesn't renew it. For a model you made with Meshy, sendinput_task_idinstead, which works while Meshy keeps the source task (see Asset retention). To use the model after that, download it beforeexpires_atand send your own copy.
- Name
- alpha_thumbnail
- Type
- boolean
- default false
- Description
Whether to also render a preview with a transparent background (RGBA), returned in
alpha_thumbnail_urlwhen you get the task.thumbnail_urldoesn't change.
To also thicken walls that are too thin at the size you plan to print, send printer_type, a print size, or both. Meshy thickens the walls only when more than 5% of the surface is too thin for that printer. The repaired model keeps its original scale. To scale it, use the Resize API, which takes sizes in meters, so 100 mm is 0.1.
- Name
- printer_type
- Type
- string
- Description
The printer you plan to use. It sets the minimum wall thickness the repair aims for. If you send a print size without
printer_type, Meshy usesfdm, unless an Analyze Printability task ininput_task_idsupplies the printer.Available values:
fdm: filament, 1.0 mm minimum wallsla: resin, 0.8 mm minimum wallfull_color: full-color, 2.0 mm minimum wall
Any other value returns
400.
- Name
- intended_print_height_mm
- Type
- number
- Description
The height of the print, in millimeters, from
1to1000. A value outside the range returns400. Send this orintended_print_longest_side_mm, not both.It works only with GLB input. For a
model_urlthat isn't a.glbfile, sendintended_print_longest_side_mminstead.
- Name
- intended_print_longest_side_mm
- Type
- number
- Description
The length of the print's longest side, in millimeters, from
1to1000. A value outside the range returns400. It works with every input format.
If you send printer_type without a size, and Meshy reuses no size from an Analyze Printability task, Meshy uses this print size:
.glbfile or anyinput_task_id: 150 mm tall.stlfile: the file's own longest side, read as millimeters.obj,.fbx, or.gltffile: 150 mm on the longest side
For an STL file in other units, send intended_print_longest_side_mm.
Meshy rounds both print sizes to the nearest millimeter.
Returns
The result field of the response holds the ID of the new Repair Printability task.
Failure modes
- Name
400 - Bad Request- Description
The request can't run. The error message says which problem it found. For example:
- Missing parameter: Neither
input_task_idnormodel_urlwas sent. - Invalid UUID:
input_task_idisn't a valid UUID. - Invalid model URL:
model_urlis malformed, uses an unsupported scheme, or has an unsupported file extension. - Model file too large: The
model_urlfile is over 400 MB from anhttporhttpsURL, or over 100 MB as a data URI. - Too many faces: The
model_urlfile is a GLB, glTF, FBX, or OBJ file over 100 MB with more than 10,000,000 faces. Reduce the face count, then send the file again. - ASCII FBX over 100 MB: The
model_urlfile is an ASCII FBX over 100 MB. Send it as binary FBX or GLB. - Unreadable model file: The
model_urlfile is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB or glTF, or a binary FBX older than 7.1. - Model header too complex: The
model_urlfile is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. - Model file can't be downloaded:
model_urlreturned an error, most often because a signed Meshy download URL expired. Reading the task again returns the same URL with the same expiry. Send your own copy of the file, or sendinput_task_idwhile Meshy keeps the source task. - Task not succeeded: The
input_task_idtask is still pending, in progress, or failed. - Missing GLB: The
input_task_idtask has no GLB model to repair. - Invalid print size:
intended_print_height_mmorintended_print_longest_side_mmis outside1to1000, or the request has both. - Unknown printer type:
printer_typeisn'tfdm,sla, orfull_color. - Height on a non-GLB model: The request has
intended_print_height_mmand amodel_urlthat isn't a.glbfile. Sendintended_print_longest_side_mminstead. - Can't size this model by height: At the requested height, or the default 150 mm, the model's longest side would be outside 1 to 1,000 mm. It also happens when the model is flat, or when Meshy can't determine its size. Send
intended_print_longest_side_mminstead. For a.glbmodel_urland someinput_task_idtasks, Meshy finds this only after the task starts, and the task ends asFAILEDinstead. - STL size unusable: The request has
printer_typewithout a size, and Meshy can't read the.stlfile's own longest side, or it's outside 1 to 1,000 mm. Sendintended_print_longest_side_mm.
Fix the request, then send it again. See Errors.
- Missing parameter: Neither
- Name
401 - Unauthorized- Description
The API key is missing or invalid. Check the
Authorizationheader.
- 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
input_task_idis a bas-relief model, which this endpoint can't repair. The message isThis model type does not support this operation. Send a different model.
- Name
404 - Not Found- Description
The
input_task_idtask doesn't exist or belongs to another user. Check the ID, and use an API key from the account that created the task.
- Name
429 - Too Many Requests- Description
You exceeded your rate limit, or you have too many pending tasks. Wait, then retry. See Rate limits.
Get a Repair Printability task
Returns a Repair Printability task by its ID.
Request
curl https://api.meshy.ai/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "print-repair",
"status": "SUCCEEDED",
"progress": 100,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000030000,
"expires_at": 1715725401000,
"task_error": null,
"model_urls": {
"stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
"texture_urls": [],
"consumed_credits": 10
}
Response (wall thickness checked)
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "print-repair",
"status": "SUCCEEDED",
"progress": 100,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000090000,
"expires_at": 1715725490000,
"task_error": null,
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
"texture_urls": [],
"consumed_credits": 10,
"intended_print": {
"printer_type": "sla",
"height_mm": 100,
"longest_side_mm": 118,
"wall_thickness_mm": 0.8,
"dimensions_mm": [118, 72.41, 99.87]
},
"print_repair_report": {
"route": "thin_wall",
"applied": true,
"faces_before": 243112,
"faces_after": 251870,
"thin_area_ratio_before": 0.083,
"thin_area_ratio_after": 0.004
}
}
Parameters
- Name
- id
- Type
- path
- Description
The task ID from the create response.
Returns
The Repair Printability task object. Its model_urls field is empty until the task is SUCCEEDED. After that, it has only the key that matches the input format. A wall-thickness repair includes intended_print from the start, and print_repair_report after the task succeeds.
Delete a Repair Printability task
Permanently deletes a Repair Printability task, including its repaired model. You can't undo a delete.
Request
curl --request DELETE \
--url https://api.meshy.ai/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
// 200 OK on success, with an empty body.
//
// 409 Conflict when the task is IN_PROGRESS. The task keeps running:
{
"message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it."
}
Path parameters
- Name
- id
- Type
- path
- Description
The ID of the task to delete.
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.
Returns
200 OK when the task is deleted, or 409 Conflict when the task is
IN_PROGRESS.
List Repair Printability tasks
Returns a list of your Repair Printability tasks.
Request
curl https://api.meshy.ai/openapi/v1/print/repair?page_size=10 \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
[
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "print-repair",
"status": "SUCCEEDED",
"progress": 100,
"preceding_tasks": 0,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000030000,
"expires_at": 1715725401000,
"task_error": null,
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
"texture_urls": [],
"consumed_credits": 10
}
]
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 paginated list of Repair Printability task objects.
Stream a Repair Printability task
Streams a Repair Printability task's updates as Server-Sent Events (SSE).
Request
curl -N https://api.meshy.ai/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response Stream
// Error event example
event: error
data: {
"status_code": 404,
"message": "Task not found"
}
// Message event examples illustrate task progress.
// Every frame is the full task object; fields not yet populated are null / empty.
// The following PENDING frame is abbreviated to the fields that change.
event: message
data: {
"id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f",
"progress": 0,
"status": "PENDING"
}
event: message
data: {
"id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f",
"type": "print-repair",
"status": "SUCCEEDED",
"progress": 100,
"preceding_tasks": 0,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000030000,
"expires_at": 1715725401000,
"task_error": null,
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/preview.png?Expires=***",
"texture_urls": [],
"consumed_credits": 10
}
Parameters
- Name
- id
- Type
- path
- Description
The task ID from the create response.
Returns
A stream of Repair Printability task objects as Server-Sent Events.
Each event holds the full task object, in the same shape the Get endpoint
returns. While the task is PENDING or IN_PROGRESS, its output fields
are empty (null, [], or {}), and finished_at is 0. model_urls
is an empty object until the task is SUCCEEDED.
The Repair Printability task object
A Repair Printability task object describes one repair of a 3D model. It holds the status, the progress, and the repaired model when the task succeeds.
The Repair Printability Task Object
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "print-repair",
"status": "SUCCEEDED",
"progress": 100,
"preceding_tasks": 0,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000030000,
"expires_at": 1715725401000,
"task_error": null,
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
"texture_urls": [],
"consumed_credits": 10
}
The Repair Printability Task Object (wall thickness checked)
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "print-repair",
"status": "SUCCEEDED",
"progress": 100,
"preceding_tasks": 0,
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000090000,
"expires_at": 1715725490000,
"task_error": null,
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
"texture_urls": [],
"consumed_credits": 10,
"intended_print": {
"printer_type": "sla",
"height_mm": 100,
"longest_side_mm": 118,
"wall_thickness_mm": 0.8,
"dimensions_mm": [118, 72.41, 99.87]
},
"print_repair_report": {
"route": "thin_wall",
"applied": true,
"faces_before": 243112,
"faces_after": 251870,
"thin_area_ratio_before": 0.083,
"thin_area_ratio_after": 0.004
}
}
- 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
print-repair.
- Name
- status
- Type
- string
- Description
The task status, one of
PENDING,IN_PROGRESS,SUCCEEDED,FAILED, orCANCELED.
- Name
- progress
- Type
- integer
- Description
How much of the task is done, as a percentage. It's
0until the task starts and100when it succeeds.
- 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.
- 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
0until the task starts.
- Name
- finished_at
- Type
- timestamp
- Description
Time the task finished, in Unix milliseconds. It's
0until the task finishes.
- Name
- expires_at
- Type
- timestamp
- Description
Time the task's result expires, in Unix milliseconds. It's
0until the task finishes.
- Name
- task_error
- Type
- object
- Description
The error details when the task fails. It's
nullif the task hasn't failed. See Errors.- Name
message- Type
- string
- Description
A description of what went wrong.
- Name
- model_urls
- Type
- object
- Description
Download URLs for the repaired model. It has only the key that matches the input format. A format the task didn't generate has no key, rather than an empty string.
- Name
glb- Type
- string
- Description
The repaired GLB file. Set when the input was a GLB file or you sent
input_task_id.
- Name
gltf- Type
- string
- Description
The repaired glTF file. Set when the input was a glTF file.
- Name
fbx- Type
- string
- Description
The repaired FBX file. Set when the input was an FBX file.
- Name
obj- Type
- string
- Description
The repaired OBJ file. Set when the input was an OBJ file.
- Name
stl- Type
- string
- Description
The repaired STL file. Set when the input was an STL file.
- Name
- thumbnail_url
- Type
- string
- Description
Download URL for a preview image of the repaired model.
- Name
- alpha_thumbnail_url
- Type
- string
- Description
Download URL for a version of
thumbnail_urlwith a transparent background (RGBA). Present only when you created the task withalpha_thumbnail: trueand Meshy rendered the transparent preview.
- Name
- texture_urls
- Type
- array
- Description
Always an empty array. Repair keeps only the input geometry and doesn't re-bake textures.
- Name
- consumed_credits
- Type
- integer
- Description
The number of credits the task used. It's
10when the task isSUCCEEDED, and0for aFAILEDtask, because Meshy refunds the credits when a task fails.
- Name
- intended_print
- Type
- object
- Description
The printer and size the repair used, whether you sent them or Meshy reused them from an Analyze Printability task. Present on a wall-thickness repair from the start, including while the task is
PENDING. A value Meshy doesn't know yet isnull.- Name
printer_type- Type
- string
- Description
The printer type,
fdm,sla, orfull_color.
- Name
height_mm- Type
- number
- Description
The print height, in millimeters, when the print is sized by height. Otherwise, it's
null.
- Name
longest_side_mm- Type
- number
- Description
The length of the print's longest side, in millimeters. When the print is sized by height, Meshy calculates it from the model's proportions, and it's
nulluntil Meshy measures the model.
- Name
wall_thickness_mm- Type
- number
- Description
The minimum wall thickness for
printer_type, in millimeters.
- Name
dimensions_mm- Type
- array
- Description
The print's
[width, depth, height], in millimeters. The height can differ fromheight_mmby a fraction of a millimeter. It'snulluntil the task succeeds, and alwaysnullfor input other than GLB.
- Name
- print_repair_report
- Type
- object
- Description
What the wall-thickness repair did. Present after a wall-thickness repair succeeds.
- Name
route- Type
- string
- Description
Which repair ran, one of:
thin_wall: more than 5% of the surface was too thin, so wall thickening also ran. To see whether it changed the mesh, checkapplied.topology: the walls were thick enough, so only the topology repair ran.topology_unmeasured: Meshy couldn't measure the walls, so only the topology repair ran.
- Name
applied- Type
- boolean
- Description
Whether the wall thickening changed the mesh. Present only when
routeisthin_wall.
- Name
faces_before- Type
- integer
- Description
The face count of the input mesh. Present only when
routeisthin_wall.
- Name
faces_after- Type
- integer
- Description
The face count of the repaired mesh. Present only when
routeisthin_wall.
- Name
thin_area_ratio_before- Type
- number
- Description
The share of the input's surface thinner than
intended_print.wall_thickness_mm, from0to1. Left out when Meshy couldn't measure the input.
- Name
thin_area_ratio_after- Type
- number
- Description
The same share, measured on the repaired model. Left out when Meshy couldn't measure it. The task still succeeds.