Multi-Color Print API
Turn a textured 3D model into a multi-color 3MF file. Meshy reduces the model's colors to a filament palette and adds a slicer preset for your printer brand.
Moving from v1? The request is the same. The main changes for Multi-Color Print:
- The 3MF file follows the v2 model size rules.
- The 3MF URL is in
output.model_urlsinstead of the top-levelmodel_urls. - The empty fields v1 returned are gone.
Create a Multi-Color Print task
Creates a Multi-Color Print 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.
The model must have color. The realistic style needs a base color texture, and the cartoon style also accepts vertex colors. Meshy checks most models when you create the task, and a model without the color that style needs returns 400. Some models can only be checked while the task runs, for example an FBX upload, and the task fails instead. To add color, texture the model first, for example with Retexture.
The 3MF file has its origin at the bottom. For a model Meshy generated, Meshy scales the file down to at most 150 mm on the longest side. Uploaded and resized models keep their own size. See Model size.
curl https://api.meshy.ai/openapi/v2/print/multi-color \
-X POST \
-H "Authorization: Bearer ${MESHY_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"input_task_id": "01a1aeae-1d29-72f0-96ed-0ba2bda780ec"
}'Parameters
- Name
- input_task_id
- Type
- string
- Required
- Description
Required unless you send
model_url. The ID of a task that produced a 3D model, for example Text to 3D, Image to 3D, Retexture, or Remesh. The task must be one you created with the API, and have the statusSUCCEEDED.Multi-Color Print reads the task's GLB file, which 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.
- Name
- model_url
- Type
- string
- Required
- Description
Required unless you send
input_task_id. The model to print, as a public URL or a data URI (data:model/gltf-binary;base64,...). Sending bothinput_task_idandmodel_urlreturns400.A URL must point to a GLB or FBX file of at most 400 MB. A data URI must hold a GLB file of at most 100 MB. A larger file returns
400.A file over 100 MB can have at most 8,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. Over 100 MB, an FBX file must be binary FBX 7.1 or newer, and a GLB file must not use Draco compression. A file that breaks these rules returns
400.
- Name
- max_colors
- Type
- integer
- default 4
- Description
The maximum number of colors in the printed model, from
1to16. A negative value or one over16returns400. To use the default, leave it out rather than sending0.Try and preview
- Name
- style
- Type
- string
- default realistic
- Description
How Meshy places colors on the model.
Try and previewAvailable values:
realistic: samples the texture for fine detail, and makes a larger file. The model needs a single base color texture, with UVs on every part.cartoon: makes flat, uniform color regions, and a smaller file. It also works with vertex colors.
- Name
- max_depth
- Type
- integer
- default 4
- Description
How finely Meshy samples the texture onto the mesh, from
3to6. Any other value returns400, except0, which is the same as leaving it out. Higher values keep finer color detail, and make a larger file. Only therealisticstyle uses this setting.
- Name
- printer_brand
- Type
- string
- default bambu
- Description
The printer brand whose slicer preset Meshy saves in the 3MF file, so the file opens with a matching printer, filament, and process profile. The preset uses the brand's default printer, with a 0.4 mm nozzle.
Available values:
bambuanycubiccrealityelegooflashforgeprusaqidisnapmakerankermake
Any other value returns
400.
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 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:
- Neither
input_task_idnormodel_urlwas sent (codeparameter_missing). - Both
input_task_idandmodel_urlwere sent (codeparameters_conflict). - The input task hasn't succeeded, or wasn't created with the API.
- The input task's model has more than 8,000,000 faces. Run a Remesh task on it, then send the Remesh task's
idinstead. model_urlisn't a GLB or FBX file, can't be downloaded, or is too large.- A
model_urlfile over 100 MB has too many faces (model has too many faces: <N> faces, the limit for files over 100 MB is <limit>). Reduce the face count, then send the file again. - An FBX file over 100 MB is ASCII (
ASCII FBX files over 100 MB are not supported; use binary FBX or GLB). Send it as binary FBX or GLB. - A file over 100 MB has a header Meshy can't read, such as a Draco-compressed GLB, or a binary FBX older than 7.1 (
invalid model file content). - A file over 100 MB has a header too complex to check (
model header is too complex to check for files over 100 MB). - The model lacks the color the chosen
styleneeds, for exampleThe input model has no color information ...orstyle=realistic requires .... Texture the model first. If the model has vertex colors, you can also switch to thecartoonstyle.
The error message says which problem it found. See Errors.
- Neither
- 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
input_task_idis a bas-relief model, which this endpoint can't print. The message isThis model type does not support this operation. Send a different model.
- 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 too many requests. Wait the number of seconds in
Get the result
Read Multi-Color Print tasks the same way as every other v2 task, through the Tasks routes. To list only Multi-Color Print tasks, filter by type=print-multi-color.
| 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-multi-color |
| Delete a task | DELETE /openapi/v2/tasks/{id} |
Multi-Color Print output
When the task succeeds, output holds this field. 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/01a1af92-9157-74a4-8d7b-918946249216 \
-H "Authorization: Bearer ${MESHY_API_KEY}"Loading…- Name
- model_urls
- Type
- object
- Description
Signed URL to the multi-color model, as one file with the key
3mf.
Multi-Color Print tasks have no preview image, so output has no thumbnail_url.
Meshy can check some models for color only while the task runs, for example an FBX upload. If such a model lacks the color that style needs, the task fails with task_error.code set to model_missing_texture. Texture the model first. If the model has vertex colors, you can also switch to the cartoon style. See Errors.