Text to 3D API
Turn a text prompt into a 3D model in one call.
Text to 3D already runs on /openapi/v2/text-to-3d, so the path stays the same. Requests with mode (preview and refine) stop working on March 15, 2027, so make new models in one call. Two rules are new. Sending both texture_prompt and texture_image_url returns 400, and a textured one-call request, which omits mode, needs texture_model. Read its tasks through Tasks like every other task, and read the results from output. A webhook set to v2 delivers Text to 3D tasks in that shape. See what changed for Text to 3D.
Create a Text to 3D task
Creates a Text to 3D 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/text-to-3d \
-X POST \
-H "Authorization: Bearer ${MESHY_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"prompt": "a stylized adult male explorer with short brown hair and a stubble beard, wearing an orange jacket, beige cargo pants and brown boots, full body, standing",
"ai_model": "meshy-7.1",
"should_texture": true,
"texture_model": "meshy-7"
}'Parameters
- Name
- should_texture
- Type
- boolean
- default true
- Description
Whether to texture the model.
truereturns a textured model, andfalsereturns the mesh only. Withfalse, Meshy ignorestexture_modeland the other texture parameters. To check the mesh before you texture it, sendfalse, then texture the finished task with Retexture, using itsidasinput_task_id. If you also sendmode, Meshy ignores this setting.Try and preview
- Name
- mode
- Type
- string
- ⚠ deprecated
- Description
The step of a two-step task, for integrations that already use preview and refine. Send
should_textureinstead.Available values:
preview: makes an untextured meshrefine: textures the mesh of a preview task
- Name
- prompt
- Type
- string
- Required
- Description
Required for one-call and preview tasks. Text that describes the model to generate, up to 800 characters. Longer text returns
400. A refine uses its preview's prompt instead.
- Name
- preview_task_id
- Type
- string
- Required
- ⚠ deprecated
- Description
Send
should_texture: trueinstead, or texture an existing task with Retexture. Required for refine tasks. The ID of the preview task to texture. The task must be one of your preview tasks and have the statusSUCCEEDED.
- Name
- ai_model
- Type
- string
- default latest
- Description
The model that generates the 3D model.
Try and previewStandard models:
latest: Meshy 7.1meshy-7.1meshy-6meshy-6-litemeshy-standard-latest: same aslatest
Smart Topology models build a clean triangle mesh at the face count you set with
target_polycount:meshy-t2.5: sharper detail for game assetsmeshy-t2meshy-smart-topology-latest: Meshy T2.5, the newest Smart Topology model. Results can change when a new one comes out. For results that stay the same, sendmeshy-t2.5.
See Models for which model fits your project, such as a game character or a 3D print.
On a refine,
ai_modelpicks the texture model, because the mesh comes from the preview. Leave it out to texture with the model that matches the preview. For the values a refine takes, see Legacy preview and refine.
- Name
- model_type
- Type
- string
- ⚠ deprecated
- Description
Leave it out.
ai_modelpicks the model.
- Name
- geometry_resolution
- Type
- string
- default standard
- Description
How much geometry detail to generate. Applies only to one-call and preview tasks. A refine with this parameter returns
400.Try and previewAvailable values:
standard2k: adds the Ultra pass4k: adds the Ultra pass, then a super-resolution pass
2kand4kneedmeshy-7.1orlatest. With other models, they return400.
- Name
- should_remesh
- Type
- boolean
- default true (meshy-6-lite), false (other models)
- Description
Whether to remesh the model after generation.
falsekeeps the mesh as generated. Applies only to one-call and preview tasks. Smart Topology models ignore this setting.Try and preview
should_remesh = true- Name
- topology
- Type
- string
- default triangle
- Description
The face type of the remeshed model,
triangleorquad. Smart Topology models make triangles only, soquadwith a Smart Topology model returns400. Withtexture_model: "meshy-n1",quadreturns400.Try and previewApplies when
ai_modelismeshy-7.1andshould_remeshistrue. Picking a value sets it.
- Name
- decimation_mode
- Type
- integer
- Description
Adaptive face count, by level. When you set it, Meshy ignores
target_polycount.Available values:
1: ultra2: high3: medium4: low
- Name
- target_polycount
- Type
- integer
- Description
The number of faces to aim for. Applies only to one-call and preview tasks. The range and default depend on how the mesh is built:
Mesh Range Default Remeshed 100to30000030000meshy-t2.5ormeshy-smart-topology-latest100to3000015000meshy-t2100to150004000A value outside the range returns
400.For a low-poly game asset, use a Smart Topology model instead of remeshing a standard model. See Models.
- Name
- pose_mode
- Type
- string
- Description
The pose for a character model,
a-poseort-pose. Leave it out for no pose. Applies only to one-call and preview tasks.Try and preview
should_texture = true- Name
- texture_model
- Type
- string
- Required
- Description
Required unless
should_textureisfalse. The model that textures a one-call task. Everyai_modeltakes each of these values.Available values:
meshy-7: Meshy 7, with PBR maps, a text prompt, and textures up to 8Kmeshy-n1: Meshy N1, a 2K base color texture from reference images onlymeshy-6-lite: Meshy 6 Lite, a 2K texture
With
meshy-6ormeshy-6-lite,meshy-n1needstexture_image_url, because those models make no reference image from the prompt. A textured request withouttexture_modelreturns400, and so does an option the texture model doesn't support. Withmode, Meshy ignorestexture_model. See Texture models.
- Name
- texture_prompt
- Type
- string
- Description
Text that guides the texture, up to 800 characters. Longer text returns
400. Sendtexture_promptortexture_image_url, not both. Sending both returns400. Withmeshy-n1, sending it returns400.
- Name
- texture_image_url
- Type
- string
- Description
Image that guides the texture, as a public URL or a data URI (
data:image/png;base64,...). Withmeshy-n1, Meshy textures from this image as the front view. A one-call task withtexture_model: "meshy-n1"and anai_modelofmeshy-6ormeshy-6-liteneeds it.The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB, at least 32 pixels on each side, and at most 178,956,970 pixels (width × height).
- Name
- enable_pbr
- Type
- boolean
- default false
- Description
Whether to also generate metallic, roughness, and normal maps. With
meshy-n1,truereturns400.Try and preview
- Name
- texture_resolution
- Type
- string
- default 2k
- Description
Size of the base color texture. A preview with this parameter returns
400.Try and previewAvailable values:
2k4k8k
4kand8kreturn400withmeshy-n1ormeshy-6-lite, whethertexture_modelpicks it on a one-call task orai_modelpicks it on a refine.
- Name
- remove_lighting
- Type
- boolean
- default true
- Description
Whether to remove highlights and shadows from the base color texture. Only
meshy-6uses this setting. Meshy 7 and Smart Topology models ignore it. Withmeshy-6-lite, sending it returns400.
- Name
- target_formats
- Type
- string[]
- default ["glb", "obj", "fbx", "stl", "usdz"]
- Description
The file formats to generate.
Available values:
glbobjfbxstlusdz3mf
Text to 3D doesn't apply the 150 mm cap that other v2 endpoints use for print files. STL files keep the model's size, and Meshy scales a
3mffile to 75 mm tall.
- Name
- alpha_thumbnail
- Type
- boolean
- default false
- Description
Whether to also render a preview with a transparent background, returned in
output.alpha_thumbnail_url.
- Name
- thumbnail_resolution
- Type
- integer
- default 512
- Description
The width and height, in pixels, of the task's preview images:
512or1024. It applies tooutput.thumbnail_urland to any optional preview you request. Any other value returns400.
- Name
- moderation
- Type
- boolean
- default false
- Description
Whether to screen these inputs for harmful content before generating:
prompttexture_prompttexture_image_url
- Name
- auto_size
- Type
- boolean
- default false
- Description
Whether to estimate the object's real-world height and scale the model to it.
auto_size = true- Name
- origin_at
- Type
- string
- default bottom
- Description
Where to place the model's origin,
bottomorcenter.
Returns
202 Accepted with the task object. The task starts as PENDING, with your request in input and output set to null. The response also has result, which repeats the id for clients written before v2.
These headers help you follow the task:
Retry-After: how many seconds to wait before you first read the taskLocation:/openapi/v2/text-to-3d/{id}, a legacy route. Read the task through Tasks instead.
Failure modes
- Name
400 - Bad Request- Description
The request can't run. For example:
promptis missing- A textured one-call task didn't send
texture_model - A one-call task sent
texture_model: "meshy-n1"withmeshy-6ormeshy-6-liteand notexture_image_url - The texture model doesn't support an option in the request, for example
enable_pbr: truewithmeshy-n1 preview_task_iddoesn't match one of your preview tasks with the statusSUCCEEDED. The message says whether the task doesn't exist, isn't finished, or isn't a preview.- Both
texture_promptandtexture_image_urlwere sent texture_resolutionwas sent with a previewgeometry_resolutionwas sent with a refine, or with a model that can't run it- A one-call task asked for
meshy-7(sendmeshy-7.1instead) - A one-call task sent a parameter Text to 3D doesn't define, such as a misspelled name. With
mode, Meshy ignores it.
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
Content moderation blocked the prompt or an input image. Change the input, then retry.
- 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 Text to 3D tasks the same way as every other v2 task, through the Tasks routes. To list Text to 3D tasks, filter by type:
text-to-3d: all three kinds of Text to 3D tasktext-to-3d-preview: preview tasks onlytext-to-3d-refine: refine tasks only
One-call tasks have no filter of their own.
| 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=text-to-3d |
| Delete a task | DELETE /openapi/v2/tasks/{id} |
Text to 3D output
When the task succeeds, output holds these fields. The rest of the task object is the same for every task type.
For Text to 3D, expires_at is always null. Meshy still deletes the task 3 days after it finishes, so download the files within that window. Enterprise accounts keep their tasks. See Asset retention.
curl https://api.meshy.ai/openapi/v2/tasks/01a1aeae-2720-72bd-952d-008784fbd525 \
-H "Authorization: Bearer ${MESHY_API_KEY}"Loading…- Name
- model_urls
- Type
- object
- Description
Signed URLs to the generated files, keyed by format. There is one URL for each format in
target_formats, or for each default format if you left it out. A texturedobjalso gets anmtlkey, with the URL of its material file.
- Name
- thumbnail_url
- Type
- string
- Description
Signed URL to a preview image of the model.
- Name
- alpha_thumbnail_url
- Type
- string | null
- Description
Signed URL to the preview with a transparent background.
nullunless you sentalpha_thumbnail: true.
- Name
- texture_urls
- Type
- array
- Description
One item per texture set, with a signed URL for each of these maps:
base_colormetallicroughnessnormalmetallic_roughnessemission
A map that wasn't produced is
null. The array is empty for a preview and for an untextured one-call task.
Legacy preview and refine
mode is deprecated and stops working on March 15, 2027. Before then, make the model in one call with should_texture, which costs the same as a preview plus a refine.
- Create a preview with
"mode": "preview", yourprompt, and the geometry parameters, such asgeometry_resolutionandshould_remesh. The preview makes the untextured mesh. - Wait until the preview's status is
SUCCEEDED. - Create a refine with
"mode": "refine", the preview'sidaspreview_task_id, and the texture parameters. The refine keeps the preview's prompt and mesh. Leaveai_modelout to texture with the model that matches the preview, which is Meshy 7 for a Smart Topology preview.
On a refine, ai_model names the texture model, and Meshy ignores texture_model:
meshy-7: Meshy 7latest: the newest texture model, now Meshy 7meshy-6: Meshy 6meshy-6-lite: Meshy 6 Litemeshy-n1: Meshy N1, a 2K base color texture from a reference image only
A Smart Topology preview (meshy-t2, meshy-t2.5) has no Meshy 6 Lite texturing: a refine of one with meshy-6-lite textures with Meshy 6, so with enable_pbr: true it also returns an emission map. A meshy-6-lite refine of a Meshy 6, Meshy 6 Lite or Meshy 7 preview returns none, and neither does a refine of a Smart Topology preview that doesn't set ai_model.
To refine with Meshy N1, send "ai_model": "meshy-n1". Meshy textures from texture_image_url, or from the reference image that a meshy-7.1 or latest preview stores. Any other preview returns 400 unless you send texture_image_url. Meshy N1 makes a 2K base color texture only. Sending any of these with it returns 400:
texture_promptenable_pbr: trueremove_lighting: true- a
texture_resolutionof4kor8k
The preview can have at most 7,999,999 triangles. A preview remeshed to quads returns 400. To texture a one-call task with Meshy N1, use Retexture.
You can refine a preview more than once, for example with different texture prompts, until the preview is deleted. You can't refine a one-call task. Meshy deletes Text to 3D tasks 3 days after they finish, and Enterprise accounts keep theirs. A refine of a deleted preview returns 400, with the code input_task_expired once the retention period has ended. See Asset retention.
Legacy routes
The Text to 3D read routes from before v2 stop working on March 15, 2027. Before then, move your reads to Tasks.
| Route | Use instead |
|---|---|
GET /openapi/v2/text-to-3d/{id} | GET /openapi/v2/tasks/{id} |
GET /openapi/v2/text-to-3d/{id}/stream | GET /openapi/v2/tasks/{id}/stream |
GET /openapi/v2/text-to-3d | GET /openapi/v2/tasks?type=text-to-3d |
DELETE /openapi/v2/text-to-3d/{id} | DELETE /openapi/v2/tasks/{id} |
These routes return the fields of the original Text to 3D task object, with task_error in its v2 form. They also return these fields, the same as Tasks:
inputoutputexpires_at
The list route returns a plain array, with no has_more.
The same routes under /v2/text-to-3d, without /openapi, are deprecated. Their responses have a Deprecation header, and a Link header that points to the /openapi/v2/text-to-3d route.
The original Text to 3D task object
The legacy routes return this object. type says whether the task is a preview, a refine, or a one-call task.
Example Text to 3D Task Object
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "text-to-3d-preview",
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***",
"fbx": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***",
"usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***",
"obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***",
"mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***",
"stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***"
},
"prompt": "a monster mask",
"texture_prompt": "green slimy skin with scales and warts",
"texture_image_url": "",
"thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
"progress": 100,
"started_at": 1692771667037,
"created_at": 1692771650657,
"finished_at": 1692771669037,
"status": "SUCCEEDED",
"texture_urls": [
{
"base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
"metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX",
"normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX",
"roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX",
"emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX"
}
],
"preceding_tasks": 0,
"task_error": null,
"consumed_credits": 20
}
- 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:
text-to-3d-previewfor a preview,text-to-3d-refinefor a refine, ortext-to-3dfor a one-call task.
- Name
- model_urls
- Type
- object
- Description
Download URLs for the generated 3D model, one per file format. A format the task didn't generate has no key, rather than an empty string.
- Name
glb- Type
- string
- Description
The GLB file.
- Name
fbx- Type
- string
- Description
The FBX file.
- Name
usdz- Type
- string
- Description
The USDZ file.
- Name
obj- Type
- string
- Description
The OBJ file.
- Name
mtl- Type
- string
- Description
The MTL file.
- Name
stl- Type
- string
- Description
The STL file.
- Name
3mf- Type
- string
- Description
The 3MF file. Present only when
target_formatsincludes3mf.
- Name
- prompt
- Type
- string
- Description
The
promptyou sent to create the task, unmodified.
- Name
- texture_prompt
- Type
- string
- Description
The text prompt you sent to guide the texturing in the refine stage.
- Name
- ultra_mode
- Type
- boolean
- ⚠ deprecated
- Description
Read
geometry_resolutioninstead.
- Name
- geometry_resolution
- Type
- string
- Description
The Ultra tier the preview task ran,
2kor4k. The field is absent forstandard.
- Name
- texture_image_url
- Type
- string
- Description
Download URL for the image you sent to guide the texturing.
- Name
- thumbnail_url
- Type
- string
- Description
Download URL for a thumbnail image of the 3D 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
- progress
- Type
- integer
- Description
How much of the task is done, as a percentage. It's
0until the task starts and100when it succeeds.
- Name
- started_at
- Type
- timestamp
- Description
Time the task started, in Unix milliseconds. It's
0until the task starts.
- Name
- created_at
- Type
- timestamp
- Description
Time the task was created, in Unix milliseconds.
- Name
- finished_at
- Type
- timestamp
- Description
Time the task finished, in Unix milliseconds. It's
0until the task finishes.
- Name
- status
- Type
- string
- Description
The task's status. See How a task runs.
- Name
- texture_urls
- Type
- array
- Description
Download URLs for the generated texture maps, as an array of objects. It usually holds one object. Each object has these fields:
- Name
base_color- Type
- string
- Description
The base color map.
- Name
metallic- Type
- string
- Description
The metallic map. Absent when you created the task with
enable_pbr: false.
- Name
normal- Type
- string
- Description
The normal map. Absent when you created the task with
enable_pbr: false.
- Name
roughness- Type
- string
- Description
The roughness map. Absent when you created the task with
enable_pbr: false.
- Name
emission- Type
- string
- Description
The emission map. Absent in any of these cases:
- You created the task with
enable_pbr: false. ai_modelismeshy-7,meshy-7.1, orlatest, or it ismeshy-6-liteon any preview butmeshy-t2andmeshy-t2.5.texture_resolutionis8k.- The task refines a
meshy-t2ormeshy-t2.5preview without settingai_model.
- You created the task with
- 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
- task_error
- Type
- object
- Description
The error details when the task fails, in its v2 form. It's
nullunless the status isFAILED. See Task errors.
- Name
- consumed_credits
- Type
- integer
- Description
The number of credits the task used. Present when the status is
PENDING,IN_PROGRESS, orSUCCEEDED. It's0for aFAILEDtask, because Meshy refunds the credits when a task fails.