Quickstart
Start by creating your API key
Every request in this guide needs one. Creating a key takes seconds.
Create your API keyMake your first 3D model with Meshy API v2 in four steps. You get an API key, create a task, follow it on the Tasks route, and download the result.
Moving from v1? See Migrate to API v2 instead.
1Get your API key
Create an API key on the API Keys page of the Developer Platform. 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.
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.

Store the key in an environment variable instead of pasting it into your code. Run this in your terminal:
Export your key
export MESHY_API_KEY="<your-api-key>"
The JavaScript examples use fetch, which is built into Node.js 18 and later. The Python examples use requests (pip install requests).
2Create an Image to 3D task
Send an image to Image to 3D. To start from a text prompt or several photos instead, use Text to 3D or Multi-Image to 3D. Every endpoint works the same way from here.
The following examples all use this photo and texture the model with Meshy 7, which texture_model picks. To try another image, change image_url. To pick another texture model, see Texture models.

Request
curl https://api.meshy.ai/openapi/v2/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",
"texture_model": "meshy-7"
}'
The response is 202 Accepted with the task object. Keep its id, because every next step needs it. The Location header gives the path to read the task from.
Response: 202 Accepted
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"status": "PENDING",
"progress": 0,
"created_at": 1791846275575,
"started_at": null,
"finished_at": null,
"expires_at": null,
"preceding_tasks": 1,
"consumed_credits": 30,
"task_error": null,
"input": {
"image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
"texture_model": "meshy-7"
},
"output": null
}
3Get the task until it finishes
The task runs in the background and usually takes about 2 minutes. Get it from /openapi/v2/tasks/<task_id> until status is SUCCEEDED, FAILED, or CANCELED. Between requests, wait the number of seconds in the Retry-After header.
The same route works for tasks from every endpoint. For typical processing times, and how long to wait before you give up, see Processing times and How long to wait.
Request
curl https://api.meshy.ai/openapi/v2/tasks/<task_id> \
-H "Authorization: Bearer ${MESHY_API_KEY}"
Response: SUCCEEDED
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"status": "SUCCEEDED",
"progress": 100,
"created_at": 1791846275575,
"started_at": 1791846275578,
"finished_at": 1791846334536,
"expires_at": 1792105534536,
"preceding_tasks": 0,
"consumed_credits": 30,
"task_error": null,
"input": {
"image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
"texture_model": "meshy-7"
},
"output": {
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
"thumbnail_urls": null,
"texture_urls": [
{
"base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
"metallic": null,
"roughness": null,
"normal": null,
"metallic_roughness": null,
"emission": null
}
]
}
}
If the task fails, status is FAILED, and task_error says why. Fix the input or create another task. See Errors.
To get notified when the task finishes instead of polling, stream the task or use a webhook.
4Download your model
The files are in output. output.model_urls.glb is a signed URL that works until expires_at. You can also paste it into your browser to download the file.
Image to 3D returns only a GLB file, unless you list other formats in target_formats when you create the task.
Download
curl -L "<output.model_urls.glb from the response above>" -o model.glb

On every plan except Enterprise, Meshy keeps the files for 3 days. Download the files you need before then. See Asset retention.
Put it all together
This script creates the task, waits for it to finish, and downloads the model.
Full script
import { writeFile } from "node:fs/promises";
const API = "https://api.meshy.ai/openapi/v2";
const headers = {
Authorization: `Bearer ${process.env.MESHY_API_KEY}`,
"Content-Type": "application/json",
};
async function call(path, init = {}) {
const res = await fetch(`${API}${path}`, {
...init,
headers,
signal: AbortSignal.timeout(init.method === "POST" ? 60_000 : 30_000),
});
if (!res.ok) throw new Error(`${res.status}: ${(await res.json()).message}`);
return { body: await res.json(), retryAfter: Number(res.headers.get("retry-after")) || 5 };
}
// 1. Create the task
let { body: task, retryAfter } = await call("/image-to-3d", {
method: "POST",
body: JSON.stringify({
image_url: "https://docs.meshy.ai/images/api/quick-start/source-photo.webp",
texture_model: "meshy-7",
}),
});
// 2. Get the task until it finishes, for up to 60 minutes
const deadline = task.created_at + 60 * 60 * 1000;
while (!["SUCCEEDED", "FAILED", "CANCELED"].includes(task.status)) {
if (Date.now() > deadline) {
// The task is still running. Check it again later with the same ID instead of creating a new one.
throw new Error(`Task ${task.id} is still ${task.status}; check it again later`);
}
await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
({ body: task, retryAfter } = await call(`/tasks/${task.id}`));
}
// 3. Download the model (only if the task succeeded)
if (task.status !== "SUCCEEDED") {
throw new Error(`Task ${task.status}: ${task.task_error?.message ?? "unknown error"}`);
}
const file = await fetch(task.output.model_urls.glb);
await writeFile("model.glb", Buffer.from(await file.arrayBuffer()));
console.log("Saved model.glb");
Explore common workflows
Game-ready character
Rig a humanoid model with a skeleton so it's ready to animate in Unity or Unreal.
Learn more →Smart Topology mesh
Set ai_model to meshy-smart-topology-latest on Image to 3D for a clean, game-ready triangle mesh.
3D print model
Turn a finished model into a multi-color 3MF file, ready to slice and print.
Learn more →Next steps
- Learn the task object and the Tasks routes that every endpoint shares.
- Browse every endpoint in the API v2 overview.
- Check Pricing, Rate limits, and Errors before you go to production.
- Prefer a UI? The Developer Platform lets you run requests in the Playground, track usage and request logs, and manage webhooks.
- Follow step-by-step recipes in the Cookbook, and read tutorials on the Developer Blog.
- Have feedback or a problem? Join the Meshy Discord community.