> **Reading as an AI agent?** This is the Markdown version of https://docs.meshy.ai/api/quick-start.
>
> - Full docs index: https://docs.meshy.ai/llms.txt
> - Single-fetch full content: https://docs.meshy.ai/llms-full.txt
> - Tool-calling access via MCP server: https://docs.meshy.ai/api/ai

---
# Quickstart

> **Start by creating your API key:** Every request in this guide needs one. Creating a key takes seconds.
>
> [Create your API key](https://www.meshy.ai/developers/keys)

Make your first 3D model with the Meshy REST API in four steps, from creating an API key to downloading the model.

> **Note:** Using an AI coding assistant? To connect Claude Code, Cursor, Windsurf, or another MCP client to Meshy, see [AI integration](/api/ai). For a chat agent without MCP support, use [`llms.txt`](/llms.txt).

---

## 1. Get your API key
[Create an API key](https://www.meshy.ai/developers/keys) on the **API Keys** page of the [Developer Platform](https://www.meshy.ai/developers). You can't view the key again after you leave that screen, so store it somewhere safe. Send it in every request as a `Bearer` token in the `Authorization` header. See [Authentication](/api/authentication).

You need a paid plan to create and manage API keys. On the Free plan, you can't create keys of your own, and the Playground uses a built-in key for testing.

![Open the API Keys page in the Developer Platform, then create your key](/images/api/quick-start/api-key-settings.webp)

> **Note:** Keep the key out of your scripts. Store it in an environment variable instead, as the next step shows.

---

## 2. Create an Image to 3D task
Send an image to [Image to 3D](/api/image-to-3d). To start from a text prompt or several photos instead, use [Text to 3D](/api/text-to-3d) or [Multi-Image to 3D](/api/multi-image-to-3d).

First, store your key in an environment variable:

**Export your key**

```bash
export MESHY_API_KEY="<your-api-key>"
```

> **Note:** Run this in your terminal (Terminal on macOS, Command Prompt or PowerShell on Windows), not in a browser.

The following examples all use this photo. To try another image, change `image_url`.

![Sample fantasy character illustration used as the Image to 3D input in this guide](https://docs.meshy.ai/images/api/quick-start/source-photo.webp)

**cURL**

```bash
curl https://api.meshy.ai/openapi/v1/image-to-3d \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp"
  }'
```

```javascript

const headers = { Authorization: `Bearer ${process.env.MESHY_API_KEY}` };

const { data } = await axios.post(
  'https://api.meshy.ai/openapi/v1/image-to-3d',
  { image_url: 'https://docs.meshy.ai/images/api/quick-start/source-photo.webp' },
  { headers },
);

const taskId = data.result;
console.log('Task created:', taskId);
```

```python
import os
import requests

headers = {"Authorization": f"Bearer {os.environ['MESHY_API_KEY']}"}

response = requests.post(
    "https://api.meshy.ai/openapi/v1/image-to-3d",
    headers=headers,
    json={"image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp"},
)
response.raise_for_status()
task_id = response.json()["result"]
print("Task created:", task_id)
```

---

## 3. Check task status
The task runs in the background and usually takes a few minutes. Get the task from the same endpoint until `status` is `SUCCEEDED`, `FAILED`, or `CANCELED`. In the following request, replace `<task_id>` with the ID that step 2 returned. Between requests, wait the number of seconds in the `Retry-After` header.

For typical processing times, and how long to wait before you give up, see [Task lifecycle](/api/task-lifecycle).

**cURL**

```bash
curl https://api.meshy.ai/openapi/v1/image-to-3d/<task_id> \
  -H "Authorization: Bearer ${MESHY_API_KEY}"
```

```javascript

const headers = { Authorization: `Bearer ${process.env.MESHY_API_KEY}` };

let task;
while (true) {
  const { data, headers: resHeaders } = await axios.get(
    `https://api.meshy.ai/openapi/v1/image-to-3d/${taskId}`,
    { headers },
  );
  task = data;
  if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(task.status)) break;
  console.log(task.status, task.progress);
  const waitSeconds = Number(resHeaders['retry-after']) || 5;
  await new Promise((resolve) => setTimeout(resolve, waitSeconds * 1000));
}
```

```python
import os
import time
import requests

headers = {"Authorization": f"Bearer {os.environ['MESHY_API_KEY']}"}

while True:
    response = requests.get(
        f"https://api.meshy.ai/openapi/v1/image-to-3d/{task_id}",
        headers=headers,
    )
    response.raise_for_status()
    task = response.json()
    if task["status"] in ("SUCCEEDED", "FAILED", "CANCELED"):
        break
    print(task["status"], task["progress"])
    time.sleep(int(response.headers.get("Retry-After", 5)))
