Auto Split API
Cut a generated model into parts you can print separately. Meshy chooses the cuts, or cuts along the parts or colors you name, and can add connectors so the printed parts fit back together.
Moving from v1? The request is the same. The main changes for Auto Split:
model_urls,thumbnail_url, andpart_countare inoutput.prompt_ignoredstays at the top level.
Create an Auto Split task
Creates an Auto Split 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.
With by_parts or by_color, Meshy reads your prompt before it answers. The create request then usually takes a few seconds longer, and can take up to about a minute. Set your HTTP timeout to allow for that.
Parameters
- Name
- input_task_id
- Type
- string
- Required
- Description
The ID of the task whose model to split. The task must be one of yours, and have the status
SUCCEEDED. These tasks work:- Image to 3D
- Multi-Image to 3D
- Text to 3D, a preview, refine, or one-call task
- A Retexture, Remesh, Convert, or Resize task of one of the preceding tasks
The model must be generated with Meshy 6 or Meshy 7, including
meshy-6-lite. Smart Topology models return400. A Retexture, Remesh, Convert, or Resize task made from an uploaded model also returns400.The model can have at most 8,000,000 faces. A model with more faces returns
400. In that case, run a Remesh task on it first, and send the Remesh task'sidinstead.You can split a textured model. To keep its texture on the parts, send
keep_texture: true.
- Name
- mode
- Type
- string
- default auto
- Description
How to divide the model.
Try and previewAvailable values:
auto: Meshy chooses the cuts.by_parts: cuts into the parts you name inprompt, for example head, torso, and legs.by_color: cuts along the color regions you name inprompt. Meshy finds the regions in the image the model was generated from, so the input must come from Image to 3D or Multi-Image to 3D. For Multi-Image to 3D, Meshy uses the first image. Other inputs return400.
mode = by_parts or by_color- Name
- prompt
- Type
- string
- Required
- Description
Required for
by_partsandby_color. The parts to split the model into, in any language, up to 600 characters. Longer text returns400, even whenmodeisauto.Name 1 to 10 parts, for example
head, torso, left arm, right arm, legs. If the parts you name don't cover the whole model, the rest of it becomes one more part. For example,the headsplits the head off the rest of the model. That extra part counts toward the limit of 10. A prompt that names more than 10 parts, or asks for no split, returns400.If Meshy can't find any part in the prompt, it splits the model into the parts it finds in the model's reference image instead. The mode stays the same. Meshy still charges the task, and sets
prompt_ignored: true. The reference image is your input image. For Text to 3D, it's the image Meshy generated for the model, when there is one.If there is no reference image, or Meshy finds fewer than 2 parts in it, the request returns
400with the messageCould not understand the split description. Meshy doesn't charge for a request that returns400.
- Name
- target_formats
- Type
- string[]
- default ["glb"]
- Description
The file formats to generate. Meshy always returns a GLB file, plus the other formats you list.
Available values:
glbobjfbxstlusdzblend3mf
Any other value returns
400.In a 3MF file, each part is its own object, ready for a slicer. An STL file can't hold separate objects, so Meshy fuses the parts into one solid.
With
keep_texture: true, GLB, FBX, USDZ, and Blend files hold the texture, and an OBJ file comes with its.mtlfile. STL and 3MF files hold geometry only.Meshy scales an STL or 3MF file down to at most 150 mm on the longest side. A smaller model keeps its size.
- Name
- layout
- Type
- string
- default assembled
- Description
How Meshy arranges the parts, in every file and in the preview.
Try and previewAvailable values:
assembled: the parts stay where they were in the model.on_plate: Meshy lays the parts flat and spreads them out on a build plate, ready to slice. In this layout, an OBJ file is Z-up, in millimeters, and also scaled down to at most 150 mm on its longest side.
- Name
- keep_texture
- Type
- boolean
- default false
- Description
Whether to keep the input model's texture on the parts.
truegives every part the input's texture, andoutput.texture_urlslists the maps.falsegives each part a flat color.With
true, the task takes about twice as long, and the credit cost doesn't change. An untextured input splits the same way as withfalse. If Meshy can't keep the texture, the task fails with the error codetextured_split_refused. See Errors.
- Name
- connectors
- Type
- boolean
- default false
- Description
Whether to add mortise-and-tenon connectors at each cut, so the printed parts fit together.
falsesplits the model without connectors.Try and previewIf Meshy can't place the connectors, the split still succeeds without them. The response doesn't say whether Meshy placed them.
connectors = true- Name
- connector_type
- Type
- string
- default cube
- Description
The connector's shape,
cubeorcylinder.
- Name
- connector_size
- Type
- number
- default 0.5
- Description
The connector's size, as a fraction of the widest circle that fits in the cut face, from
0.1to0.8. A value outside this range returns400, even whenconnectorsisfalse.
- Name
- connector_height
- Type
- number
- default 0.1
- Description
How far the connector sticks out of the cut, in the units of the GLB file, from
0.1to0.8. A value outside this range returns400, even whenconnectorsisfalse.
Returns
202 Accepted with the task object. The task starts as PENDING, with your request in input and output set to null. If Meshy split the model into the parts it found instead of the ones in your prompt, the task also has prompt_ignored: true.
Two response headers help you read the task:
Location: the task's URL on TasksRetry-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:
input_task_idis missing.- The input task hasn't succeeded, or isn't a supported type (
Input task mode does not support splitting; ...). - The model wasn't generated with Meshy 6 or Meshy 7 (
Auto Split requires a model generated with Meshy 6 or Meshy 7). promptis missing forby_partsorby_color.by_colorwas sent for a model that wasn't made from an image. Sendby_partsorautoinstead.- The prompt names no usable split, for example it asks for one piece or names more than 10 parts. Name the parts to split into, up to 10.
The error message says which problem it found. See Errors.
- Name
401 - Unauthorized- Description
The API key is missing or invalid. Check the
Authorizationheader.
- 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
One of these applies:
- Content moderation blocked the prompt. The message is
explicit contentorprohibited content. Change the prompt, then retry. input_task_idis a bas-relief model, which this endpoint can't split. The message isThis model type does not support this operation. Send a different model.
- Content moderation blocked the prompt. The message is
- Name
404 - Not Found- Description
input_task_iddoesn't match any of your tasks. The message isinput_task_id does not match any of your tasks. Check the ID, and use an API key from the account that created the task.A task of yours past its retention period returns the code
input_task_expiredinstead.
- 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.
- You sent more than 12 prompts in a minute with
by_partsorby_color. This limit is per user, and splits you make in the Meshy web app count toward it. Wait a moment, then retry.
- You sent too many requests. Wait the number of seconds in
- Name
503 - Service Unavailable- Description
Meshy is too busy to read the prompt. The message is
Prompt parsing is busy right now; retry shortly. Retry later, or sendmode: "auto". Meshy doesn't charge for this response.
Get the result
Read Auto Split tasks the same way as every other v2 task, through the Tasks routes. To list only Auto Split tasks, filter by type=print-split.
| To | Call |
|---|---|
| Get one task | GET /openapi/v2/tasks/{id} |
| Wait for updates | GET /openapi/v2/tasks/{id}/stream or a webhook |
| List your tasks | GET /openapi/v2/tasks?type=print-split |
| Delete a task | DELETE /openapi/v2/tasks/{id} |
Auto Split output
When the task succeeds, output holds these fields. The rest of the task object is the same for every task type. The URLs in output stop working at expires_at.
curl https://api.meshy.ai/openapi/v2/tasks/01a1af93-c71d-76fa-8d54-8999f01ce84f \
-H "Authorization: Bearer ${MESHY_API_KEY}"Loading…- Name
- model_urls
- Type
- object
- Description
Signed URLs to the split model, keyed by format. There is always a
glbkey, plus one key for each other format intarget_formats. Anobjwith a texture also gets anmtlkey, with the URL of its material file.
- Name
- thumbnail_url
- Type
- string | null
- Description
Signed URL to a preview in the
layoutyou asked for. It shows the texture when the parts keep one, and gives each part its own color otherwise.
- Name
- texture_urls
- Type
- array
- Description
The texture maps that all the parts share, as one item with a signed URL for each of these maps:
base_colormetallicroughnessnormal
A map the input doesn't have is
null. Present only whenkeep_textureistrueand the input model is textured. Otherwise, each part has a flat color, and the field is absent.
- Name
- part_count
- Type
- integer | null
- Description
The number of parts Meshy split the model into. With
by_partsorby_color, this can differ from the number of parts you named, because one name can become several parts, or none.
The task object can also have prompt_ignored: true at the top level, from the create response on. Meshy adds it when it split the model into the parts it found instead of the ones in your prompt, and leaves it out otherwise.
If a safety check declines the input model, the task fails with task_error.type set to invalid_input and task_error.code set to provider_content_refused. Send a different model. See Errors.
With keep_texture: true, if Meshy can't keep the texture, the task fails with task_error.code set to textured_split_refused. See Errors.