Resize API
The Resize API allows you to resize existing 3D models to real-world dimensions. You can specify an exact height, a longest-side constraint, or let AI automatically estimate the appropriate size.
Create a Resize Task
This endpoint creates a new resize task.
Parameters
Only one of input_task_id or model_url is required. If both are provided, input_task_id takes priority.
- Name
- input_task_id
- Type
- string
- Required
- Description
The ID of a completed Meshy task whose model you wish to resize. The task must have a status of
SUCCEEDED. The output format will be GLB.
- Name
- model_url
- Type
- string
- Required
- Description
A publicly accessible URL or data URI pointing to a 3D model file. Supported formats:
.glb,.gltf,.obj,.fbx,.stl. For Data URIs, use the MIME type:application/octet-stream. The output format will preserve the original format of the input model.
Exactly one resize mode is required: resize_height, resize_longest_side, or auto_size. These three parameters are mutually exclusive.
- Name
- resize_height
- Type
- number
- Description
Resize the model to a specific height measured in meters.
- Name
- resize_longest_side
- Type
- number
- Description
Resize the model so that its longest side matches this value, measured in meters. The aspect ratio is preserved.
- Name
- auto_size
- Type
- boolean
- Description
When set to
true, the service uses AI vision to automatically estimate the real-world height of the object and resize the model accordingly. The origin will default tobottomunlessorigin_atis explicitly set.
- Name
- origin_at
- Type
- string
- default bottom
- Description
Position of the origin after resizing.
Available values:
bottom,center.
Returns
The result property of the response contains the id of the newly created resize task.
Failure Modes
400 - Bad Request
The request was unacceptable. Common causes:
- Missing parameter: Either
model_urlorinput_task_idmust be provided. - Missing resize mode: At least one of
resize_height,resize_longest_side, orauto_sizemust be specified. - Mutually exclusive parameters:
resize_height,resize_longest_side, andauto_sizecannot be combined. - Invalid input task: The
input_task_idmust refer to a successful task. - Invalid model format: The
model_urlpoints to a file with an unsupported extension. - Unreachable URL: The
model_urlcould not be downloaded.
401 - Unauthorized
Authentication failed. Please check your API key.
402 - Payment Required
Insufficient credits to perform this task.
429 - Too Many Requests
You have exceeded your rate limit.
Request
# Simple: resize to a specific height
curl https://api.meshy.ai/openapi/v1/resize \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"resize_height": 1.8
}'
# Advanced: resize longest side with custom origin
curl https://api.meshy.ai/openapi/v1/resize \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"model_url": "https://example.com/model.glb",
"resize_longest_side": 2.0,
"origin_at": "center"
}'
Response
{
"result": "0193bfc5-ee4f-73f8-8525-44b398884ce9"
}
Retrieve a Resize Task
This endpoint retrieves a resize task by its ID.
Parameters
- Name
- id
- Type
- path
- Description
The ID of the resize task to retrieve.
Returns
The Resize Task object.
Request
curl https://api.meshy.ai/openapi/v1/resize/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "resize",
"model_urls": {
"glb": "https://assets.meshy.ai/.../model.glb?Expires=..."
},
"progress": 100,
"status": "SUCCEEDED",
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000001000,
"task_error": null,
"consumed_credits": 1
}
Delete a Resize Task
This endpoint permanently deletes a resize task, including all associated models and data. This action is irreversible.
Path Parameters
- Name
- id
- Type
- path
- Description
The ID of the resize task to delete.
Returns
Returns 200 OK on success.
Request
curl --request DELETE \
--url https://api.meshy.ai/openapi/v1/resize/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
// Returns 200 Ok on success.
List Resize Tasks
This endpoint allows you to retrieve a list of resize tasks.
Parameters
- Name
- page_num
- Type
- integer
- default 1
- Description
Page number for pagination.
- Name
- page_size
- Type
- integer
- default 10
- Description
Page size limit. Maximum allowed is
50items.
- Name
- sort_by
- Type
- string
- Description
Field to sort by. Available values:
+created_at: Sort by creation time in ascending order.-created_at: Sort by creation time in descending order.
Returns
Returns a paginated list of The Resize Task Objects.
Request
curl https://api.meshy.ai/openapi/v1/resize?page_size=10 \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
[
{
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "resize",
"model_urls": {
"glb": "https://assets.meshy.ai/.../model.glb?Expires=..."
},
"progress": 100,
"status": "SUCCEEDED",
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000001000,
"task_error": null,
"consumed_credits": 1
}
]
Stream a Resize Task
This endpoint streams real-time updates for a resize task using Server-Sent Events (SSE).
Parameters
- Name
- id
- Type
- path
- Description
Unique identifier for the resize task to stream.
Returns
Returns a stream of The Resize Task Objects as Server-Sent Events.
For PENDING or IN_PROGRESS tasks, the response stream will only include necessary progress and status fields.
Request
curl -N https://api.meshy.ai/openapi/v1/resize/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response Stream
// Message event examples illustrate task progress.
event: message
data: {
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"progress": 0,
"status": "PENDING"
}
event: message
data: {
"id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
"type": "resize",
"model_urls": {
"glb": "https://assets.meshy.ai/.../model.glb?Expires=..."
},
"progress": 100,
"status": "SUCCEEDED",
"created_at": 1699999999000,
"started_at": 1700000000000,
"finished_at": 1700000001000,
"task_error": null,
"consumed_credits": 1
}
The Resize Task Object
The Resize Task object represents a resize job.
Properties
id· string
Unique identifier for the task.
type· string
Type of the task. The value is resize.
model_urls· object
Downloadable URL for the resized model file. When using input_task_id, the output is always GLB. When using model_url, the output preserves the original format.
progress· integer
Progress of the task (0-100).
status· string
Status of the task. Possible values: PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED.
preceding_tasks· integer
The count of preceding tasks. Meaningful only when status is PENDING.
created_at· timestamp
Timestamp of when the task was created, in milliseconds.
started_at· timestamp
Timestamp of when the task was started, in milliseconds. 0 if not started.
finished_at· timestamp
Timestamp of when the task was finished, in milliseconds. 0 if not finished.
task_error· object
Error object if the task failed. See Errors for more details.
consumed_credits· integer
The number of credits consumed by this task (1 credit per resize task). Returns 0 for FAILED tasks.