```

**Response: SUCCEEDED**

```json
{
  "id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "status": "SUCCEEDED",
  "progress": 100,
  "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=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
  "task_error": null
}
```

If the task fails, `status` is `FAILED`, and `task_error` says why. Fix the input or create another task. See [Errors](/api/errors#task-errors).

> **Note:** To get notified when the task finishes instead of polling, [stream the task](/api/image-to-3d#stream-an-image-to-3d-task) or use a [webhook](/api/webhooks).

---

## 4. Download your model
The files are in `model_urls` of the preceding response. Each format (GLB, FBX, OBJ, USDZ, and STL) has a signed URL that works for a limited time. You can also paste the URL into your browser to download the file.

**cURL**

```bash
curl -L "<model_urls.glb from the response above>" -o model.glb
```

```javascript

const { data } = await axios.get(task.model_urls.glb, { responseType: 'arraybuffer' });
fs.writeFileSync('model.glb', data);
```

```python
import requests

response = requests.get(task["model_urls"]["glb"])
response.raise_for_status()

with open("model.glb", "wb") as f:
    f.write(response.content)
```

![The resulting 3D model generated from the sample fantasy character photo](/images/api/quick-start/image-to-3d-output.webp)

> **Note:** On every plan except Enterprise, Meshy keeps the files for 3 days. Download the files you need before then. See [Asset retention](/api/asset-retention).

### Put it all together

This script creates the task, waits for it to finish, and downloads the model.

```javascript

const headers = { Authorization: `Bearer ${process.env.MESHY_API_KEY}` };
const imageUrl = 'https://docs.meshy.ai/images/api/quick-start/source-photo.webp';

// 1. Create the task
const { data: created } = await axios.post(
  'https://api.meshy.ai/openapi/v1/image-to-3d',
  { image_url: imageUrl },
  { headers, timeout: 60_000 },
);
const taskId = created.result;

// 2. Poll until it finishes, for up to 60 minutes
const deadline = Date.now() + 60 * 60 * 1000;
let task;
while (true) {
  const { data, headers: resHeaders } = await axios.get(
    `https://api.meshy.ai/openapi/v1/image-to-3d/${taskId}`,
    { headers, timeout: 30_000 },
  );
  task = data;
  if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(task.status)) break;
  if (Date.now() > deadline) {
    // The task is still running. Check it again later with the same task ID instead of creating a new one.
    throw new Error(`Task ${taskId} is still ${task.status}; check it again later`);
  }
  const waitSeconds = Number(resHeaders['retry-after']) || 5;
  await new Promise((resolve) => setTimeout(resolve, waitSeconds * 1000));
}

// 3. Download the result (only if the task succeeded)
if (task.status !== 'SUCCEEDED') {
  throw new Error(`Task ${task.status}: ${task.task_error?.message || 'unknown error'}`);
}
const { data: model } = await axios.get(task.model_urls.glb, { responseType: 'arraybuffer' });
fs.writeFileSync('model.glb', model);
console.log('Saved model.glb');
```

```python
import os
import time
import requests

headers = {"Authorization": f"Bearer {os.environ['MESHY_API_KEY']}"}
image_url = "https://docs.meshy.ai/images/api/quick-start/source-photo.webp"

# 1. Create the task
response = requests.post(
    "https://api.meshy.ai/openapi/v1/image-to-3d",
    headers=headers,
    json={"image_url": image_url},
    timeout=60,
)
response.raise_for_status()
task_id = response.json()["result"]

# 2. Poll until it finishes, for up to 60 minutes
deadline = time.time() + 60 * 60
while True:
    response = requests.get(
        f"https://api.meshy.ai/openapi/v1/image-to-3d/{task_id}",
        headers=headers,
        timeout=30,
    )
    response.raise_for_status()
    task = response.json()
    if task["status"] in ("SUCCEEDED", "FAILED", "CANCELED"):
        break
    if time.time() > deadline:
        # The task is still running. Check it again later with the same task ID instead of creating a new one.
        raise SystemExit(f"Task {task_id} is still {task['status']}; check it again later")
    time.sleep(int(response.headers.get("Retry-After", 5)))

# 3. Download the result (only if the task succeeded)
if task["status"] != "SUCCEEDED":
    error = task.get("task_error") or {}
    raise SystemExit(f"Task {task['status']}: {error.get('message') or 'unknown error'}")
model = requests.get(task["model_urls"]["glb"])
with open("model.glb", "wb") as f:
    f.write(model.content)
print("Saved model.glb")
```

---

## Explore common workflows

  - [Game-ready character](/api/rigging): Rig a humanoid mesh with a skeleton so it's ready to animate in Unity or Unreal.
  - [Smart Topology mesh](/api/image-to-3d#create-an-image-to-3d-task): Set `model_type` to `smart-topology` on Image to 3D for a clean, game-ready triangle mesh.
  - [3D print model](/api/multi-color-print): Convert a finished model into a multi-color 3MF file, ready to slice and print.

---

## Next steps
- Browse every endpoint in the [API reference](/api).
- Before you go to production, check [Pricing](/api/pricing), [Rate limits](/api/rate-limits), and [Errors](/api/errors).
- Follow step-by-step recipes in the [Cookbook](https://www.meshy.ai/developers/cookbook/).
