Convert API
Convert a 3D model to other file formats, from a Meshy task or from your own model file.
Moving from v1? The request is the same as on v1. The main changes for Convert:
- A
model_urlupload keeps its size in every format. - STL and 3MF files follow the v2 model size rules.
- Results are in
output.
Create a Convert task
Creates a Convert 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.
curl https://api.meshy.ai/openapi/v2/convert \
-X POST \
-H "Authorization: Bearer ${MESHY_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"input_task_id": "01a1aeae-1d29-72f0-96ed-0ba2bda780ec",
"target_formats": ["fbx"]
}'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 a Text to 3D, Image to 3D, Remesh, Resize, or Retexture task. The task must be one you created with the API and have the statusSUCCEEDED.A task with quad topology, such as a Remesh task with
topology: quad, keeps its quads in OBJ, FBX, and Blend files. STL, USDZ, 3MF, and GLB files have triangle faces.
- Name
- model_url
- Type
- string
- Required
- Description
Required unless you send
input_task_id. The model to convert, as a public URL or a data URI. Sending bothinput_task_idandmodel_urlreturns400.The model must be a GLB, glTF, OBJ, FBX, or STL file of at most 400 MB from a URL, or 100 MB as a data URI. A data URI must hold a GLB or glTF file (
data:model/gltf-binary;base64,...). A larger file returns400.A file over 100 MB must also follow these rules, or the request returns
400:- 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.
The converted model keeps the file's size. Meshy returns it as one centered mesh, without rigs or animations, so the model doesn't keep its position. See Model size. To keep a model's exact position, convert a Meshy task with
input_task_id.
- Name
- target_formats
- Type
- string[]
- Required
- Description
The file formats to generate. List at least one. A missing or empty list returns
400.Try and previewAvailable values:
glbobjfbxstlusdzblend3mf
Every format keeps the size of the model you convert, except STL and 3MF files of a model Meshy generated. Meshy scales those down to at most 150 mm on the longest side. Uploaded models, and models you resized with
resize_heightorresize_longest_side, keep their own size in every format.A scaled-down STL file, and every 3MF file, has its origin at the bottom. See Model size.
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 - Both
input_task_idandmodel_urlwere sent target_formatsis missing or empty- The input task hasn't succeeded
- The model file can't be downloaded or is too large
- A file over 100 MB has too many faces (
model has too many faces: <N> faces, the limit for files over 100 MB is <limit>) - An FBX file over 100 MB is ASCII (
ASCII FBX files over 100 MB are not supported; use binary FBX or GLB) - A file over 100 MB has a header that can't be read, such as a Draco-compressed GLB or glTF, 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 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 convert. 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.
- 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 Convert tasks the same way as every other v2 task, through the Tasks routes. To list only Convert tasks, filter by type=convert.
| 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=convert |
| Delete a task | DELETE /openapi/v2/tasks/{id} |
Convert 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/01a1af88-5b0a-70b5-a2fe-080019b7e7b9 \
-H "Authorization: Bearer ${MESHY_API_KEY}"Loading…- Name
- model_urls
- Type
- object
- Description
Signed URLs to the converted files, one per format in
target_formats, keyed by format. A texturedobjcomes with anmtl.
- Name
- texture_urls
- Type
- array
- Description
Signed URLs to the model's texture maps, in the same item shape as other tasks. For
input_task_id, these are the texture maps of that task. The array is empty formodel_url, and for a task without texture maps.
Convert tasks have no preview image, so output has no thumbnail_url.