Tasks
Get, list, stream, and delete every v2 task through four routes under /openapi/v2/tasks. Every v2 endpoint that creates a task returns the same task object.
Moving from v1? The main changes for reading tasks:
- The routes on this page replace the per-endpoint read routes, such as
GET /openapi/v1/image-to-3d/{id}. - Results are in
output.
How a task runs
A create request returns the task object right away, without waiting for the result. The task then runs in the background and moves through these statuses:
PENDING. A worker picks it up and it moves to IN_PROGRESS, where it spends most of its time. It ends in SUCCEEDED or FAILED, and a final status never changes.PENDINGIN_PROGRESSSUCCEEDEDoutputFAILEDThis table shows what your code should do in each status.
| Status | What your code should do |
|---|---|
PENDING | Keep waiting. preceding_tasks is the task's position in the queue, and 1 means it starts next. |
IN_PROGRESS | Keep waiting. progress says how much of the work is done. |
SUCCEEDED | Download the files in output before expires_at. |
FAILED | Read task_error, then fix the input or create another task. See Errors. |
CANCELED | Stop waiting. The task doesn't produce a result. No v2 task type uses this status, but treat it as final. |
To follow a task, use one of these:
- Get the task until it finishes.
- Stream the task.
- Receive a webhook.
From your code, getting the task until it finishes looks like this:
Request: POST/image-to-3d
Response: 202{ "id": "<task_id>","status": "PENDING" }Location: /tasks/<task_id>task created
- Repeat after
Retry-AftersecondsRequest: GET/tasks/<task_id>
Response: 200{ "status": "IN_PROGRESS","progress": 45 }Retry-After: 5
Request: GET/tasks/<task_id>
Response: 200{ "status": "SUCCEEDED","output": { "model_urls": { "glb": "…" } } }
Two response headers help you follow a task:
Location: the path to read the task from,/openapi/v2/tasks/{id}. It's on the create response.Retry-After: how many seconds to wait before you poll again. It's on the create response, and on every read of aPENDINGorIN_PROGRESStask. The value is a hint, and it's shorter when the task is about to start or finish. A task that's already finished gets noRetry-After, for example when Analyze Printability returns a cached result right away. If the header is missing, wait 5 seconds. Polls count toward your rate limit.
For typical processing times, and how long your code should wait before it gives up, see Processing times. The task keeps running even if your code stops waiting.
To get notified instead of polling, use a webhook with Payload version set to v2 on the Webhooks page. Each delivery carries the task object, with the header Meshy-Webhook-Version: v2. See Webhooks.
The task object
The create response, every read route on this page, and each v2 webhook delivery return this object. Only input and output depend on the task type.
A task in progress
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"status": "IN_PROGRESS",
"progress": 42,
"created_at": 1791846275575,
"started_at": 1791846275578,
"finished_at": null,
"expires_at": null,
"preceding_tasks": 0,
"consumed_credits": 30,
"task_error": null,
"input": {
"image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
"texture_model": "meshy-7"
},
"output": null
}
A succeeded task
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"status": "SUCCEEDED",
"progress": 100,
"created_at": 1791846275575,
"started_at": 1791846275578,
"finished_at": 1791846334536,
"expires_at": 1792105534536,
"preceding_tasks": 0,
"consumed_credits": 30,
"task_error": null,
"input": {
"image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
"texture_model": "meshy-7"
},
"output": {
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
"thumbnail_urls": null,
"texture_urls": [
{
"base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
"metallic": null,
"roughness": null,
"normal": null,
"metallic_roughness": null,
"emission": null
}
]
}
}
A failed task
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "convert",
"status": "FAILED",
"progress": 0,
"created_at": 1790911760868,
"started_at": 1790911760873,
"finished_at": 1790911770684,
"expires_at": null,
"preceding_tasks": 0,
"consumed_credits": 0,
"task_error": {
"type": "invalid_input",
"code": "invalid_input",
"message": "No valid objects found in uploaded model. The file may be empty or contain no importable geometry.",
"doc_url": "https://docs.meshy.ai/en/api/v2/errors#invalid-input"
},
"input": {
"model_url": "https://example.com/model.glb",
"target_formats": ["fbx"]
},
"output": null
}
- Name
- id
- Type
- string
- Description
The task ID. Use it with the routes on this page.
- Name
- type
- Type
- string
- Description
The task type, set by the endpoint that created the task. See Task types. Meshy adds a type for each new endpoint, so skip or log types your code doesn't handle.
- Name
- status
- Type
- string
- Description
The task's status. See How a task runs.
Available values:
PENDING: waiting in the queueIN_PROGRESS: generating the resultSUCCEEDED: final, with the results inoutputFAILED: final, with the reason intask_errorCANCELED: final, with no result
- Name
- progress
- Type
- integer
- Description
Percentage of the work done, from
0to100. It's100when the task succeeds.
- Name
- created_at
- Type
- integer
- Description
Time the task was created, in Unix milliseconds.
- Name
- started_at
- Type
- integer | null
- Description
Time a worker started the task, in Unix milliseconds.
nulluntil then.
- Name
- finished_at
- Type
- integer | null
- Description
Time the task reached a final status, in Unix milliseconds.
nulluntil then.
- Name
- expires_at
- Type
- integer | null
- Description
Time the signed URLs in
outputstop working, in Unix milliseconds. It's 3 days afterfinished_at.nulluntil the task succeeds. Alwaysnullfor Text to 3D tasks, and for Enterprise plans, which keep files indefinitely. See Asset retention.
- Name
- preceding_tasks
- Type
- integer
- Description
The task's position in the queue while it's
PENDING.1means it starts next.0after the task leaves the queue, and always0in list results.
- Name
- consumed_credits
- Type
- integer | null
- Description
Number of credits charged for the task, after any refund.
0for a failed task.nullif Meshy couldn't read the charge. In that case, get the task again.
- Name
- task_error
- Type
- object | null
- Description
The reason the task failed, with these fields:
typecodemessagedoc_url
nullunlessstatusisFAILED. See Errors.
- Name
- input
- Type
- object | null
- Description
The parameters you sent to create the task, as you sent them. Meshy doesn't fill in defaults you left out, and it leaves out keys the endpoint doesn't accept.
An image you sent as a data URI comes back as a signed URL to Meshy's copy, or shortened if there's no copy. A task created on v1 keeps its v1 parameter names.
nullwhen Meshy has no saved copy of the request. This happens for a moment right after the task is created, and for some older tasks.
- Name
- output
- Type
- object | null
- Description
The results, shaped by
type.nulluntil the task succeeds. Each endpoint page describes its output, and Task types lists the fields.
Every field in the preceding list is always present:
- A value that doesn't exist yet is
null, never0or"". - Arrays are never
null, exceptdimensions_mmin anintended_printobject.
Two task types can add one more top-level field:
- Auto Split can add
prompt_ignored. - Repair Printability adds
intended_printto every task created on v2.
Meshy can add fields at any time, so ignore fields you don't use.
Task types
The type field and the type filter on List tasks use these values. Each endpoint page describes its output in full.
type | Created by | output fields |
|---|---|---|
text-to-3d-preview | Text to 3D, preview | model_urls, thumbnail_url, alpha_thumbnail_url, texture_urls |
text-to-3d-refine | Text to 3D, refine | model_urls, thumbnail_url, alpha_thumbnail_url, texture_urls |
text-to-3d | Text to 3D, in one call | model_urls, thumbnail_url, alpha_thumbnail_url, texture_urls |
image-to-3d | Image to 3D | model_urls, thumbnail_url, thumbnail_urls, texture_urls |
multi-image-to-3d | Multi-Image to 3D | model_urls, thumbnail_url, thumbnail_urls, texture_urls |
remesh | Remesh | model_urls, thumbnail_url, texture_urls |
convert | Convert | model_urls, texture_urls |
resize | Resize | model_urls, texture_urls |
uv-unwrap | UV Unwrap | model_urls, thumbnail_url |
rig | Rigging | rigged_character_glb_url, rigged_character_fbx_url, basic_animations |
rig-check | Rigging Check | riggable, animation_type, animatable, reasons |
animate | Animation | animation_glb_url, animation_fbx_url, processed_usdz_url, processed_armature_fbx_url, processed_animation_fps_fbx_url |
text-to-motion | Text to Motion | motion_url, motion_format, duration_ms, mode |
retexture | Retexture | model_urls, thumbnail_url, texture_urls |
text-to-image | Text to Image | image_urls |
image-to-image | Image to Image | image_urls |
print-multi-color | Multi-Color Print | model_urls |
print-analyze | Analyze Printability | printability |
print-repair | Repair Printability | model_urls, thumbnail_url, print_repair_report |
print-split | Auto Split | model_urls, thumbnail_url, part_count |
relief | Relief | model_urls, texture_urls, depth_map_url, thumbnail_url |
A few rules hold for every type:
model_urlshas one key per file format the task produced, such asglborfbx. Formats the task didn't produce have no key.- Each item in
texture_urlshas all six of these maps, withnullfor a map the task didn't produce:base_colormetallicroughnessnormalmetallic_roughnessemission
- Every URL is signed and stops working at
expires_at. Download the files you need before then. See Asset retention.
Creative Lab tasks aren't part of API v2, so they don't appear on these routes. Read them with their own Creative Lab routes.
Get a task
Returns one task of any type, including tasks you created on v1. Creative Lab tasks aren't available here.
While the task is PENDING or IN_PROGRESS, the Retry-After header says how many seconds to wait before you get the task again.
Request
# Get one task by its ID
curl https://api.meshy.ai/openapi/v2/tasks/018a210d-8ba4-705c-b111-1f1776f7f578 \
-H "Authorization: Bearer ${MESHY_API_KEY}"
Response headers
HTTP/2 200
Content-Type: application/json; charset=utf-8
Retry-After: 5
Parameters
- Name
- id
- Type
- path
- Required
- Description
The task ID from the create response.
Returns
The task object.
Errors
- Name
400 - Bad Request- Description
The ID isn't a valid task ID (
request_invalid). Send theidfrom the create response.
- Name
404 - Not Found- Description
No task with this ID belongs to your account (
task_not_found).Deleted tasks, tasks past their retention period, and Creative Lab tasks also return
404. Check the ID, and use an API key from the account that created the task.
List tasks
Returns your tasks, newest first by default.
Request
# List your two newest Image to 3D tasks
curl "https://api.meshy.ai/openapi/v2/tasks?type=image-to-3d&page_size=2" \
-H "Authorization: Bearer ${MESHY_API_KEY}"
Response (task objects shortened)
{
"data": [
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"status": "SUCCEEDED",
"progress": 100,
"...": "..."
},
{
"id": "018a2110-7a91-7c2e-9b10-5d6e7f8a9b0c",
"type": "image-to-3d",
"status": "IN_PROGRESS",
"progress": 42,
"...": "..."
}
],
"has_more": true
}
Parameters
- Name
- type
- Type
- string
- Description
The task type to list.
text-to-3dmatches all three Text to 3D types. Leave it out to list tasks of every type.
- Name
- page_num
- Type
- integer
- default 1
- Description
The page to return, from
1to255.0returns the first page. A value outside0to255returns400.
- Name
- page_size
- Type
- integer
- default 10
- Description
Number of tasks per page, up to
100. A value from101to255returns 100 tasks, and0uses the default. A value outside0to255returns400.
- Name
- sort_by
- Type
- string
- default -created_at
- Description
The sort order.
Available values:
-created_at: newest first+created_at: oldest first
Returns
An object with two fields:
- Name
- data
- Type
- array
- Description
The tasks on this page, each a full task object. An empty array, never
null, when there are none.
- Name
- has_more
- Type
- boolean
- Description
Whether there's another page. If
true, request the next page withpage_numplus one.falseon the last page.
The response has no total count.
Errors
- Name
400 - Bad Request- Description
One of these query parameters is invalid:
typeisn't a known task type. The message lists the valid values.page_numorpage_sizeisn't a whole number from0to255.sort_byisn't-created_ator+created_at.
Fix the parameter, then send the request again.
Stream a task
Streams a task's updates as Server-Sent Events until the task reaches a final status.
Request
# Stream a task's updates until it finishes
curl -N https://api.meshy.ai/openapi/v2/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/stream \
-H "Authorization: Bearer ${MESHY_API_KEY}"
Events (task objects shortened)
event:message
data:{"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"image-to-3d","status":"IN_PROGRESS","progress":42,...}
event:message
data:{"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"image-to-3d","status":"SUCCEEDED","progress":100,...,"output":{"model_urls":{"glb":"..."},...}}
Parameters
- Name
- id
- Type
- path
- Required
- Description
The task ID from the create response.
Returns
A text/event-stream with two kinds of events:
- Name
message- Description
The full task object. The first event arrives right away, and another each time the task changes. Meshy also repeats the latest state every 10 seconds, so a quiet connection still gets events. The stream closes after the event with a final status.
- Name
error- Description
The error object, plus
status_code. For example,{"type": "not_found", "code": "task_not_found", "message": "Task not found", "doc_url": "https://docs.meshy.ai/en/api/v2/asset-retention", "status_code": 404}. The stream closes after this event.After the stream opens, the HTTP status stays
200, so read errors from the events. An error before the stream opens, such as a missing API key, is an ordinary HTTP error.
A stream closes after about 21 minutes, even if the task hasn't finished. A network drop can close it sooner. If the stream closes without a final status, open it again or get the task.
Delete a task
Deletes a task of any type. You can't undo a delete, and the deleted task returns 404 on every route. Creative Lab tasks can't be deleted here, and return 404 as on Get a task.
Deleting a PENDING task refunds its credits. An IN_PROGRESS task can't be deleted. Wait for a final status, then delete it.
Request
# Delete a task
curl -X DELETE https://api.meshy.ai/openapi/v2/tasks/018a210d-8ba4-705c-b111-1f1776f7f578 \
-H "Authorization: Bearer ${MESHY_API_KEY}"
409 Conflict
{
"type": "conflict",
"code": "task_in_progress",
"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.",
"doc_url": null
}
Parameters
- Name
- id
- Type
- path
- Required
- Description
The ID of the task to delete.
Returns
200 with an empty body.
Errors
- Name
400 - Bad Request- Description
The ID isn't a valid task ID (
request_invalid). Send theidfrom the create response.
- Name
404 - Not Found- Description
No task with this ID belongs to your account, or the task is already deleted (
task_not_found).Creative Lab tasks also return
404. Check the ID, and use an API key from the account that created the task.
- Name
409 - Conflict- Description
The task is
IN_PROGRESS. Its credits aren't refundable after a worker starts it. Wait forSUCCEEDEDorFAILED, then delete it.