lowpoly retires Oct 30, 2026. meshy-7 for 3D generation retires Dec 31, 2026; as a texture model it stays available. Please switch models before these dates to avoid request errors. See all deprecations

Retexture API

Generate new textures for an existing 3D model from a text prompt or a reference image.


POST/openapi/v2/retexture

Create a Retexture task

Creates a Retexture 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.

PreviewChange a value under “Try and preview” to update
Faces30,860
Cost10 credits
Request
curl https://api.meshy.ai/openapi/v2/retexture \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "input_task_id": "01a1aeae-1d29-72f0-96ed-0ba2bda780ec",
    "texture_prompt": "gingerbread cookie with white icing details",
    "texture_model": "meshy-7"
  }'
Response
Loading…

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 to texture, for example a Text to 3D, Image to 3D, Remesh, or Retexture task. The task must be one you created with the API and have the status SUCCEEDED. Meshy textures the task's GLB.

    With meshy-n1, the task's model can have at most 7,999,999 faces, counted as triangles (a quad counts as 2).

  • Name
    model_url
    Type
    string
    Required
    Description

    Required unless you send input_task_id. The model to texture, as a public URL or a data URI. Sending both input_task_id and model_url returns 400.

    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 returns 400.

    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.

    With meshy-n1, the model can have at most 7,999,999 faces, counted as triangles (a quad counts as 2), whatever its file size.

    The result 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.

Send one of these three texture inputs. Sending none, or more than one, returns 400.

  • Name
    texture_prompt
    Type
    string
    Required
    Description

    Required unless you send texture_image_url or multiview_image_urls. Text that describes the new texture, up to 800 characters. Longer text returns 400. With meshy-n1, sending it returns 400.

    Try and preview

    Send this or texture_image_url or multiview_image_urls. Picking a value here clears the others.

  • Name
    texture_image_url
    Type
    string
    Required
    Description

    Required unless you send texture_prompt or multiview_image_urls. An image whose style the texture follows, as a public URL or a data URI (data:image/png;base64,...). The texture might not fit well when the object in the image has a very different shape from the model. With meshy-n1, Meshy treats the image as the front view.

    Try and preview

    Send this or texture_prompt or multiview_image_urls. Picking a value here clears the others.

    The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB, and at least 32 pixels on each side.

  • Name
    multiview_image_urls
    Type
    string[]
    Required
    Description

    Required unless you send texture_prompt or texture_image_url. One to four reference images of the same object. The first image is the main (front) view. The order of the other views (left, back, right) doesn't matter. Each image follows the same format and size rules as texture_image_url. An empty array, or more than four images, returns 400.

    multiview_image_urls needs texture_model of meshy-7 or meshy-n1. With meshy-6-lite, it returns 400.

  • Name
    texture_model
    Type
    string
    Required
    Description

    The model that generates the texture.

    Available values:

    • meshy-7: Meshy 7, with PBR maps, a text prompt, and textures up to 8K
    • meshy-n1: Meshy N1, a 2K base color texture from reference images only. No text prompt, no PBR maps, no 4K or 8K. Up to 7,999,999 faces.
    • meshy-6-lite: Meshy 6 Lite, a 2K texture

    A request without texture_model returns 400, and so does any other value. The texture model doesn't change the credit cost. See Texture models.

  • Name
    uv_mode
    Type
    string
    default auto
    Description

    How to handle the model's UV layout.

    Try and preview

    Available values:

    • auto: keep the model's UVs when they're usable, and generate new ones otherwise.
    • preserve: keep the model's UVs. If they all fit in a box smaller than 5% of the UV square, the task fails with model_insufficient_uv. To get new UVs instead, use auto or regenerate.
    • regenerate: always generate new UVs.

    A model with no UVs gets new ones in every mode.

    With input_task_id and kept UVs, the mesh keeps its size and position. Otherwise, the mesh keeps its size, and Meshy centers it.

  • Name
    enable_pbr
    Type
    boolean
    default false
    Description

    Whether to also generate metallic, roughness, and normal maps. false generates only the base color texture. With meshy-n1, true returns 400.

    Try and preview
  • Name
    texture_resolution
    Type
    string
    default 2k
    Description

    Size of the base color texture.

    Try and preview

    Available values:

    • 2k
    • 4k
    • 8k

    With meshy-6-lite or meshy-n1, 4k and 8k return 400.

  • Name
    remove_lighting
    Type
    boolean
    default true
    Description

    Whether to remove highlights and shadows from the base color texture. The texture models that texture_model takes don't use this setting, so Meshy ignores it.

  • Name
    target_formats
    Type
    string[]
    default ["glb"]
    Description

    The file formats to generate. Meshy generates only the formats you list.

    Available values:

    • glb
    • obj
    • fbx
    • stl
    • usdz
    • 3mf

    For a model Meshy generated, Meshy scales STL and 3MF files down to at most 150 mm on the longest side. Uploaded models, and models you resized with resize_height or resize_longest_side, keep their own size. See Model size.

  • Name
    thumbnail_resolution
    Type
    integer
    default 512
    Description

    The width and height, in pixels, of the task's preview images: 512 or 1024. It applies to output.thumbnail_url and to any optional preview you request. 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 Tasks
  • Retry-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_id nor model_url was sent
    • Both input_task_id and model_url were sent
    • No texture input, or more than one, was sent
    • A parameter Retexture doesn't define was sent, such as the v1 name text_style_prompt
    • texture_model is missing or isn't a supported value
    • multiview_image_urls was sent without texture_model of meshy-7 or meshy-n1
    • meshy-n1 was sent with texture_prompt, enable_pbr: true, or a texture_resolution of 4k or 8k
    • With meshy-n1, the 3D model has more than 7,999,999 triangles. Reduce the triangle count, or use another texture_model.
    • With meshy-n1, the model_url file is too complex for Meshy to count its triangles. Reduce the triangle count, then send the file again.
    • With meshy-n1, counting the triangles of the model_url file took too long. Retry, or reduce the model's size.
    • The input task hasn't succeeded
    • The model or image can't be downloaded or is too large
    • A model 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, for example 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)
    • texture_resolution isn't available for the model

    With meshy-n1, a model that Meshy can't check before the task starts, such as an STL file, isn't refused here. If it has more than 7,999,999 triangles, the task fails, and Meshy refunds its credits.

    The error message says which problem it found. See Errors.

  • Name
    401 - Unauthorized
    Description

    The API key is missing or invalid. Check the Authorization header.

  • 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 or an input image. Change the input, then retry.
    • input_task_id is a bas-relief model, which this endpoint can't retexture. The message is This model type does not support this operation. Send a different model.
  • Name
    404 - Not Found
    Description

    input_task_id doesn'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.

Get the result

Read Retexture tasks the same way as every other v2 task, through the Tasks routes. To list only Retexture tasks, filter by type=retexture.


Retexture 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.

Request
curl https://api.meshy.ai/openapi/v2/tasks/01a1af10-e500-71b1-baf3-5ab738f08780 \
  -H "Authorization: Bearer ${MESHY_API_KEY}"
Response
Loading…
  • Name
    model_urls
    Type
    object
    Description

    Signed URLs to the generated files, one per format in target_formats, keyed by format. An obj with a base color texture also gets an mtl key, with the URL of its material file.

  • Name
    thumbnail_url
    Type
    string
    Description

    Signed URL to a PNG preview of the retextured model, with a transparent background.

  • Name
    texture_urls
    Type
    array
    Description

    One item per texture set, with a signed URL for each of these maps:

    • base_color
    • metallic
    • roughness
    • normal
    • metallic_roughness
    • emission

    A map that wasn't produced is null.