> **Reading as an AI agent?** This is the Markdown version of https://docs.meshy.ai/api/v2/resize, part of the Meshy API v2 docs.
>
> - v2 docs index: https://docs.meshy.ai/api/v2/llms.txt
> - All v2 pages in one file: https://docs.meshy.ai/api/v2/llms-full.txt
> - OpenAPI spec for v2: https://docs.meshy.ai/api/v2/openapi.yaml

---

# Resize API

Scale a 3D model to a real-world size, in meters, and set where its origin goes.

> **Note:** Moving from v1? The request is the same as on v1, and results are in `output`. See [what changed for Resize](/api/migrate-to-v2/reference#convert-and-resize).

---

## POST /openapi/v2/resize -- Create a Resize task

Creates a Resize task and returns the [task object](https://docs.meshy.ai/api/v2/tasks.md#the-task-object). The task runs in the background. To read its result, see [Get the result](#get-the-result). For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times).

### Parameters

  - `input_task_id` · *string* · **required**

  Required unless you send `model_url`. The ID of a task that produced a 3D model, 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`. Resize uses the task's GLB file and returns a GLB file.

  - `model_url` · *string* · **required**

  Required unless you send `input_task_id`. The model to resize, 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.

  Meshy returns the resized model in the same format as the file, except that a glTF file or a data URI comes back as GLB.

To change the size, send one of these size parameters. More than one returns `400`. To move only the origin, send `origin_at` without a size parameter. A request with neither returns `400`.

  - `resize_height` · *number* · **required**

  Required unless you send `resize_longest_side`, `auto_size`, or only `origin_at`. The model's new height in meters, greater than 0. A negative value returns `400`.

  - `resize_longest_side` · *number* · **required**

  Required unless you send `resize_height`, `auto_size`, or only `origin_at`. The new length of the model's longest side in meters, greater than 0. A negative value returns `400`.

  The longest side is the largest of the model's bounding-box width, height, and depth, for example the arm span of a character in a T-pose.

  - `auto_size` · *boolean* · **required**

  Required unless you send `resize_height`, `resize_longest_side`, or only `origin_at`. Whether to estimate the object's real-world height and scale the model to it. Send `true`. `false` is the same as leaving it out.

  If Meshy can't estimate the height, the task still succeeds without resizing. A Meshy task keeps its size, and a `model_url` file comes back centered at a standard size.

  - `origin_at` · *string* · default: `bottom`

  Where to place the model's origin, `bottom` or `center`.

  Sent without a size parameter, `origin_at` moves only the origin, and the model keeps its size. A `model_url` file keeps its own size too. If Meshy can't read the file's size, the model comes back at a standard size, with STL and 3MF files at most 150 mm. The default `bottom` applies only when you send a size.

### Returns

`202 Accepted` with the [task object](https://docs.meshy.ai/api/v2/tasks.md#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](https://docs.meshy.ai/api/v2/tasks.md#how-a-task-runs)
* `Retry-After`: how many seconds to wait before you first read it

### Failure modes

  - `400 - Bad Request`

  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
  * Neither a size parameter nor `origin_at` was sent
  * More than one size parameter was sent
  * A size isn't greater than 0
  * The input task hasn't succeeded
  * The model file can't be downloaded or is too large
  * A 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, such as 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`)

  The error message says which problem it found. See [Errors](https://docs.meshy.ai/api/v2/errors.md#request-errors).

  - `401 - Unauthorized`

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

  - `402 - Payment Required`

  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.

  - `403 - Forbidden`

  `input_task_id` is a bas-relief model, which this endpoint can't resize. The message is `This model type does not support this operation`. Send a different model.

  - `404 - Not Found`

  `input_task_id` doesn't match any of your tasks.

  - `429 - Too Many Requests`

  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.

**cURL**

```bash
# Resize a Meshy task to 1.8 m tall, origin at the bottom
curl https://api.meshy.ai/openapi/v2/resize \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "resize_height": 1.8
  }'

# Fit a model file in 0.3 m on its longest side, origin at the center
curl https://api.meshy.ai/openapi/v2/resize \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "model_url": "https://cdn.meshy.ai/model/example_model_2.glb",
    "resize_longest_side": 0.3,
    "origin_at": "center"
  }'
```

```javascript
// Fit a model file in 0.3 m on its longest side, origin at the center
const response = await fetch("https://api.meshy.ai/openapi/v2/resize", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MESHY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model_url: "https://cdn.meshy.ai/model/example_model_2.glb",
    resize_longest_side: 0.3,
    origin_at: "center",
  }),
});
const task = await response.json();
console.log(task.id, task.status);
```

```python
import os
import requests

# Fit a model file in 0.3 m on its longest side, origin at the center
response = requests.post(
    "https://api.meshy.ai/openapi/v2/resize",
    headers={"Authorization": f"Bearer {os.environ['MESHY_API_KEY']}"},
    json={
        "model_url": "https://cdn.meshy.ai/model/example_model_2.glb",
        "resize_longest_side": 0.3,
        "origin_at": "center",
    },
)
response.raise_for_status()
task = response.json()
print(task["id"], task["status"])
```

**Response**

```json
{
  "id": "0199a8f6-3d27-7c2e-9b41-6e0c5d2f8a13",
  "type": "resize",
  "status": "PENDING",
  "progress": 0,
  "created_at": 1790640079880,
  "started_at": null,
  "finished_at": null,
  "expires_at": null,
  "preceding_tasks": 1,
  "consumed_credits": 1,
  "task_error": null,
  "input": {
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "resize_height": 1.8
  },
  "output": null
}
```

---

## Convert the result
To get the resized model in other formats, run a [Convert](https://docs.meshy.ai/api/v2/convert.md) task with the Resize task's `id` as `input_task_id`.

The size of the converted files depends on how you resized the model:

* After `resize_height` or `resize_longest_side`, Convert keeps the new size in every format.
* After `auto_size`, Meshy scales STL and 3MF files down to at most 150 mm on the longest side.
* After `origin_at` alone, the size follows the model you moved. A `model_url` file and a model you resized keep their size in every format. For a model Meshy generated, STL and 3MF files are scaled down to at most 150 mm.

A task with quad topology, such as a Remesh task with `topology: quad`, stays quad. Resize resizes its quad model with the GLB file, and Convert returns it in OBJ, FBX, and Blend files.

Other tasks that take a Resize task as `input_task_id` use the resized model. This includes an OBJ, FBX, or STL file you resized from `model_url`.

---

## Get the result
Read Resize tasks the same way as every other v2 task, through the [Tasks](https://docs.meshy.ai/api/v2/tasks.md) routes. To list only Resize tasks, filter by `type=resize`.

| To | Call |
| --- | --- |
| Get one task | [`GET /openapi/v2/tasks/{id}`](https://docs.meshy.ai/api/v2/tasks.md#get-a-task) |
| Wait for updates | [`GET /openapi/v2/tasks/{id}/stream`](https://docs.meshy.ai/api/v2/tasks.md#stream-a-task) or a [webhook](https://docs.meshy.ai/api/v2/webhooks.md) |
| List your tasks | [`GET /openapi/v2/tasks?type=resize`](https://docs.meshy.ai/api/v2/tasks.md#list-tasks) |
| Delete a task | [`DELETE /openapi/v2/tasks/{id}`](https://docs.meshy.ai/api/v2/tasks.md#delete-a-task) |

---

## Resize output
When the task succeeds, `output` holds these fields. The rest of the [task object](https://docs.meshy.ai/api/v2/tasks.md#the-task-object) is the same for every task type. The URLs in `output` stop working at `expires_at`.

  - `model_urls` · *object*

  Signed URL to the resized model, keyed by its format. The key is `glb` for `input_task_id`. For `model_url`, the key is the format of the file, one of `glb`, `obj`, `fbx`, or `stl`.

  - `texture_urls` · *array*

  Signed URLs to the model's texture maps, in the same item shape as other tasks. For `input_task_id`, these are the texture maps of that task. The array is empty for `model_url`, and for a task without texture maps.

Resize tasks have no preview image, so `output` has no `thumbnail_url`.

**Succeeded Resize task**

```json
{
  "id": "0199a8f6-3d27-7c2e-9b41-6e0c5d2f8a13",
  "type": "resize",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1790640079880,
  "started_at": 1790640079884,
  "finished_at": 1790640088913,
  "expires_at": 1790899288913,
  "preceding_tasks": 0,
  "consumed_credits": 1,
  "task_error": null,
  "input": {
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "resize_height": 1.8
  },
  "output": {
    "model_urls": {
      "glb": "https://assets.meshy.ai/***/output/model.glb?Expires=***"
    },
    "texture_urls": []
  }
}
```
