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

Relief API

Turn one photo into a bas-relief 3D model and a 16-bit depth map, for 3D printing, laser engraving, and CNC carving.


POST/openapi/v2/relief

Create a Relief task

Creates a Relief task and returns the task object. When it succeeds, the task produces the model in the formats in target_formats, a 16-bit grayscale depth map, and a preview image. To get only the depth map, set should_generate_model to false.

The task runs in the background. To read its result, see Get the result.

A Relief task can't be the input of another endpoint, such as Remesh, Convert, or Auto Split. Those requests return 403.

PreviewChange a value under “Try and preview” to update
Faces2,105,334
Cost20 credits
Request
curl https://api.meshy.ai/openapi/v2/relief \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "image_url": "https://cdn.meshy.ai/webapp-assets/doc/try-it/v2/inputs/golden-puppy.0dedab91e14d.webp"
  }'
Response
Loading…

Parameters

  • Name
    image_url
    Type
    string
    Required
    Description

    The photo to turn into a relief, as a public URL or a data URI (data:image/png;base64,...).

    The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB, and at least 32 × 32 pixels. Its longer side can be at most about 16 times its shorter side. Any other image returns 400. Meshy fills transparent areas with black before it builds the relief.

  • Name
    variant
    Type
    string
    default low
    Description

    The relief style. It shapes the depth map and sets the default carving_depth_mm.

    Try and preview

    Available values:

    • high: deeper carving, for 3D-printed pieces.
    • low: shallow carving, for laser engraving, CNC carving, and thin plaques.

    Sending null or "" is the same as leaving it out. Any other value returns 400.

  • Name
    should_generate_model
    Type
    boolean
    default true
    Description

    Whether to build the relief model. Set it to false for a depth-map-only task, with no model and no preview image. Meshy still checks the size, carving, base, bend, resolution, format, and color parameters, but doesn't use them. It doesn't change the credit cost.

    Try and preview
  • Name
    size_mm
    Type
    number
    default 60
    Description

    The length of the photo's longer side on the model, measured flat before any bend, from 20 to 250 millimeters. With remove_base, the model can be smaller.

  • Name
    carving_mode
    Type
    string
    default emboss
    Description

    Whether the subject stands out from the plate or is cut into it.

    Try and preview

    Available values:

    • emboss: the nearer parts of the photo stand out.
    • engrave: the depth is inverted, so the nearer parts are cut in.

    The depth map is the same in both modes.

  • Name
    carving_depth_mm
    Type
    number
    default 6 (high), 3 (low)
    Description

    How deep the relief is carved, from 0 to 60 millimeters. With remove_base set to true, 0 leaves an empty model. The task still succeeds and costs 20 credits, and its model files have no geometry.

  • Name
    remove_base
    Type
    boolean
    default false
    Description

    Whether to cut away the background and build no base plate. When it's true, removal_threshold sets what counts as background. Meshy checks removal_threshold either way.

    Try and preview
Applies only when remove_base = true
  • Name
    removal_threshold
    Type
    number
    default 0.01
    Description

    The depth below which Meshy cuts the background away, from 0.01 to 1, where the depth map runs from 0 to 1. A high value can cut away the whole relief and leave an empty model, which still succeeds and is charged.

  • Name
    base_thickness_mm
    Type
    number
    default 1, or 0 with remove_base
    Description

    The thickness of the base plate, from 0.1 to 10 millimeters. When remove_base is true, leave it out or send 0.

  • Name
    bend_mode
    Type
    string
    default off
    Description

    Whether to bend the relief, and which way. When it isn't off, bend_axis and bend_angle shape the bend. Meshy checks them either way.

    Try and preview

    Available values:

    • off: a flat relief.
    • convex: the front bulges outward.
    • concave: the front curves inward.
Applies only when bend_mode = convex or concave
  • Name
    bend_axis
    Type
    string
    default xz
    Description

    Which edges the bend curls.

    Available values:

    • xz: the left and right edges.
    • yz: the top and bottom edges.
  • Name
    bend_angle
    Type
    number
    default 60
    Description

    The arc the bend spans, from 0 to 360 degrees. Below 1, the relief stays flat.

  • Name
    mesh_resolution
    Type
    integer
    default 1024
    Description

    The number of mesh points along the photo's longer side, from 512 to 2048. A higher value keeps finer detail and makes larger files. At the default 1024, the GLB file is about 40 to 50 MB and the STL file about 80 to 105 MB. A square photo gives the larger sizes. At 2048, they are about 150 MB and 300 MB. A bend makes them larger: the STL file can reach about 800 MB at 2048.

    Try and preview
  • Name
    target_formats
    Type
    string[]
    default ["glb"]
    Description

    The file formats to generate. Meshy generates and returns only the formats you list, which can shorten the task.

    Try and preview

    Available values:

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

    STL and 3MF files keep the relief's real size.

  • Name
    color_mapping
    Type
    boolean
    default false
    Description

    Whether to color the model with the photo. The GLB, OBJ, FBX, and USDZ files carry color. STL and 3MF files stay white. The task returns the texture in texture_urls. It doesn't change the credit cost.

    Try and preview

Returns

202 Accepted with the task object. The task starts as PENDING, with your request in input and output set to null.

A Relief task costs 20 credits, refunded if it fails. For what a delete refunds, see Delete a task.

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:

    • image_url is missing.
    • A parameter has the wrong type, is outside its range, or isn't one of its available values. For example, variant isn't high or low, mesh_resolution isn't an integer from 512 to 2048, or target_formats lists an unknown format.
    • base_thickness_mm isn't 0 with remove_base set to true, or is below 0.1 without it.
    • The image can't be downloaded.
    • The image isn't a JPG, JPEG, PNG, or WebP file, is over 20 MB, is smaller than 32 × 32 pixels, has too many pixels, or can't be read.
    • The image's longer side is more than about 16 times its shorter side.

    The error message says which problem it found. Meshy doesn't charge for a request that returns 400. 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

    Content moderation blocked the image. Send a different image. See Errors.

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

If a safety check declines the image while the task runs, the task fails with task_error.type set to invalid_input and task_error.code set to provider_content_refused. Meshy refunds the task's credits. Send a different image. See Errors.


Get the result

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


Relief 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/01a1e97f-c63f-74c4-a236-3868003e7385 \
  -H "Authorization: Bearer ${MESHY_API_KEY}"
Response
Loading…
  • Name
    model_urls
    Type
    object
    Description

    Signed URLs to the relief model, one per format in target_formats, keyed by format. An obj comes with an mtl. The GLB file's units are meters. The STL file is binary, and its units are millimeters, so it opens at the relief's real size, with Z up. The files can be large; mesh_resolution lists typical sizes. {} for a depth-map-only task (should_generate_model set to false).

  • Name
    texture_urls
    Type
    array
    Description

    The texture of a colored model, as one item with a signed URL to its base_color map. The other maps are null. Present only when you sent color_mapping: true.

  • Name
    depth_map_url
    Type
    string | null
    Description

    Signed URL to the 16-bit grayscale depth map the relief is built from. Brighter pixels are higher. The values are relative heights, not millimeters. Laser engraving and CNC software can use it as a height map. The file is about 1 to 2 MB. null if there is none.

  • Name
    thumbnail_url
    Type
    string | null
    Description

    Signed URL to a preview image of the relief model, or null if none was rendered, including for a depth-map-only task.