# Meshy API > Meshy is an AI-powered 3D model generation platform. The Meshy API is a RESTful API that allows you to programmatically generate 3D models, textures, images, rig characters, and animate them. - API Base URL: `https://api.meshy.ai/openapi/` - Documentation: https://docs.meshy.ai - OpenAPI Specification: https://docs.meshy.ai/openapi.yaml (JSON: https://docs.meshy.ai/openapi.json) - Status Page: https://status.meshy.ai > **For agents:** For single-fetch full content (all docs pages concatenated), see https://docs.meshy.ai/llms-full.txt. For a deterministic, machine-readable API contract (endpoints, parameters, enums, limits, response schemas), see the OpenAPI spec at https://docs.meshy.ai/openapi.yaml. For tool-calling access, install the Meshy MCP server — see https://docs.meshy.ai/api/ai. ## Instructions for Large Language Models When generating code that integrates with the Meshy API, follow these guidelines: ### 1. Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer msy_YOUR_API_KEY ``` API keys are created on the API Keys page (https://www.meshy.ai/developers/keys) in the Developer Platform (https://www.meshy.ai/developers) and have the format `msy_`. **Tip:** For tool-calling access from MCP-compatible agents (Claude Code, Cursor, Windsurf, Claude Desktop, Codex CLI, etc.), install the Meshy MCP server instead of calling this REST API directly: ``` claude mcp add meshy --env MESHY_API_KEY=msy_YOUR_API_KEY -- npx -y @meshy-ai/meshy-mcp-server ``` See https://docs.meshy.ai/api/ai for the full install matrix (8 clients) and tool reference. ### 2. Asynchronous Task Model Meshy uses an asynchronous execution model. All generation endpoints return a task ID, not the result directly. You retrieve results via one of three mechanisms: - **Polling** — GET the task endpoint until `status` is terminal, waiting `Retry-After` seconds between polls (shown in the examples below) - **SSE streaming** — connect to `//:id/stream` for real-time updates (see section 3) - **Webhooks** — register a URL to receive a POST when the task completes (see https://docs.meshy.ai/api/webhooks.md) **Correct pattern:** ```python import requests, time, os headers = {"Authorization": f"Bearer {os.environ['MESHY_API_KEY']}"} def wait_for_task(url, max_wait=60 * 60): """Poll a task until it reaches a final status. Returns the task if it SUCCEEDED.""" deadline = time.time() + max_wait status = "unknown" while time.time() < deadline: try: resp = requests.get(url, headers=headers, timeout=30) except requests.RequestException: time.sleep(5) # Network error: the task is unaffected, so try again continue if resp.status_code == 429 or resp.status_code >= 500: time.sleep(int(resp.headers.get("Retry-After", 5))) # Not a task failure continue resp.raise_for_status() task = resp.json() status = task["status"] if status == "SUCCEEDED": return task if status in ("FAILED", "CANCELED"): error = task.get("task_error") or {} raise RuntimeError(f"Task {task['id']} {status}: {error.get('message', '')}") time.sleep(int(resp.headers.get("Retry-After", 5))) # Still running: keep the task ID and check again later. Don't create a new task. raise TimeoutError(f"{url} is still {status} after {max_wait} seconds") # Step 1: Create a task (if this times out, don't resend it; see section 10) response = requests.post( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, json={"mode": "preview", "prompt": "a monster mask"}, timeout=60, ) response.raise_for_status() task_id = response.json()["result"] # Step 2: Wait for it, for up to 60 minutes task = wait_for_task(f"https://api.meshy.ai/openapi/v2/text-to-3d/{task_id}") # Step 3: Download result model_url = task["model_urls"]["glb"] ``` **WRONG pattern** (expecting synchronous result): ```python # WRONG - the POST does not return a model response = requests.post("https://api.meshy.ai/openapi/v2/text-to-3d", ...) model = response.json()["model_urls"] # WRONG ``` ### 3. SSE Streaming (Alternative to Polling) All task endpoints support Server-Sent Events streaming at `//:id/stream`: ```python import requests, json headers = { "Authorization": f"Bearer {API_KEY}", "Accept": "text/event-stream" } response = requests.get( f"https://api.meshy.ai/openapi/v2/text-to-3d/{task_id}/stream", headers=headers, stream=True ) for line in response.iter_lines(): if line and line.startswith(b"data:"): data = json.loads(line.decode("utf-8")[5:]) print(data["status"], data.get("progress")) if data["status"] in ["SUCCEEDED", "FAILED", "CANCELED"]: break response.close() ``` ### 4. Task Statuses and Timing Task lifecycle: `PENDING` -> `IN_PROGRESS` -> `SUCCEEDED` | `FAILED` | `CANCELED`. A task can also be rescheduled from `IN_PROGRESS` back to `PENDING` (same task ID, `progress` starts again from 0), so don't treat that step back as an error. - A task normally leaves `PENDING` within seconds; almost all of its time is `IN_PROGRESS`. Typical times per endpoint and configuration: https://docs.meshy.ai/api/task-lifecycle.md (for example, Image to 3D with 2K textures on `meshy-7.1` typically takes about 2 minutes). - Wait at least 60 minutes from the task's `created_at` (Unix milliseconds) before giving up. During busy periods some tasks take 20 minutes or more and still succeed. - A client-side timeout, dropped connection or closed stream does not fail or cancel the task. Keep the task ID and fetch the task later. - Only `FAILED` means the task failed; its credits are refunded. Credits are charged when a task is created. ### 5. Timestamps All timestamps in the API are Unix epoch milliseconds (not seconds). For example, `1693569600000` represents September 1, 2023 12:00:00 PM UTC. ### 6. Model Output Formats 3D model outputs are available in multiple formats: GLB, FBX, OBJ, USDZ. Access them via `model_urls.glb`, `model_urls.fbx`, etc. Not all formats are always available; omitted properties mean that format was not generated. ### 7. Asset Retention Generated assets are retained for a maximum of **3 days** for non-Enterprise customers. Download and store models locally if you need them longer. ### 8. Rate Limits | Tier | Requests/Second | Concurrent Tasks | Priority | |------|-----------------|------------------|----------| | Pro | 20 | 10 | Default | | Studio | 20 | 60 (20 on some earlier Studio plans) | Higher | | Enterprise | 100 | 100 by default, or a custom limit | Highest | Concurrent tasks are tasks in `PENDING` or `IN_PROGRESS`. A team's API keys share one set of limits for the whole team. Exceeding limits returns `429 Too Many Requests`. - Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` (seconds until the budget refills). - When a response has `Retry-After`, wait that many seconds before the next request. It may be sent with a request-rate `429` and when you retrieve a task that is still `PENDING` or `IN_PROGRESS`. ### 9. Choosing the Right AI Model and Pipeline Every textured 3D model comes from two AI models: a geometry model (`ai_model`) builds the mesh, and a texture model (`texture_model`) paints it. Choose each one from the user's goal. Use only the model IDs listed here and on the Models page: https://docs.meshy.ai/api/models.md Before the first create request, find out what the user will make. A game character, a product render and a 3D print each need a different pair. If the user hasn't said, ask one short question, then pick the pair from the "Choose by project" table on the Models page. When you write integration code instead of making a model, keep `ai_model` and `texture_model` as settings, and note which pair fits which use case. - Default: `ai_model: "meshy-7.1"` with `texture_model: "meshy-7"`. Omitting `ai_model` (or sending `"latest"`) gives Meshy 7.1 on Image to 3D, Multi-Image to 3D and the Text to 3D preview. - Game character to rig and animate, other game-ready low-poly assets, or any model with a face-count budget, whether the user says so or the prompt does: `model_type: "smart-topology"` with `ai_model: "meshy-t2.5"` (`target_polycount` 100–30,000, default 15,000) and `texture_model: "meshy-n1"`. Use `ai_model: "meshy-t2"` (`target_polycount` 100–15,000, default 4,000) when speed matters more than detail. Smart Topology output is triangles only, so do not combine it with `topology: "quad"`. Don't remesh a `meshy-7.1` mesh down to a face count with `should_remesh` and `target_polycount` for these. - Cheapest drafts: `ai_model: "meshy-6-lite"` with `texture_model: "meshy-6-lite"` (5 credits for the mesh, 2K texture only). - Finest geometry detail: add `geometry_resolution: "2k"` or `"4k"` on `meshy-7.1` (+5 credits). `4k` meshes can reach about 10 million faces; `4k` is not available on Multi-Image to 3D. - Texture model choice: `meshy-7` for PBR maps, 4K or 8K textures, or a text prompt; `meshy-n1` for clean, stylized color from reference images only (2K base color, no PBR, no text prompt, 3D models up to 7,999,999 triangles); `meshy-6-lite` for the lowest cost (2K). `meshy-6` is only the default texture model of `ai_model: "meshy-6"` (the one texture model with an emission map). - On Image to 3D, `texture_model` takes `meshy-7`, `meshy-n1` or `meshy-6-lite` with any `ai_model`. Multi-Image to 3D takes only the multi-view texture models, `meshy-7` and `meshy-n1`; a textured request with `meshy-6` or `meshy-6-lite` returns 400. An option the chosen texture model doesn't support (for example `enable_pbr: true` with `meshy-n1`) returns 400. The texture model doesn't change the price: the mesh-only price plus the Retexture price at that texture resolution. - Several reference images (2–4, front first): geometry with Multi-Image to 3D on `meshy-7.1`, `meshy-6` or `meshy-6-lite`; texture with `meshy-7` or `meshy-n1`. - If `texture_model` is omitted, Image to 3D and Multi-Image to 3D use a fixed default per geometry model: Meshy 7.1 → Meshy 7, Meshy 6 → Meshy 6, Meshy 6 Lite → Meshy 6 Lite, Meshy T2.5 and Meshy T2 → Meshy 7. - On Retexture the texture model is `ai_model` (`latest` is `"meshy-7"`; Retexture rejects `"meshy-7.1"`). There, `"meshy-n1"` takes one to four reference images (front first), no text prompt, no `enable_pbr: true`, no `remove_lighting` on v1 (v2 ignores it), and no `4k` / `8k`. On the Text to 3D refine task, omit `ai_model` to texture with the model that matches the preview, or send `meshy-7`, `meshy-6`, `meshy-6-lite` or `meshy-n1` (Meshy N1 textures from `texture_image_url`, or from the reference image a `meshy-7.1` / `latest` preview stores). ### 10. Pick the Endpoint from the Goal | Goal | Endpoint(s) | Key parameters | Credits | |---|---|---|---| | Cheapest untextured mesh from text | `POST /openapi/v2/text-to-3d` (`mode: preview`) | `ai_model: meshy-6-lite` or `model_type: smart-topology` + `meshy-t2` | 5 | | Clean low-poly mesh at a given face count | `POST /openapi/v2/text-to-3d` or `POST /openapi/v1/image-to-3d` | `model_type: smart-topology`, `ai_model: meshy-t2` or `meshy-t2.5`, `target_polycount` | 5 (+10 with 2K textures on Image to 3D) | | Highest geometry detail | `POST /openapi/v2/text-to-3d` preview or `POST /openapi/v1/image-to-3d` | `ai_model: meshy-7.1`, `geometry_resolution: "4k"` | 20 + 5 (Image to 3D textures by default: 30 + 5, or 20 + 5 with `should_texture: false`) | | Textured model from text | `POST /openapi/v2/text-to-3d` preview, then `mode: refine` with `preview_task_id` | `enable_pbr` for PBR maps | 20 + 10 | | Textured model from one photo | `POST /openapi/v1/image-to-3d` | `should_texture: true`, `enable_pbr: true` | 30 | | Physical, 3D-printable merchandise from a photo (keychain, fridge magnet, figure, lamp, keycap, pixel fidget) | Creative Lab: `POST /openapi/creative-lab//v1/prototype`, then `/build` with `input_task_id`; Collapsible Fidget is a single `POST /openapi/creative-lab/fidget-collapsible/v1` (6 credits) | see the product page; `name_text` engraves on keychains | 6 → 30 (keycap 12 → 50, lamp 30 → 6) | | Bas-relief model and depth map from a photo, for 3D printing, laser engraving, or CNC | `POST /openapi/v1/relief` | `image_url`; optional `variant` (`high` deeper, `low` shallow), `size_mm`; `should_generate_model: false` for the depth map only | 20 | | Rig and animate a character | Text/Image to 3D (textured) → `POST /openapi/v1/rigging` (`input_task_id`) → `POST /openapi/v1/animations` (`rig_task_id`, `action_id`) | humanoid model required for rigging | 5 (rig) + 3 per action | | Check cost before spending | `GET /openapi/v1/balance` before creating; `consumed_credits` on every task | | 0 | The Creative Lab and Text to Motion endpoints are **not** in the OpenAPI spec; their pages are listed in the Documentation Index below. ### 11. Common Mistakes to Avoid - **Don't call the API from browser JavaScript.** It exposes your API key. Call it from your server. - **Don't forget `enable_pbr: true`** if you need metallic/roughness/normal maps. - **Don't set both `texture_prompt` and `texture_image_url`** — if both are provided, `texture_prompt` takes precedence. - **Don't assume model format availability.** Check that the URL key exists in `model_urls` before downloading. - **Don't poll on a tight loop.** Wait for `Retry-After` between polls (5 seconds if absent), or use SSE or webhooks. - **Don't reach for Text to Image / Image to Image when the user wants a physical object.** Those endpoints return images. A keychain, magnet, figure, lamp or keycap from a photo is a Creative Lab task; a 3D model from a photo is Image to 3D. - **Don't create a task again because a status request timed out or failed.** The task is still running and already charged; a second create starts and charges a second task. Keep the task ID and check it later. Only create a new task after a `FAILED` status. - **Don't resend a create request automatically after a timeout, dropped connection or `5xx`.** The task may have been created anyway, and there is no idempotency key. Wait about 1 minute, list the newest tasks (`sort_by=-created_at`) and create it again only if it isn't there. A `4xx` response means no task was created. Details: https://docs.meshy.ai/api/task-lifecycle.md - **Don't use `DELETE` to cancel a running task.** A task that is already `IN_PROGRESS` cannot be cancelled — `DELETE` returns `409 Conflict` and the task keeps running, because credits for work the worker has started are not refundable. `DELETE` is only a cancel for a `PENDING` task (deleted and refunded); otherwise wait for `SUCCEEDED`, `FAILED` or `CANCELED` and then delete. --- ## Complete Code Example: Text to 3D (Preview + Refine) ```python import requests, os, time headers = {"Authorization": f"Bearer {os.environ['MESHY_API_KEY']}"} # 1. Create preview task preview_resp = requests.post( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, json={ "mode": "preview", "prompt": "a monster mask", "should_remesh": True, }, timeout=60, ) preview_resp.raise_for_status() preview_task_id = preview_resp.json()["result"] # 2. Poll preview task task = wait_for_task(f"https://api.meshy.ai/openapi/v2/text-to-3d/{preview_task_id}") # defined in section 2 # 3. Download preview model with open("preview_model.glb", "wb") as f: f.write(requests.get(task["model_urls"]["glb"]).content) # 4. Create refine task (texturing) refine_resp = requests.post( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, json={ "mode": "refine", "preview_task_id": preview_task_id, "enable_pbr": True, }, timeout=60, ) refine_resp.raise_for_status() refine_task_id = refine_resp.json()["result"] # 5. Poll refine task task = wait_for_task(f"https://api.meshy.ai/openapi/v2/text-to-3d/{refine_task_id}") # defined in section 2 # 6. Download refined (textured) model with open("refined_model.glb", "wb") as f: f.write(requests.get(task["model_urls"]["glb"]).content) ``` ## Complete Code Example: Image to 3D ```python import requests, os, time 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://example.com/photo.jpg", "should_texture": True, "enable_pbr": True, }, timeout=60, ) response.raise_for_status() task_id = response.json()["result"] task = wait_for_task(f"https://api.meshy.ai/openapi/v1/image-to-3d/{task_id}") # defined in section 2 with open("model.glb", "wb") as f: f.write(requests.get(task["model_urls"]["glb"]).content) ``` --- --- # API Reference # Quickstart Source: https://docs.meshy.ai/api/quick-start # 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="" ``` > **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 `` 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/ \ -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 "" -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/). --- # Models Source: https://docs.meshy.ai/api/models # Models Compare Meshy's geometry and texture models on the same input, and choose a pair for your project. Meshy makes a 3D model with two AI models. A geometry model builds the mesh, and a texture model paints it. You choose the geometry model with `ai_model` and the texture model with `texture_model`, so you can pair them to suit your project. Every example on this page started from the same input image and the default settings, so the model is the only difference between them. --- ## Choose by project The following table suggests a geometry model and a texture model for common projects. | Project | Geometry model | Texture model | Why | | --- | --- | --- | --- | | A detailed hero asset, such as a product render or a cinematic prop | `meshy-7.1` | `meshy-7` | Meshy 7.1 makes a dense, detailed mesh, and Meshy 7 adds PBR maps at up to 8K. | | A game character to rig and animate | `meshy-t2.5` | `meshy-n1` | Meshy T2.5 makes a clean triangle mesh at the face count you set, and Meshy N1 paints clean color with few seams. | | Many props for a game scene, or user-generated content | `meshy-t2` | `meshy-n1` | The faster Smart Topology model, with 4,000 faces by default and separate parts. | | A real object from 2 to 4 photos | `meshy-7.1` on [Multi-Image to 3D](/api/multi-image-to-3d) | `meshy-7` | Both models read every photo, so the sides and the back match the object. | | A model to 3D print | `meshy-7.1` | None, or `meshy-7` to print in color | The printer prints the mesh. Meshy 7 separates colors well for [Multi-Color Print](/api/multi-color-print). | | Many drafts at a low cost | `meshy-6-lite` | `meshy-6-lite` | The mesh costs 5 credits and the texture 10. | --- ## Geometry models Meshy has two kinds of geometry models: - **Standard models** make a dense, detailed mesh that follows the input closely. - **Smart Topology models** make a clean, low-poly triangle mesh at the face count you set with `target_polycount`. ### Standard models The following comparison shows the mesh that each standard model made from the same image, without a texture. Drag any model to turn all of them. To zoom, hold ⌘ or Ctrl and scroll. The following table compares the standard models. | | Meshy 7.1 | Meshy 6 | Meshy 6 Lite | | --- | --- | --- | --- | | Model ID | `meshy-7.1`, or `latest` | `meshy-6` | `meshy-6-lite` | | Strengths | Fine detail built as real geometry, with the shape aligned closely to the input | Clean hard surfaces and smooth organic shapes | Quality close to Meshy 6, in less time and at a quarter of the cost | | Faces in the example | 890,226 | 678,776 | 30,513 | | Mesh only, typical time | 75 s | 90 s | 40 s | | Higher geometry resolution | `geometry_resolution`: `2k` or `4k` | Not supported | Not supported | | Multi-Image to 3D | Supported | Supported | Supported | | Remeshed by default | No | No | Yes, to 30,000 faces | | Credits for the mesh | 20 | 20 | 5 | The typical times are medians for Image to 3D. For other endpoints and options, see [Task lifecycle](/api/task-lifecycle#processing-times). Meshy 7.1 puts faces where the detail is: many where the surface has fine detail, few where it's flat. Its face count depends on the input, so the count in the example is one result, not a fixed size. `geometry_resolution: "4k"` makes the finest detail, for hero assets and close-up renders. A `4k` mesh can reach about 10 million faces and 490 MB, which is more than most 3D printing and modeling tools handle well. `4k` works on Image to 3D and Text to 3D, not on Multi-Image to 3D. ### Smart Topology models The following comparison shows the Smart Topology meshes from the same image, with the Meshy 7.1 mesh for comparison. Wireframe view shows the faces. You set the face count with `target_polycount`. The following images show the Meshy T2.5 mesh at four values, from the same image. The following table compares the Smart Topology models. | | Meshy T2.5 | Meshy T2 | | --- | --- | --- | | Model ID | `meshy-t2.5` | `meshy-t2` | | Strengths | Sharper detail, and a shape closer to the input image than Meshy T2 | Faster generation, with the model's parts kept separate | | `target_polycount` | `100` to `30000`, default `15000` | `100` to `15000`, default `4000` | | Faces in the example | 15,721 | 4,353 | | Mesh only, typical time | 15 s | 4 s | | Face type | Triangles only | Triangles only | | Input | One image, or a text prompt | One image, or a text prompt | | Credits for the mesh | 5 | 5 | Smart Topology models make triangles only, so `topology: "quad"` returns `400`. To get quads, use a standard model and remesh it. See [Remesh](/api/remesh). --- ## Texture models The following comparison shows the same Meshy T2.5 mesh, painted by each texture model from the same image. Select Base color only to turn off the lights and see the painted color itself, including any shadows and highlights painted into it. Meshy 7, Meshy 6, and Meshy 6 Lite also make PBR maps when you send `enable_pbr: true`. The following maps are the ones Meshy 7 made for the same model. The following table compares the texture models. | | Meshy 7 | Meshy N1 | Meshy 6 | Meshy 6 Lite | | --- | --- | --- | --- | --- | | Model ID | `meshy-7` | `meshy-n1` | `meshy-6` | `meshy-6-lite` | | Best for | Realistic and detailed assets, PBR materials, and close-up renders | Stylized and low-poly game assets | Assets with glowing parts, which need an emission map | Drafts and fast iteration | | Texture resolution | 2K, 4K, or 8K | 2K | 2K, 4K, or 8K | 2K | | PBR maps | Supported | Not supported: base color only | Supported, with an emission map at 2K and 4K | Supported | | Text prompt | Supported | Not supported: reference images only | Supported | Supported | | Reference images | 1 to 4 | 1 to 4 | 1 | 1 | | `remove_lighting` | Ignored | Not supported | Supported | Not supported | | Quad remesh (`topology: "quad"`) | Supported | Not supported | Supported | Supported | | Typical time at 2K | 40 s | 20 s | 110 s | 35 s | | Credits | 10, or 15 at 8K | 10 | 10, or 15 at 8K | 10 | A request that asks a texture model for something it doesn't support returns `400`, for example a text prompt with Meshy N1 or a `4k` texture with Meshy 6 Lite. `remove_lighting` removes highlights and shadows from the base color. The credits are the texture's price on its own, the same as a [Retexture](/api/retexture) task. On Image to 3D and Multi-Image to 3D, a textured task costs the mesh plus the texture at that resolution, whichever texture model you pick. See [Pricing](/api/pricing#api-pricing). Meshy N1 generates color directly on the model instead of blending 2D views, so its textures have few seams and their colors follow the mesh. Text, patterns, and faces come out softer than with Meshy 7, so use Meshy 7 for photorealistic assets, fine detail, or PBR maps. Meshy 7 makes 8K textures natively, not by upscaling. Use 8K for close-up cinematics and hero assets. For assets in a real-time engine, 2K or 4K is usually enough. --- ## Multi-view Send 2 to 4 images of the same object to show the model the sides that one image can't. Send the front view first. The other views can be in any order. The views must show the same object in the same colors. When views disagree, the result is unpredictable. ### Multi-view geometry [Multi-Image to 3D](/api/multi-image-to-3d) builds the mesh from every image. In the following example, Meshy 7.1 built an explorer from the front image alone and from all three images. From the front alone, the back of the backpack is a guess. Meshy 7.1, Meshy 6, and Meshy 6 Lite take 1 to 4 images. Smart Topology models take one image. ### Multi-view texture Meshy 7 and Meshy N1 paint from 1 to 4 reference images. In the following example, both painted the same mesh from the front image alone and from all three images. With the front alone, both guessed the backpack's colors and patch. With all three, both match the back view. To send several reference images, use one of the following: - `texture_image_urls` on [Multi-Image to 3D](/api/multi-image-to-3d) - `multiview_image_urls` on [Retexture](/api/retexture) Meshy 6 and Meshy 6 Lite take one reference image, so `texture_model` on Multi-Image to 3D takes only `meshy-7` and `meshy-n1`. --- ## Every pair The following grid shows the result of every pair of geometry and texture models on three inputs. Select a pair to see its result. Recommended marks the pair that Meshy recommends for each geometry model, as in [Choose by project](#choose-by-project). --- ## Set the models in a request The following table shows the parameters that set the models on each endpoint. | Endpoint | Geometry model | Texture model | | --- | --- | --- | | [Image to 3D](/api/image-to-3d) | `ai_model`, with `model_type: "smart-topology"` for Meshy T2.5 and Meshy T2 | `texture_model`: `meshy-7`, `meshy-n1`, or `meshy-6-lite` | | [Multi-Image to 3D](/api/multi-image-to-3d) | `ai_model` | `texture_model`: `meshy-7` or `meshy-n1` | | [Text to 3D](/api/text-to-3d) | `ai_model` on the preview task | `ai_model` on the refine task | | [Retexture](/api/retexture) | None: you send a model you already have | `ai_model` | For example, the following Image to 3D request makes a game character with Meshy T2.5 and paints it with Meshy N1: ```json { "image_url": "https://example.com/character.png", "model_type": "smart-topology", "ai_model": "meshy-t2.5", "target_polycount": 15000, "texture_model": "meshy-n1" } ``` If you leave out `texture_model`, Meshy uses the default texture model for the geometry model. The following table lists the defaults. They stay the same when Meshy releases a texture model, so a request without `texture_model` keeps giving you the same kind of result. | Geometry model | Default texture model | | --- | --- | | Meshy 7.1 | Meshy 7 | | Meshy 6 | Meshy 6 | | Meshy 6 Lite | Meshy 6 Lite | | Meshy T2.5 | Meshy 7 | | Meshy T2 | Meshy 7 | Sending the default is the same as leaving `texture_model` out. `texture_model` takes a model ID only. On Image to 3D, `meshy-6` is available only as the default for Meshy 6. On Multi-Image to 3D, a textured request with `meshy-6` or `meshy-6-lite` returns `400`. On the Text to 3D refine task, `ai_model` picks Meshy 7, Meshy N1, Meshy 6, or Meshy 6 Lite. Meshy N1 textures from `texture_image_url`, or from the reference image that a Meshy 7.1 preview stores. --- # Developer Platform Source: https://docs.meshy.ai/api/developer-platform # Developer Platform Run, monitor, and configure your Meshy API integration in the Developer Platform. It has a Playground to try endpoints without writing code, dashboards of every API request on your account, and API key and webhook management. On the Free plan, you can try only Image to 3D in the Playground, through a built-in key for testing. Free accounts can't create or manage API keys, and have no Usage dashboard or Request Logs. Pro, Premium, Ultra, Studio, and Enterprise plans get every Playground endpoint, the Usage dashboard and Request Logs, and their own API keys. --- ## Overview Open the [Developer Platform](https://www.meshy.ai/developers) from the web app. Its sidebar has three groups: - **Build**: the Playground, for trying endpoints interactively. - **Monitor**: the Usage dashboard and Request Logs. - **Configure**: API Keys and Webhooks. The **Overview** page walks new accounts through three steps: create a key, try a request in the Playground, and check the result in Request Logs. It also shows a 7-day snapshot of your account's usage and the newest entries from the [Changelog](/api/changelog). ![The Developer Platform's Overview page, showing the three-step getting-started card, a 7-day usage snapshot, and the newest Meshy API changelog entries](/images/api/developer-platform/overview.webp) New to the API? Start with the [Quickstart](/api/quick-start). ## Playground The Playground is an interactive console for trying endpoints without writing code. Pick an endpoint, fill in its parameters with the inline guidance, and submit the request. The task runs through the same asynchronous pipeline as an API task. You can watch it move from `PENDING` to `SUCCEEDED`, then inspect the full response and the resulting model. ![The Playground running an Image to 3D request, with the live model preview alongside Preview, Request, and Response tabs](/images/api/developer-platform/playground.webp) While a task runs, the **Preview** tab streams live status updates, so you don't need to poll. ![The Playground's Preview tab log, streaming live status updates while a task is in progress](/images/api/developer-platform/playground-in-progress.webp) The **Request** tab shows a ready-to-run snippet in cURL, Python, or JavaScript, and the **Response** tab shows the full JSON. Unlike the web app workspace, the Playground gives you every request you build as code that you can copy into your own app. ## Usage dashboard The Usage dashboard charts all of your account's API activity, from direct API calls and from the Playground. It shows the generation success rate, total requests, average processing time, and credits used. It also shows request volume over time, and success rate and latency by endpoint. ![The Usage dashboard, showing generation success rate, request volume over time, and success rate and latency broken down by endpoint](/images/api/developer-platform/usage-dashboard.webp) ## Request logs Request Logs lists every API task on your account, from direct API calls and from the Playground. Each entry shows the status, timing, and the API key that made the request. Select a task to see its full input and output, request body, and credits used. This helps you debug a call without querying the API again. To open the task in the Playground, click **Open in Playground**. To download the whole list for reports or reconciliation, click **Export CSV**. ![Request Logs, with a selected task's status, input and output preview, and request body in the detail panel. The Export CSV and Open in Playground buttons are highlighted.](/images/api/developer-platform/request-logs.webp) ## API management - **[API Keys](https://www.meshy.ai/developers/keys)**: create, name, and revoke keys, set a monthly credit limit on each one, restrict each one to an [IP allowlist](/api/authentication#ip-allowlist), and see each key's usage. - **[Webhooks](https://www.meshy.ai/developers/webhooks)**: get real-time updates when your API tasks change status, instead of polling. For setup steps, delivery requirements, and sample payloads, see [Webhooks](/api/webhooks). ## Feedback Every page in the Developer Platform has a **Feedback** button. Use it to report a bug, request a feature, or tell us what's confusing. The Meshy team reads every submission. ## Authentication and credits Playground requests send an API key in the `Authorization: Bearer` header, like a direct API call. The Playground runs on your own account, so every request **uses your plan credits and counts toward your rate limits**, like any other API call. For more information about API keys and security, see [Authentication](/api/authentication). --- # Authentication Source: https://docs.meshy.ai/api/authentication # Authentication Create a Meshy account and an API key, then send the key with every request. --- ## API keys ### Create a Meshy account You need a Meshy account to create and manage API keys. A request without an API key returns `401 Unauthorized`. To create an account, sign up on the [Meshy website](https://www.meshy.ai/). ### Create an API key After you create an account, you can create API keys on the [API Keys page](https://www.meshy.ai/developers/keys) of the [Developer Platform](https://www.meshy.ai/developers). You can create several API keys for different purposes, for example one for your iOS app and another for your web app. Meshy tracks the usage of each key separately, and you can revoke a key at any time. You can also set a monthly credit limit on any key. The limit caps what the key can spend, whatever your account's overall usage. For example, use it for a key that you give to a contractor or use in one environment. ![The Create API Key dialog, with an optional monthly credit limit field](/images/api/authentication/credit-limit.webp) To create an API key, follow these steps: 1. On the **API Keys** page, click **Create API Key**. 2. In **Name**, enter a name for the key. 3. Optional: In **Monthly credit limit (optional)**, enter the most credits the key can spend each month. 4. Click **Create**. 5. Copy the key, and store it somewhere safe. **You can't view the key again after you close the dialog.** ### Use an API key Send the API key in the `Authorization` header of every request, as a `Bearer` token: ```json { "Authorization": "Bearer msy_sOmEbOgUsApIkEyFoReXaMpLe1234567890" } ``` The `Bearer` prefix in the header value is required. For more information about bearer tokens, see [RFC 6750](https://datatracker.ietf.org/doc/html/rfc6750). ### Restrict a key to IP addresses An IP allowlist limits an API key to the addresses your requests come from, such as your servers' public egress addresses. Meshy then refuses the key from any other address, so a copied key is much less useful. A key without an allowlist works from any address. For a team's keys, only team admins can change the allowlist. CLI keys don't have one. To set an allowlist, follow these steps: 1. On the [API Keys page](https://www.meshy.ai/developers/keys), open the key's menu and click **Manage IP allowlist**. 2. Add each address or range. Optional: give each one a name, for example `office NAT`. 3. Optional: click **Check impact** to see how many of the key's requests in the last 7 days the list would have blocked. 4. Save the list. Each entry is one IPv4 or IPv6 address, such as `203.0.113.5`, or a CIDR block, such as `203.0.113.0/24`. The list follows these rules: - A key can have up to 50 entries, and a name can be up to 60 characters. - An entry must be a public address. Meshy refuses private, loopback, and link-local addresses, such as `10.0.0.0/8` or `127.0.0.1`, because no request reaches the API from them. Use the public address that your traffic leaves from. - An entry can't allow every address, such as `0.0.0.0/0`. To accept any address, remove the allowlist. - Meshy saves a CIDR block as its network address. For example, `203.0.113.5/24` is saved as `203.0.113.0/24`, which is the range Meshy enforces. The dialog also lists the addresses that used the key in the last 7 days, so you can add them directly. For a busy key, Meshy samples the addresses, so the list may not show every one. Changes apply on the next request, within a minute at most. After you remove an allowlist, any address can use the key again within a minute. A request from an address outside the allowlist returns `403 Forbidden` with the error code `ip_not_authorized`. The error message names the refused address, so you can add it if it's yours. A refused request doesn't use credits or count toward your [rate limits](/api/rate-limits). --- ## Security Follow these guidelines to keep your data and requests safe, along with your team's own security practices. ### Transport Layer Security Meshy encrypts your data at rest, and the Meshy API uses [TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security) to encrypt data in transit. All requests to and from the API go over HTTPS, and a request over HTTP gets `301 Moved Permanently`. Avoid HTTP when you can. If you must send a request over HTTP, tell your HTTP client to follow the redirect to HTTPS. The following examples show how: ```bash # use `-L` to follow HTTP to HTTPS redirections curl -L https://api.meshy.ai/openapi/v1/balance \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```python import requests # requests follows HTTP to HTTPS redirections for GET by default response = requests.get( "https://api.meshy.ai/openapi/v1/balance", headers={"Authorization": f"Bearer {YOUR_API_KEY}"}, allow_redirects=True, ) ``` ```javascript // use `redirect: "follow"` to follow HTTP to HTTPS redirections const response = await fetch("https://api.meshy.ai/openapi/v1/balance", { headers: { Authorization: `Bearer ${YOUR_API_KEY}` }, redirect: "follow", }); ``` Redirects work only for `GET` requests. HTTP clients resend a redirected `POST` as a `GET` without its body, so always call `https://` directly to create tasks. ### API key safety After you create an API key, the Developer Platform doesn't show it again. Store it somewhere safe, because anyone who has the key can call the Meshy API as you. Meshy team members can't view or recover a revoked key for you either. If you think someone else has your key, revoke it on the API Keys page. A revoked key no longer works. An [IP allowlist](#ip-allowlist) makes a leaked key much less useful, but it doesn't replace revoking the key. If a key leaks, revoke it and create a new one. ### Security disclosure If you find a security issue in the Meshy API, [contact Meshy support](mailto:support@meshy.ai?subject=%5BSupport%5D%20Enter%20your%20question%20or%20problem%E2%80%A6&body=How%20can%20we%20assist%20you%3F%20Please%20provide%20any%20relevant%20details%20that%20will%20help%20us%20respond%20to%20your%20inquiry.). Meshy appreciates responsible disclosure and makes every effort to acknowledge your contribution. --- # Errors Source: https://docs.meshy.ai/api/errors # Errors Find out why a request or a task failed, and what to do next. A request can fail right away with an HTTP error, and a task can fail later with a `task_error`. --- ## Request errors Meshy returns these errors right away, when it rejects a request. To find out what went wrong, check the HTTP status code and the `message` field. ### Response format The error response has a `message` field that describes what went wrong: - `message` · *string* A short description of the error. ### Status codes - `2xx` Success. - `200 - OK` The request worked. - `202 - Accepted` Meshy accepted the request, and the processing hasn't finished yet. For example, a request that creates a task returns `202`. - `4xx` Something is wrong with the request or your account. Each status says what to do. - `400 - Bad Request` The request isn't valid, often because a required parameter is missing or a parameter is malformed. - `401 - Unauthorized` The API key is missing, isn't valid, or can't access this endpoint. See [Authentication](/api/authentication). - `402 - Payment Required` The API key's account doesn't have enough credits for the request. On the Free plan, most requests that create a task also return `402`. - `403 - Forbidden` You aren't allowed to make this request, for example for one of these reasons: * The request came from an address outside the API key's IP allowlist. * Your organization's IP filtering blocked a task's files when you read it. * The endpoint isn't available on your plan. * Content moderation blocked the input. Some endpoints return `400` for this instead; each endpoint page lists its codes. * The API key belongs to a team member who is no longer active on the team. * The account is banned. - `404 - Not Found` The resource doesn't exist. For example, getting a task with an ID that doesn't exist returns `404`. - `409 - Conflict` The resource exists, but its state doesn't allow the operation. For example, deleting an `IN_PROGRESS` task returns `409`, because Meshy can't refund a task that a worker has started. The task keeps running. Wait for a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), then delete the task. - `422 - Unprocessable Entity` The request is valid, but Meshy can't process its input. For example, [Rigging](/api/rigging) returns `422` when it can't find a humanoid body in the model. - `429 - Too Many Requests` You sent too many requests, or too many of your tasks are queued or running. When the response has a `Retry-After` header, wait that many seconds, then retry. See [Rate limits](/api/rate-limits). - `5xx` Something went wrong on Meshy's side. Retry with backoff. If the error continues, check the [status page](https://status.meshy.ai) and contact us on [Discord](https://discord.com/invite/KgD5yVM9Y4). **Example: 400 Bad Request** ```bash { "message": "Invalid model file extension: .3dm" } ``` --- ## Task errors A task that Meshy created can still fail while it runs. Its `status` becomes `FAILED`, Meshy refunds its credits, and `task_error` explains why. A failed task's `task_error` has these fields: - `type` · *string* The error category. It's always present on a failed task. Branch on it to decide whether to retry. See [Error types](#error-types). - `message` · *string* A human-readable description of the error. It's always present on a failed task. - `code` · *string* A specific, documented problem you can act on. Present when Meshy has more details. See [Error codes](#error-codes). Meshy may add codes, so handle a code you don't recognize by its `type`. - `doc_url` · *string* A link to the code's entry on this page, which says what to do. Present when `code` is present. **Error with details** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "status": "FAILED", "task_error": { "type": "invalid_input", "code": "image_too_complex", "message": "The uploaded image is too complex for 3D generation.", "doc_url": "https://docs.meshy.ai/en/api/errors#image-too-complex" } } ``` **Error without details** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "status": "FAILED", "task_error": { "type": "server_error", "message": "An internal error occurred. Please retry." } } ``` --- ## Error types `type` is the broad category of the failure. Use it to decide what to do next. - `invalid_input` Something is wrong with the input you sent. Read `code` and `message`, fix the input, and create a new task. - `timeout` The task ran past a server-side time limit, for processing or for waiting in the queue, and failed. Meshy refunds its credits. This is often temporary. Create the task again, and if it keeps failing, try a simpler input. - `service_unavailable` The service was temporarily unavailable. Wait a moment, then create the task again. - `server_error` Something went wrong on Meshy's side while the task ran. Create the task again. If it keeps failing, contact support with the task ID. --- ## Error codes When `code` is present, it names one of the following problems. ### `image_too_complex` The input image or prompt describes a subject that is too geometrically complex for 3D generation. For example: - Dense piles of small objects, such as a crate full of fruit or a stack of books - Intricate repeating patterns, such as lattice structures, scaffolding, or wire meshes - Complex buildings, such as multi-story buildings with many windows and balconies - Several distinct objects in one image, instead of a single subject These inputs are likely too complex: ![A crate of mixed berries](/images/errors/bad_01_berry_crate.png) ![An intricate cathedral ceiling](/images/errors/bad_02_fractal_cathedral.png) ![A building under construction with scaffolding](/images/errors/bad_03_construction_building.png) ![A honeycomb lattice sphere](/images/errors/bad_04_honeycomb_sphere.png) To fix it, try one or more of the following: - Use one object per image. Meshy works best with one clear subject, so don't put several separate objects in the same image or prompt. - Simplify your subject. For example, use a simple vase instead of a vase filled with dozens of flowers. - Avoid scenes. Whole buildings, city blocks, furnished rooms, and landscapes are likely to be too much. Focus on a single object. - Avoid dense repeating structures. Scaffolding, wire meshes, lattices, and piles of small items are common triggers. ### `model_missing_uv` You sent a model for texturing with `enable_original_uv` set to `true`, but the model has no UV coordinates. UV coordinates define how a 2D texture wraps onto the 3D surface. ![No UVs vs Good UVs](/images/errors/uv_missing_vs_good.png) To fix it, do one of the following: - To keep your model's own UV layout, for example for custom seam placement, add UVs to the model in your 3D software. Check them in its UV editor, then upload the model again. STL files can't store UVs, so use GLB, FBX, or OBJ. - If you don't need your own layout, or you aren't sure, leave out `enable_original_uv` or set it to `false`. Meshy then creates a UV layout for the model. The new UVs cover the model well, but you can't control where the texture seams go. ### `model_insufficient_uv` The model has UV coordinates, but they cover too little of the UV space to texture well. This often happens with models whose exporter wrote placeholder or collapsed UVs without a proper unwrap. ![Insufficient UVs vs Good UVs](/images/errors/uv_insufficient_vs_good.png) To fix it, do one of the following: - To keep your own UV layout, unwrap the model's UVs again in your 3D software. Spread the islands across the UV space instead of a small corner of it. - If you don't need your own layout, leave out `enable_original_uv` or set it to `false`. Meshy then creates a new UV layout. You lose your seam placement, but the new UVs cover enough space to texture. ### `model_missing_texture` A [Multi-Color Print](/api/multi-color-print) task's input model has no color that Meshy can split into print colors. Meshy builds a multi-color 3MF from the model's colors, so a plain white mesh has nothing to work with. For example, a Text to 3D or Image to 3D preview that was never textured has no color. Neither does the output of Repair Printability, or an Auto Split task that didn't keep the texture. What counts as color depends on the `style` you requested: - `realistic` samples the base color texture through the model's UVs. It needs a single base color texture, and UVs on every mesh part. - `cartoon` flattens colors per face. It accepts a base color texture on any part, or per-vertex colors (`COLOR_0`). Meshy rejects a model with neither a base color texture nor vertex colors for both styles, instead of letting `cartoon` turn it into a single-color print. Meshy refuses most of these requests before it creates the task, with a `400` and the same explanation. You usually get this code only when Meshy can't check the input up front. For example, Meshy checks an `.fbx` upload only after the task converts it. To fix it, use the option that fits your model: - Texture the model first. Run [Retexture](/api/retexture) on it, or generate it with a Text to 3D refine task or an Image to 3D task with `should_texture: true`. Then send that task as `input_task_id`. - For a vertex-colored model, such as a photogrammetry scan or a hand-painted mesh, use `style: "cartoon"`, which reads `COLOR_0`. - For a partly textured or multi-texture model with `realistic`, give every mesh part UVs and the same single base color texture. To do that, texture the remaining parts, or merge the textures into one atlas. You can also switch to `style: "cartoon"`. ### `textured_split_refused` An [Auto Split](/api/auto-split) task with `keep_texture: true` can't keep the input model's texture on the parts. For example, the model has no UVs, or its texture has no room for the new faces the cuts create. Meshy refunds the credits. To fix it, send the request again without `keep_texture`, or with `keep_texture: false`. The parts then come back with a flat color each. ### `invalid_input` The input failed a check, and no more specific code applies. `message` gives the reason. For example: - An empty or corrupted model file - An unsupported variant of a file format, such as an ASCII FBX file or a meshopt-compressed GLB file - An uploaded model with no valid 3D objects, for example a file with only armatures, cameras, or lights - Content that doesn't pass safety filters To fix it, read `message` for the specific problem. Check that your input files and parameters meet the endpoint's requirements. ### `moderation_blocked` Safety filters rejected your prompt or reference images. The filters check the text and the images together. To fix it, do one or both of the following: - Rephrase the prompt to remove suggestive or sensitive descriptions. - Change reference images that show content the filters might block. ### `moderation_unavailable` Type: `server_error`. Content moderation was temporarily unavailable, so Meshy failed the task instead of skipping the check. Nothing is wrong with your content. To fix it, create the task again. ### `timeout` The task ran past a server-side time limit, for processing or for waiting in the queue, so Meshy failed it and refunded its credits. High load, or an input too complex to finish in time, can cause it. This is different from a timeout in your own code. If your client stopped waiting, the task is still running. See [How long to wait](/api/task-lifecycle#how-long-to-wait). To fix it, follow these steps: 1. Create the task again. Timeouts are often temporary, and a new task might succeed. 2. If it keeps failing, simplify your input, for example by reducing the detail in your image or prompt. For inputs that are harder to process, see [`image_too_complex`](#image-too-complex). ### `queue_timeout` Type: `timeout`. The task waited in the queue too long without starting, so Meshy failed it and returned any credits charged for it. Your input didn't cause this error. To fix it, create the task again. ### `format_conversion_failed` Meshy generated the model, but converting it to a format you requested failed. To fix it, follow these steps: 1. Create the task again. 2. If one format keeps failing, request a different format that suits your needs. --- ## Best practices - Retry failed tasks. For a failed task with `timeout`, `service_unavailable`, or `server_error`, create a new task with exponential backoff. - Don't create a new task when your own request times out. The first task might still be running, so check whether it exists before you create another. See [How long to wait](/api/task-lifecycle#how-long-to-wait). - Log task IDs. Include the ID when you contact support. - Check inputs before you send them. Make sure images and models meet the endpoint's format requirements. - Call the API from your server. Code that runs in a browser exposes your API key to anyone who opens the page. --- # Pricing Source: https://docs.meshy.ai/api/pricing # Pricing Check how many credits each Meshy API request costs. --- The Meshy API uses prepaid credits. Before you send API requests, buy API credits in your [subscription settings](https://www.meshy.ai/settings/subscription). For volume pricing or a custom contract, [contact sales](https://www.meshy.ai/contact). ## Credit calculator To estimate the credit cost of one request, select an API and set its options. The following pricing tables list every price. [Open the interactive credit calculator](/api/pricing#credit-calculator) ## API pricing Prices are in credits per request, unless a row says otherwise. Not supported means the API doesn't offer that option. For how long each configuration usually takes, see [Processing times](/api/task-lifecycle#processing-times). ### 3D generation The following prices include the texture option you select, with the default texture model of each `ai_model`. When you use Ultra geometry, add the Ultra geometry surcharge. | API | Configuration | `meshy-7.1` (`latest`) | `meshy-6` | `meshy-6-lite` | `meshy-t2` | `meshy-t2.5` | | --- | --- | --- | --- | --- | --- | --- | | [Text to 3D (Preview)](/api/text-to-3d#create-a-text-to-3d-preview-task) | Mesh only | 20 | 20 | 5 | 5 | 5 | | [Image to 3D](/api/image-to-3d) | Mesh only | 20 | 20 | 5 | 5 | 5 | | | Mesh with 2K textures | 30 | 30 | 15 | 15 | 15 | | | Mesh with 4K textures | 30 | 30 | Not supported | 15 | 15 | | | Mesh with 8K textures | 35 | 35 | Not supported | 20 | 20 | | [Multi-Image to 3D](/api/multi-image-to-3d) | Mesh only | 20 | 20 | 5 | Not supported | Not supported | | | Mesh with 2K textures | 30 | 30 | 15 | Not supported | Not supported | | | Mesh with 4K textures | 30 | 30 | Not supported | Not supported | Not supported | | | Mesh with 8K textures | 35 | 35 | Not supported | Not supported | Not supported | | Ultra geometry surcharge | `geometry_resolution: "2k"` or `"4k"` | +5 | Not supported | Not supported | Not supported | Not supported | *Legacy models: `meshy-7` costs the same as `meshy-7.1`.* ### Texture models With a [texture model](/api/models#texture-models) other than the default, an Image to 3D or Multi-Image to 3D task costs the mesh-only price plus the Retexture price at its texture resolution. When you use Ultra geometry, add the Ultra geometry surcharge. The following table shows the price of each pair. | API | `ai_model` | `texture_model` | 2K textures | 4K textures | 8K textures | | --- | --- | --- | --- | --- | --- | | [Image to 3D](/api/image-to-3d) | `meshy-7.1` (`latest`) | `meshy-n1` | 30 | Not supported | Not supported | | | | `meshy-6-lite` | 30 | Not supported | Not supported | | | `meshy-6` | `meshy-7` | 30 | 30 | 35 | | | | `meshy-n1` | 30 | Not supported | Not supported | | | | `meshy-6-lite` | 30 | Not supported | Not supported | | | `meshy-6-lite` | `meshy-7` | 15 | 15 | 20 | | | | `meshy-n1` | 15 | Not supported | Not supported | | | `meshy-t2` or `meshy-t2.5` | `meshy-n1` | 15 | Not supported | Not supported | | | | `meshy-6-lite` | 15 | Not supported | Not supported | | [Multi-Image to 3D](/api/multi-image-to-3d) | `meshy-7.1` (`latest`) | `meshy-n1` | 30 | Not supported | Not supported | | | `meshy-6` | `meshy-7` | 30 | 30 | 35 | | | | `meshy-n1` | 30 | Not supported | Not supported | | | `meshy-6-lite` | `meshy-7` | 15 | 15 | 20 | | | | `meshy-n1` | 15 | Not supported | Not supported | ### Texturing Text to 3D Preview and Refine are separate requests, and Meshy bills them separately. The following Refine prices cover texture generation only. | API | Texture resolution | Credits per request | | --- | --- | --- | | [Text to 3D (Refine)](/api/text-to-3d#create-a-text-to-3d-refine-task) | 2K / 4K | 10 | | | 8K | 15 | | [Retexture](/api/retexture) | 2K / 4K | 10 | | | 8K | 15 | ### Image generation The price of Text to Image and Image to Image depends on the image model: | API | `nano-banana` | `nano-banana-2` | `nano-banana-2-lite` | `nano-banana-2-1` | `nano-banana-pro` | GPT Image models | | --- | --- | --- | --- | --- | --- | --- | | [Text to Image](/api/text-to-image) | 3 | 6 | 3 | 4 | 9 | 9 | | [Image to Image](/api/image-to-image) | 3 | 6 | 3 | 4 | 9 | 12 | ### Rigging and animation Animation is billed per action, and the other APIs are billed per request: | API | Configuration | Credits | | --- | --- | --- | | [Rigging](/api/rigging) | Automatic rigging | 5 per request | | [Animation](/api/animation) | Up to 10 actions per request | 3 per action | | [Text to Motion](/api/text-to-motion) | `prime` mode | 10 per request | | | `swift` mode | 3 per request | ### Post-processing Each post-processing request has a fixed price: | API | Credits per request | | --- | --- | | [Remesh](/api/remesh) | 5 | | [UV Unwrap](/api/uv-unwrap) | 5 | | [Convert](/api/convert) | 1 | | [Resize](/api/resize) | 1 | ### 3D printing Each 3D printing request has a fixed price: | API | Credits per request | | --- | --- | | [Analyze Printability](/api/analyze-printability) | Free | | [Multi-Color Print](/api/multi-color-print) | 10 | | [Repair Printability](/api/repair-printability) | 10 | | [Auto Split](/api/auto-split) | 10 | | [Relief](/api/relief) | 20 | ## Creative Lab APIs with separate Prototype and Build stages bill each stage separately. Prices are in credits per request. Not supported in the Prototype column means the API has a single stage. | API | Prototype | Build | | --- | --- | --- | | [Keychain](/api/creative-lab-keychain) | 6 | 30 | | [Fridge Magnet](/api/creative-lab-fridge-magnet) | 6 | 30 | | [Figure](/api/creative-lab-figure) | 6 | 30 | | [Vinyl Figure](/api/creative-lab-vinyl-figure) | 6 | 30 | | [Brick Figure](/api/creative-lab-brick-figure) | 6 | 30 | | [Fidget Pixel](/api/creative-lab-fidget-pixel) | 6 | 30 | | [Keycap](/api/creative-lab-keycap) | 12 | 50 | | [Lamp](/api/creative-lab-lamp) | 30 | 6 | | [Collapsible Fidget](/api/creative-lab-fidget-collapsible) | Not supported | 6 (single-stage generation) | --- # Rate Limits Source: https://docs.meshy.ai/api/rate-limits # Rate limits Check how many requests and tasks your plan allows, and what to do when you reach a limit. --- ## Limits by plan To keep the API fast and available for everyone, Meshy limits each account in two ways: - Requests per second: how many API requests you can send each second. - Concurrent tasks: how many of your tasks can be `PENDING` or `IN_PROGRESS` at the same time. The limits depend on your plan: | Plan | Requests per second | Concurrent tasks | Priority | | --- | --- | --- | --- | | Pro | 20 | 10 | Default | | Premium | 20 | 30 | Higher than Pro | | Ultra | 20 | 100 | Highest | | Studio | 20 | 60, or 20 on some earlier Studio plans | Higher than Pro | | Enterprise | 100 | 100 by default, or a custom limit | Highest | Priority isn't a limit. When the queue is busy, Meshy starts the tasks with a higher priority first. ### What counts toward each limit Every API request counts toward requests per second, including requests that get, list, or stream tasks. Requests from the Meshy web app don't count. The concurrent tasks limit counts tasks, not requests. Every endpoint that creates a task checks this limit before it creates one. For example, Text to 3D, Image to 3D, Multi-Image to 3D, Retexture, Remesh, Rigging, Animation, Text to Image, the 3D printing endpoints, and Creative Lab check it. Requests that don't create a task don't count toward it. For example, Balance, Usage, and requests that get, list, or stream tasks don't count. ### Whose limits apply The following table shows whose limits your API keys, the Playground, and the web app count toward: | Where you work | Personal account | Team | | --- | --- | --- | | API keys | Your limits | The team's limits, shared by every API key in the team | | Playground | Your limits | Your own limits as the signed-in member | | Web app | Your concurrent tasks | Your own concurrent tasks. Tasks the team owner starts also count toward the team's limits. | --- ## When you reach a limit When you go over a limit, the API returns `429 Too Many Requests`. The message tells you which limit you reached: - Too many requests per second: the message is `Rate limit exceeded`. Wait the number of seconds in the `Retry-After` header, then retry. - Too many concurrent tasks: the message starts with `NoMorePendingTasks`. On an unlimited plan with no credits left, it starts with `NoMoreConcurrentTasks`. This `429` has no `Retry-After` header. Wait for one of your tasks to finish, then create the next one. --- ## Rate limit headers API responses include these headers to help you pace your requests: | Header | Description | | --- | --- | | `X-RateLimit-Limit` | Requests allowed per second on your plan. | | `X-RateLimit-Remaining` | Requests left in the current second. | | `X-RateLimit-Reset` | Seconds until your budget is full again. | | `Retry-After` | Seconds to wait before your next request. Sent with a `429` for too many requests per second, and when you get a task that is still `PENDING` or `IN_PROGRESS`. | When `Retry-After` is present, wait that many seconds before you send the next request. --- # Task Lifecycle Source: https://docs.meshy.ai/api/task-lifecycle # Task lifecycle Learn how a task moves from request to result, how long it usually takes, and how long your code should wait for it. --- ## How a task runs A create request returns a task ID without waiting for the task to run. The task then runs in the background, and you follow it in one of three ways: poll its GET endpoint, open its stream endpoint, or receive a [webhook](/api/webhooks). `PENDING` -> `IN_PROGRESS` -> `SUCCEEDED` | `FAILED` - `PENDING`: Waiting in the queue - `IN_PROGRESS`: Generating the result - `SUCCEEDED`: Download the result - `FAILED`: Credits refunded The task records each step in its `created_at`, `started_at`, and `finished_at` fields. The following table shows what your code should do at each status. | Status | What your code should do | | --- | --- | | `PENDING` | Keep waiting. | | `IN_PROGRESS` | Track `progress`: the percentage of the work that's done, from 0 to 100. | | `SUCCEEDED` | Download the result. Meshy keeps the files for a limited time. See [Asset retention](/api/asset-retention). | | `FAILED` | Read `task_error`, then fix the input or create a new task. See [Errors](/api/errors). | | `CANCELED` | Stop waiting. The task won't produce a result. Only Creative Lab tasks use this status. | `SUCCEEDED`, `FAILED`, and `CANCELED` are final. After a task reaches one of them, its status never changes again. From your code, it looks like this: 1. `POST /openapi/v1/image-to-3d` returns `202 {"result": ""}` (task created). 2. Repeat every few seconds: `GET /openapi/v1/image-to-3d/` returns `200 {"status": "IN_PROGRESS", "progress": 45}` with a `Retry-After` header. 3. A later `GET /openapi/v1/image-to-3d/` returns `200 {"status": "SUCCEEDED", "model_urls": {...}}`. If your app stops waiting, the task keeps running. `GET` it later with the same task ID. --- ## Processing times The following tables show median times on production API traffic in September 2026. A time runs from task creation to the final status. Nearly all of it is processing, because a task usually stays in `PENDING` for only a few seconds. When the queue is busy, tasks can wait longer before they start, and tasks on plans with a higher [priority](/api/rate-limits#how-limits-work) usually start sooner. Times under 2 minutes are in seconds (s), and longer times are in minutes (min). Not supported means the API doesn't offer that option with that model. > **Note:** These are typical times, not guaranteed completion times. During busy periods, some tasks take longer and still succeed. To check Meshy's status, see the [status page](https://status.meshy.ai). Don't use these times as timeouts in your code. For timeout values, see [How long to wait](#how-long-to-wait). ### 3D generation | API | Configuration | `meshy-7.1` (`latest`) | `meshy-6` | `meshy-6-lite` | `meshy-t2` | | --- | --- | --- | --- | --- | --- | | [Text to 3D (Preview)](/api/text-to-3d#create-a-text-to-3d-preview-task) | Mesh only | 75 s | 90 s | 45 s | 10 s | | [Image to 3D](/api/image-to-3d) | Mesh only | 75 s | 90 s | 40 s | 4 s | | | Mesh with 2K textures | 2 min | 3 min | 75 s | 60 s | | | Mesh with 4K textures | 2.5 min | 3.5 min | Not supported | 80 s | | | Mesh with 8K textures | 3.5 min | 4 min | Not supported | 2.5 min | | [Multi-Image to 3D](/api/multi-image-to-3d) | Mesh only | 65 s | 2 min | 30 s | Not supported | | | Mesh with 2K textures | 2.5 min | 3.5 min | 85 s | Not supported | | | Mesh with 4K textures | 3 min | 4 min | Not supported | Not supported | | | Mesh with 8K textures | 3.5 min | 4.5 min | Not supported | Not supported | For Image to 3D and Multi-Image to 3D, "Mesh only" means `should_texture: false`. These options and inputs change the time: - PBR maps (`enable_pbr`) add 30 to 60 seconds. - Ultra geometry (`geometry_resolution: "2k"` or `"4k"`) adds up to 1 minute. - With the same settings, more complex input images take longer. ### Texturing | API | Texture resolution | Typical time | | --- | --- | --- | | [Text to 3D (Refine)](/api/text-to-3d#create-a-text-to-3d-refine-task) | 2K or 4K | 80 s | | | 8K | 3.5 min | | [Retexture](/api/retexture) | 2K | 55 s | | | 4K | 90 s | | | 8K | 2.5 min | ### Image generation | API | `nano-banana` | `nano-banana-2` | `nano-banana-pro` | GPT Image models | | --- | --- | --- | --- | --- | | [Text to Image](/api/text-to-image) | 20 s | 15 s | 25 s | 20 to 35 s | | [Image to Image](/api/image-to-image) | 40 s | 20 s | 30 s | 20 to 40 s | ### Rigging and Animation | API | Configuration | Typical time | | --- | --- | --- | | [Auto-Rigging](/api/rigging) | Automatic rigging | 40 s | | [Animation](/api/animation) | Per request | 15 s | | [Text to Motion](/api/text-to-motion) | `prime` mode | 15 s | | | `swift` mode | 10 s | ### Post-processing | API | Typical time | | --- | --- | | [Remesh](/api/remesh) | 2 min | | [UV Unwrap](/api/uv-unwrap) | 35 s | | [Convert](/api/convert) | 7 s | | [Resize](/api/resize) | 15 s | ### 3D printing | API | Configuration | Typical time | | --- | --- | --- | | [Analyze Printability](/api/analyze-printability) | Mesh checks only | 1 s | | | Mesh and thin-wall checks | 10 s | | [Multi-Color](/api/multi-color-print) | Per request | 30 s | | [Repair Printability](/api/repair-printability) | Mesh repair only | 10 s | | | Thin-wall check, walls kept | 20 s | | | Thin-wall check, walls thickened | 100 s | | [Auto Split](/api/auto-split) | Flat-colored parts | 70 s | | | Textured parts (`keep_texture: true`) | 170 s | On v2, Repair Printability and Analyze Printability always run the thin-wall check. On v1, they run it when you send a printer type or a print size. --- ## How long to wait The task keeps running even if your code stops waiting. If your request times out, your connection drops, or your stream closes, the task doesn't fail and isn't canceled. - Wait at least 60 minutes, counted from the task's `created_at`, before you stop waiting. If you stop earlier, you might miss a task that succeeds later. This happens mostly during busy periods. - Keep the task ID. You can get the task again at any time. If it still isn't final after 60 minutes, check it again later. If it stays that way, contact support. - Only `FAILED` means the task failed. Meshy refunds failed tasks automatically. Use these values in your code: | Setting | Recommended value | | --- | --- | | Create request (`POST`) timeout | 60 seconds | | Create request (`POST`) timeout with a `model_url` file over 100 MB | 120 seconds. Meshy downloads the file before it responds. | | Status request (`GET`) timeout | 30 seconds | | Poll interval | The `Retry-After` header, or 5 seconds if it's missing. Polls count toward your [rate limit](/api/rate-limits). | | Failed status request (timeout, `429`, or `5xx`) | Try again at the next poll. It doesn't mean the task failed. | | Overall wait per task | At least 60 minutes from `created_at`. Don't restart this count when you reconnect a stream. | | Stream | A stream can close before the task finishes. If it closes without a final status, reconnect or switch to polling. | For many tasks at once, use [webhooks](/api/webhooks) instead of polling each one. If a task's final event hasn't arrived after about twice its typical time, get the task from its `GET` endpoint. --- # Asset Retention Source: https://docs.meshy.ai/api/asset-retention # Asset retention Find out how long Meshy keeps the files you generate, and how to keep your own copy. --- Meshy keeps the models you generate through the API for at most **3 days**. After that, Meshy deletes them from its servers. If you aren't an Enterprise customer and need a model for longer, download it and store your own copy. Enterprise customers can keep their models indefinitely. ## Download URLs are signed The URLs in a task's `model_urls`, `texture_urls`, and `thumbnail_url` point at `assets.meshy.ai` and carry a signature (`?Expires=…&Signature=…`). A URL stops working at the task's `expires_at`. Getting the task again returns the same URL with the same expiry. A Text to 3D task has no `expires_at`, or has it as `null`, and its URLs carry no expiry. That doesn't mean Meshy keeps the task. Unless you're an Enterprise customer, Meshy deletes the task 3 days after it finishes: getting it then returns `404`, and its files are removed later. Download what you need within 3 days. Because of this, follow these rules: - Download the files when the task reaches `SUCCEEDED`, and keep your own copy if you need the model for longer. - Don't store a download URL to send back to Meshy later as `model_url`, for example to [Analyze Printability](/api/analyze-printability), [Repair Printability](/api/repair-printability), or [Remesh](/api/remesh). After the signature expires, that request fails with `400 failed to download model file`. - While Meshy still keeps the source task, send its ID as `input_task_id` instead. After that, the task returns `404 Task not found`, so send your own stored copy. --- # Deprecations Source: https://docs.meshy.ai/api/deprecations # Deprecations See which Meshy AI models and API features are active, deprecated, or retired, and find retirement dates and recommended replacements. As Meshy releases new models, it retires older ones. Integrations that rely on an older model or API feature may need occasional updates to keep working. This page lists every API deprecation, along with its recommended replacement. --- ## Overview Meshy uses these terms to describe the lifecycle of a model or API feature: - **Active:** Fully supported and recommended for use. - **Legacy:** No longer receives updates and may be deprecated in the future. It still works, and nothing about your request or your bill changes. - **Deprecated:** Still works, but no longer recommended. Meshy names a recommended replacement and, once it is scheduled, a retirement date. - **Retired:** No longer available. Requests that use a retired model or feature return an error. Retiring a model doesn't delete what you already made with it. Tasks you created with a retired model stay available for the usual [retention period](/api/asset-retention). --- ## Migrating to Replacements Once a model is deprecated, move all your requests to its replacement before the retirement date. Requests that use the model after that date fail. A replacement can produce different results from the model it replaces. Test your integration with the replacement well before the retirement date, for example in the [Playground](/api/developer-platform#playground). --- ## Notifications Meshy announces every deprecation and retirement in the [Changelog](/api/changelog) and on this page. While a retirement is upcoming, a banner at the top of every API page shows it, and the endpoint pages mark the model or parameter as deprecated. Meshy announces a retirement date at least one month before the retirement. --- ## Best Practices 1. Check the [Changelog](/api/changelog) and this page regularly for deprecation updates. 2. Set `ai_model` to a specific model, such as `meshy-7.1`, if your integration needs consistent output. `latest` always points to the newest standard model, so its output changes when a new model is released. 3. Test your integration with the replacement well before the retirement date of your current model. 4. Update your code to use the recommended replacement as soon as possible. 5. Contact [support@meshy.ai](mailto:support@meshy.ai) if you need help with a migration. --- ## Model Status Current and retired 3D generation models of [Text to 3D](/api/text-to-3d), [Image to 3D](/api/image-to-3d), [Multi-Image to 3D](/api/multi-image-to-3d), and [Retexture](/api/retexture). Not every endpoint offers every model; each endpoint page lists the models it accepts. | API model name | Current state | Deprecated | Retirement date | | :------------- | :------------ | :--------- | :-------------- | | `meshy-7.1` | Active | N/A | N/A | | `meshy-7` | Deprecated | September 18, 2026 | To be announced | | `meshy-6` | Active | N/A | N/A | | `meshy-6-lite` | Active | N/A | N/A | | `meshy-n1` | Active | N/A | N/A | | `meshy-5` | Retired | September 11, 2026 | October 10, 2026 | | `meshy-4` | Retired | N/A | March 20, 2026 | | `meshy-3` | Retired | January 14, 2025 | July 2025 | | `meshy-t2.5` | Active | N/A | N/A | | `meshy-t2` | Active | N/A | N/A | | `meshy-t1` | Deprecated | July 13, 2026 | November 30, 2026 | | `model_type: "lowpoly"` | Deprecated | July 13, 2026 | November 30, 2026 | `latest` resolves to `meshy-7.1`. Until November 30, 2026, these requests still run on a Smart Topology model with triangle topology and cost the Smart Topology price: * [Image to 3D](/api/image-to-3d) with `model_type: "smart-topology"` and `ai_model: "meshy-t1"`, or with `model_type: "lowpoly"` and `ai_model` left out, `latest`, or `meshy-6`. Meshy ignores `target_polycount`, `topology`, `image_enhancement`, `remove_lighting`, and `experimental` on them. * A [Text to 3D](/api/text-to-3d) preview with `model_type: "lowpoly"` and `ai_model` left out, `latest`, `meshy-6`, or `meshy-4` (otherwise retired, `meshy-4` is accepted here only for this fallback). Meshy ignores `target_polycount`, `topology`, and `experimental` on it. Every other request for `meshy-t1` or `lowpoly` already returns `400`. From November 30, 2026, these return `400` too. --- ## Deprecation History All deprecations are listed below, with the most recent announcements first. | Announced | Deprecated model or feature | Retirement date | Recommended replacement | | :-------- | :-------------------------- | :-------------- | :---------------------- | | 2026-10-02 | `model_type: "lowpoly"` and `meshy-t1` on [Text to 3D](/api/text-to-3d) and [Image to 3D](/api/image-to-3d) | November 30, 2026 | `model_type: "smart-topology"` with `ai_model: "meshy-t2.5"` | | 2026-09-29 | `/v2/text-to-3d` without the `/openapi` prefix | To be announced | [`/openapi/v2/text-to-3d`](/api/text-to-3d) | | 2026-09-18 | `meshy-7` | To be announced | `meshy-7.1` | | 2026-09-16 | Shared test-mode API key | September 16, 2026 | Your own key from the [API Keys page](https://www.meshy.ai/developers/keys), or the [Playground](/api/developer-platform#playground) | | 2026-09-11 | `meshy-5` | October 10, 2026 | `meshy-6-lite` | | 2026-03-20 | `meshy-4` | March 20, 2026 | `meshy-6` | | 2025-10-01 | Text to Voxel API | October 1, 2025 | None | | 2025-07-01 | Text to Texture API | July 1, 2025 | [Retexture](/api/retexture) | | 2025-01-14 | `meshy-3` | July 2025 | `meshy-6` | --- ## API Parameter Deprecations Meshy occasionally deprecates request parameters and response fields that newer models replace or no longer use. They still work unless noted, but a future release can remove them. | Parameter | Status | Behavior | Recommended replacement | | --------- | ------ | -------- | ----------------------- | | `texture_image_url` on [Rigging](/api/rigging#create-a-rigging-task) | Deprecated October 23, 2026 | Still works. The image becomes the rigged model's only texture, and the model loses its PBR maps. | Omit it. Meshy uses the textures of `model_url` or of the input task. | | `ultra_mode` | Deprecated September 18, 2026 | `ultra_mode: true` is the same as `geometry_resolution: "2k"`. | `geometry_resolution` | | `hd_texture` | Deprecated July 21, 2026 | `hd_texture: true` is the same as `texture_resolution: "4k"`. If you send both, Meshy uses `texture_resolution`. | `texture_resolution` | | Convert and resize parameters of [Remesh](/api/remesh) | Deprecated May 22, 2026 | Still work. | [Convert](/api/convert) and [Resize](/api/resize) | | `symmetry_mode` | Deprecated May 11, 2026 | Accepted and ignored. | Omit it. | | `art_style` on Text to 3D Preview | Deprecated January 22, 2026 | Accepted and ignored. It applied only to Meshy 4 and Meshy 5. | Omit it. | | `is_a_t_pose` | Deprecated December 4, 2025 | Still works. | `pose_mode` | --- # Webhooks Source: https://docs.meshy.ai/api/webhooks # Webhooks Have Meshy send a `POST` request to your server when an API task makes progress or finishes, so you don't need to poll. --- ## Why use webhooks Webhooks take less work and cost less than polling the API for each task's status. Meshy sends each update as it happens, so you get it sooner, and webhooks scale better than polling. You also send fewer requests, which keeps you further from your [rate limits](/api/rate-limits). --- ## Set up a webhook To add a webhook, follow these steps: 1. Open the [Webhooks page](https://www.meshy.ai/developers/webhooks) in the [Developer Platform](/api/developer-platform), and click **Create Webhook**. 2. In **Payload URL**, enter the URL that receives the deliveries. Meshy delivers only over `https://`. 3. Keep a copy of the **Webhook Secret** that the dialog fills in. Every delivery carries it, so your server can check that a request came from Meshy. For a webhook you already have, click the eye icon in its **Secret** column to see it. 4. Select **Active**, and click **Confirm**. Each account can have 5 active webhooks, and 10 in total. Every active webhook receives the status updates of all your API tasks. To test a webhook with a server on your computer, see [Test on your computer](#forwarding-webhooks-for-local-testing). --- ## Handle a delivery To accept a delivery, respond with a status below 400, such as `200` or `202`. Meshy waits about 25 seconds for the response, so store the delivery and respond first. Do the slow work after that, such as downloading the model. A status of 400 or above, or no response, counts as a failed delivery. Meshy retries it with longer waits between attempts, up to 4 times for an `IN_PROGRESS` update and up to 9 times for a final status. If 20 updates in a row fail every attempt, Meshy can deactivate the webhook. To turn it back on, edit it on the Webhooks page and select **Active**. Write your code for these cases: - Deliveries can arrive out of order. An `IN_PROGRESS` delivery can arrive after the final one, so don't let it replace a final status. - The same update can arrive more than once. Handle each pair of `id` and `status` once. - Anyone who knows your URL can send it a request. Compare `X-MESHY-API-WEBHOOK-SECRET-KEY` with your copy of the secret, and reject a request that doesn't match. If a task's final delivery hasn't arrived after about twice the task's typical time, get the task from its `GET` endpoint. For typical times and how long to wait, see [Task lifecycle](/api/task-lifecycle#processing-times). --- ## Test on your computer Meshy delivers only to a public `https://` URL, so it can't reach a server on your computer directly. To test code on your computer, forward a public URL to it with a webhook proxy. These steps use [smee.io](https://smee.io/), and any webhook proxy service works the same way. 1. Open [smee.io](https://smee.io/) and click **Start a new channel**. Copy the URL under **Webhook Proxy URL**. 2. If you don't have the smee client yet, install it: ```text npm install --global smee-client ``` 3. Forward the channel to your server. Replace `WEBHOOK_PROXY_URL` with your Webhook Proxy URL: ```text smee --url WEBHOOK_PROXY_URL --path /webhook --port 3000 ``` The output looks like this, where `WEBHOOK_PROXY_URL` is your Webhook Proxy URL: ```text Forwarding WEBHOOK_PROXY_URL to http://127.0.0.1:3000/webhook Connected WEBHOOK_PROXY_URL ``` Keep it running while you test. To stop forwarding, press Ctrl+C. Your server receives the deliveries on port `3000` at the path `/webhook`, so set up your code to listen there. 4. On the [Webhooks page](https://www.meshy.ai/developers/webhooks), create a webhook with the Webhook Proxy URL as its **Payload URL**. --- ## Delivery payload Meshy sends a delivery while a task is `IN_PROGRESS`, and another when the task reaches a final status. A task can reach its final status without an `IN_PROGRESS` delivery. Each delivery is a `POST` to your Payload URL with these headers: | Header | Value | | --- | --- | | `X-MESHY-API-WEBHOOK-SECRET-KEY` | The webhook's secret | | `X-MESHY-API-WEBHOOK-USER-ID` | The ID of the Meshy user who owns the webhook | | `Meshy-Webhook-Version` | `v1`, the format of the body | | `Content-Type` | `application/json` | | `User-Agent` | `MeshyAPIWebhook/1.0.0` | The JSON body is the task object. It's the same object that the task's `GET` endpoint returns, except `progress`. A delivery sends `progress` as one of these values: - `50` while the task is `IN_PROGRESS` - `100` when the task succeeds - `0` when the task fails or is canceled For the fields of each task object, with an example, see the following sections: - [Text to 3D task object](/api/text-to-3d#example-text-to-3d-task-object) - [Image to 3D task object](/api/image-to-3d#example-image-to-3d-task-object) - [Multi-Image to 3D task object](/api/multi-image-to-3d#example-multi-image-to-3d-task-object) - [Remesh task object](/api/remesh#example-remesh-task-object) - [Retexture task object](/api/retexture#example-retexture-task-object) - [Rigging task object](/api/rigging#example-rigging-task-object) - [Animation task object](/api/animation#example-animation-task-object) --- # Metadata Source: https://docs.meshy.ai/api/metadata # Metadata Tag each task with your own key-value pairs, such as the user or team it ran for, and read them back on its usage record. Only API keys of Studio and Enterprise teams can tag tasks. On other plans, Meshy ignores the header and never returns `400` for it. --- ## Tag a task To tag a task, send the `X-Meshy-Metadata` header with the request that creates it: ```http X-Meshy-Metadata: user=alex@example.com,team=fab ``` The header value follows the [W3C Baggage](https://www.w3.org/TR/baggage/) format, with at most 64 pairs and 8,192 bytes. A header that's malformed or over these limits returns `400`, and Meshy doesn't create the task. Creative Lab endpoints ignore the header and never return `400` for it. --- ## Read the tags Each record of the [Usage API](/api/usage#the-usage-record-object) has the task's tags in its `metadata` field, for example `{"user": "alex@example.com", "team": "fab"}`. It's `{}` for a task without tags. --- # AI Integration Source: https://docs.meshy.ai/api/ai # AI integration Connect AI agents and coding assistants to Meshy, with the Meshy MCP server for tool calls, or with `llms.txt` and `llms-full.txt` for reading the docs. If you use Claude Code, Cursor, Windsurf, Codex, or another MCP client, install the MCP server. If your chat agent doesn't support MCP, point it at [`https://docs.meshy.ai/llms.txt`](/llms.txt) instead. --- ## What is MCP The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard that lets AI assistants call external tools and get structured context. The Meshy MCP server wraps the Meshy REST API as tools that your agent can call. With them, the agent can generate a model, check a task, and download the result without hand-written HTTP code. The MCP server is open source. It's published on npm as [`@meshy-ai/meshy-mcp-server`](https://www.npmjs.com/package/@meshy-ai/meshy-mcp-server), and its source is in the [meshy-mcp-server repository](https://github.com/meshy-dev/meshy-mcp-server) on GitHub. You need a Meshy API key. Create one on the [API Keys page](https://www.meshy.ai/developers/keys) of the [Developer Platform](https://www.meshy.ai/developers). The MCP server reads it from the `MESHY_API_KEY` environment variable. --- ## Install the MCP server To install the server, use the tab for your AI client. Replace `msy_YOUR_API_KEY` with your API key. Each setup saves the key in your user-level config, outside any project, so it doesn't end up in a repository. **Claude Code** ```bash # macOS / Linux / WSL claude mcp add -s user meshy --env MESHY_API_KEY=msy_YOUR_API_KEY -- npx -y @meshy-ai/meshy-mcp-server # Windows (PowerShell or Command Prompt) claude mcp add -s user meshy --env MESHY_API_KEY=msy_YOUR_API_KEY "--" cmd /c npx -y @meshy-ai/meshy-mcp-server ``` **Cursor** ```json // ~/.cursor/mcp.json (applies to every project) { "mcpServers": { "meshy": { "command": "npx", "args": ["-y", "@meshy-ai/meshy-mcp-server"], "env": { "MESHY_API_KEY": "msy_YOUR_API_KEY" } } } } ``` **Windsurf** ```json // ~/.codeium/windsurf/mcp_config.json { "mcpServers": { "meshy": { "command": "npx", "args": ["-y", "@meshy-ai/meshy-mcp-server"], "env": { "MESHY_API_KEY": "msy_YOUR_API_KEY" } } } } ``` **Claude Desktop** ```json // ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) // %APPDATA%\Claude\claude_desktop_config.json (Windows) { "mcpServers": { "meshy": { "command": "npx", "args": ["-y", "@meshy-ai/meshy-mcp-server"], "env": { "MESHY_API_KEY": "msy_YOUR_API_KEY" } } } } ``` **Codex** ```bash # macOS / Linux / WSL codex mcp add meshy --env MESHY_API_KEY=msy_YOUR_API_KEY -- npx -y @meshy-ai/meshy-mcp-server # Windows (PowerShell or Command Prompt) codex mcp add meshy --env MESHY_API_KEY=msy_YOUR_API_KEY -- cmd /c npx -y @meshy-ai/meshy-mcp-server ``` **VS Code** ```json // User configuration: run "MCP: Open User Configuration" from the Command Palette { "servers": { "meshy": { "command": "npx", "args": ["-y", "@meshy-ai/meshy-mcp-server"], "env": { "MESHY_API_KEY": "msy_YOUR_API_KEY" } } } } ``` **Other** ```json // Generic stdio MCP config. Consult your client's docs for the exact file. { "mcpServers": { "meshy": { "command": "npx", "args": ["-y", "@meshy-ai/meshy-mcp-server"], "env": { "MESHY_API_KEY": "msy_YOUR_API_KEY" } } } } ``` > **Note:** On Windows, start the server through `cmd /c` in the JSON configs above: set `"command"` to `"cmd"` and `"args"` to `["/c", "npx", "-y", "@meshy-ai/meshy-mcp-server"]`. Don't pass JSON as a command argument in PowerShell, because PowerShell strips its quotes. > **Note:** Prefer a skill? The open-source [`meshy-3d-agent`](https://github.com/meshy-dev/meshy-3d-agent) skill pack has ready-made Meshy workflows for Claude Code, Cursor, and OpenClaw, such as generating a model, polling the task, and downloading the result. It calls the Meshy REST API directly, so you don't need the MCP server. > > ```bash > npx skills add meshy-dev/meshy-3d-agent > ``` --- ## Available tools The MCP server offers the Meshy REST API as the following tools, grouped by capability. ### 3D generation - `meshy_text_to_3d`: create an untextured preview mesh from a text prompt - `meshy_image_to_3d`: create a 3D model from one image - `meshy_multi_image_to_3d`: create a 3D model from multiple images of the same object - `meshy_text_to_3d_refine`: add texture to a preview mesh ### Post-processing - `meshy_remesh`: change the topology or polycount of an existing model, or both - `meshy_retexture`: apply a new texture to an existing model - `meshy_rig`: add a skeleton to a 3D humanoid character - `meshy_animate`: apply an animation to a rigged character - `meshy_convert`: convert a model to another file format - `meshy_resize`: resize a model to real-world dimensions - `meshy_uv_unwrap`: generate a new UV layout for a model - `meshy_text_to_motion`: generate an animation from a text prompt - `meshy_list_animations`: look up the preset animation action IDs, for free ### Creative Lab - `meshy_creative_lab`: turn a photo into a finished Creative Lab product (runs the prototype and build tasks) ### Image generation - `meshy_text_to_image`: create a 2D image from text - `meshy_image_to_image`: create a 2D image from a reference image ### Task management - `meshy_get_task_status`: check task status and download URLs - `meshy_list_tasks`: list recent tasks, optionally filtered by type or status - `meshy_cancel_task`: delete a task. Meshy removes and refunds a `PENDING` task, and deletes a finished task. An `IN_PROGRESS` task can't be canceled, and the API returns `409`. - `meshy_download_model`: download a finished model file and save it locally ### Workspace - `meshy_list_models`: list your recent Text to 3D models. For other task types, use `meshy_list_tasks`. ### 3D printing - `meshy_send_to_slicer`: find the slicers installed on your computer, and return a command that opens the model in one. It runs locally and doesn't call the Meshy API. - `meshy_analyze_printability`: check a model's FDM printability for free, including watertightness, volume, holes, non-manifold edges, and degenerate faces - `meshy_process_multicolor`: convert a textured model into a multi-color 3MF file for printing - `meshy_repair_printability`: repair a model for FDM printing - `meshy_auto_split`: split a model into separately printable parts ### Account - `meshy_check_balance`: check your remaining credits - `meshy_list_usage`: list your team's finished API tasks and the credits each one used, for Studio and Enterprise teams > **Note:** Tool names and behavior can change. For the full list, see the tools in the [MCP server source](https://github.com/meshy-dev/meshy-mcp-server/tree/main/src/tools). --- ## Example prompts To start, try these prompts in your MCP-enabled chat: ``` Generate a 3D fox from the prompt "a cartoon fox sitting", preview it, then texture it with PBR maps. Download the final GLB to ./outputs. ``` ``` Take the image at https://example.com/sculpture.jpg and convert it into a riggable 3D character. Use `should_remesh: true` and 50k target polycount. ``` ``` What's my current Meshy credit balance? ``` ``` List my last 10 successful text-to-3d tasks and download the top 3 as GLB into ./downloads/. ``` --- ## llms.txt and llms-full.txt If your agent doesn't support MCP, or you want to put the Meshy docs into a prompt directly, point it at the plain-text versions of the docs: - [`llms.txt`](/llms.txt): a compact index with integration instructions, such as how to poll async tasks, authentication, rate limits, model choice, and common mistakes. - [`llms-full.txt`](/llms-full.txt): every API page in one file, so an agent can read the docs in one request. - Per-page Markdown: add `.md` to any endpoint URL, for example [`https://docs.meshy.ai/api/text-to-3d.md`](/api/text-to-3d.md). Meshy regenerates all three every time the docs site builds, so they match the HTML docs. --- ## FAQ ### Is the MCP server stateless? It doesn't store your credentials. The server keeps your MESHY_API_KEY in memory and never writes it to disk. By default, it saves the models it downloads, with their metadata, in a meshy_output folder in its working directory. To save a download somewhere else, give the download tool a save_to path. ### Does MCP cost the same as the REST API? Yes. MCP tool calls make the same REST calls and use credits at the same rate. See the Pricing page for every price. ### What are the rate limits? The MCP server's calls count toward the same rate limits as your REST API calls. See the Rate limits page for the limits of each plan. ### What Meshy data can the MCP server access? Only what your MESHY_API_KEY can access through the REST API, with the same permissions. ### How do I report issues? Open an issue in the meshy-mcp-server repository on GitHub: https://github.com/meshy-dev/meshy-mcp-server/issues --- # Changelog Source: https://docs.meshy.ai/api/changelog # Changelog See all of the latest features and updates to the Meshy API and plugins. Prefer a live feed? The latest entries also show up on the [Developer Platform](https://www.meshy.ai/developers) overview page. --- ## November 2026 ### `Nov 6` - Added `gpt-image-2-6-flare` and `gpt-image-2-6-sunburst` to the `ai_model` values of the [Text to Image](/api/text-to-image#create-a-text-to-image-task) and [Image to Image](/api/image-to-image#create-an-image-to-image-task) APIs. These are the OpenAI GPT Image 2.6 tiers: Flare for fast iteration, Sunburst for detailed work and precise edits. They take the same aspect ratios as the other GPT Image models and cost the same as `gpt-image-2` (Text to Image: 9 credits; Image to Image: 12 credits). ### `Nov 5` - New [Relief API](/api/relief): turn one photo into a bas-relief 3D model (GLB and STL) and a 16-bit grayscale depth map, for 3D printing, laser engraving, and CNC carving. Optional parameters set the size, carving mode and depth, base, bend, and mesh resolution, and `should_generate_model: false` returns the depth map only. 20 credits per task. ### `Nov 3` - Added `texture_model` to [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), so you pick the texture model in the same task as the mesh. Image to 3D takes Meshy 7 (`meshy-7`), Meshy N1 (`meshy-n1`), and Meshy 6 Lite (`meshy-6-lite`) with any `ai_model`. Multi-Image to 3D takes the multi-view texture models, Meshy 7 and Meshy N1. Each texture model keeps its own limits; see [Models](/api/models#texture-models). A task costs the mesh-only price of its `ai_model` plus the Retexture price at its texture resolution; see [Pricing](/api/pricing#api-pricing). Requests without `texture_model` work as before. - Added `ai_model: "meshy-n1"` to the [Text to 3D](/api/text-to-3d#create-a-text-to-3d-refine-task) refine. Without `texture_image_url`, Meshy N1 textures from the reference image that a Meshy 7.1 or `latest` preview stores. Other previews need `texture_image_url`. A refine with Meshy N1 costs 10 credits. ### `Nov 2` - Added `ai_model: "meshy-n1"` to the [Retexture](/api/retexture#create-a-retexture-task) API. Meshy N1 makes a 2K base color texture from one to four reference images. With more than one image, the first is the front view, and the order of the others doesn't matter, as with Meshy 7. It takes no text prompt, makes no PBR maps or 4K and 8K textures, and textures 3D models of up to 7,999,999 faces. A task costs 10 credits, the same as a 2K Retexture; see [Pricing](/api/pricing). `latest` still resolves to Meshy 7. ## October 2026 ### `Oct 30` - Some Meshy T1 requests (`model_type: "lowpoly"` or `ai_model: "meshy-t1"`) on [Text to 3D](/api/text-to-3d#create-a-text-to-3d-preview-task) and [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) now run on Smart Topology, and the rest return `400`. `model_type: "smart-topology"` with `ai_model: "meshy-t2.5"` replaces T1. From November 30, 2026, every T1 request returns `400`. [Deprecations](/api/deprecations) lists which requests still run. - The [Auto Split API](/api/auto-split) has a new optional parameter, `keep_texture`. With `keep_texture: true`, every part of a textured model keeps the texture, and the task returns the texture maps in `texture_urls`, plus an `mtl` file with an OBJ. Without it, a split works as before. A split that keeps the texture takes about twice as long and still costs 10 credits. `input_task_id` also accepts Text to 3D refine and Retexture tasks. ### `Oct 26` - New [Deprecations](/api/deprecations) page: the lifecycle of every 3D generation model (active, legacy, deprecated, or retired) with its retirement date and recommended replacement, the history of every API deprecation, and the deprecated parameters still in service. The retirement banner on API pages now links to it. ### `Oct 23` - Deprecated `texture_image_url` on [Rigging](/api/rigging#create-a-rigging-task). Meshy uses the textures embedded in the `model_url` file, or the input task's textures, so leave it out when the model has its own textures. If you send it, the image becomes the rigged model's only texture, and the model loses its PBR maps. ### `Oct 21` - Added the `X-Meshy-Metadata` header for Studio and Enterprise teams to every endpoint that creates a task, except Creative Lab endpoints. Tag a task with your own key-value pairs, such as `user=alex@example.com,team=fab`, and read them back in the `metadata` field of [Usage](/api/usage#the-usage-record-object) records. See [Metadata](/api/metadata). ### `Oct 19` - `export_resolution` now accepts values up to `512`, down from `2048`, on [Keychain](/api/creative-lab-keychain#create-a-keychain-build-task) and [Fridge Magnet](/api/creative-lab-fridge-magnet#create-a-fridge-magnet-build-task) build tasks. `512` is the resolution of the depth map the geometry is built from, so every value above it placed extra vertices between samples that already existed, giving a larger file that describes the same surface. `512` is also the default, so callers that never set `export_resolution` are unaffected. A value above `512` now returns `400` at create time instead of being accepted. `2048` in particular always ran past the generator's deadline and failed after the task had started. If you set `export_resolution` above `512`, drop the parameter or set it to `512`. ### `Oct 15` - Added `ai_model: "meshy-t2.5"` to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Text to 3D](/api/text-to-3d#create-a-text-to-3d-preview-task) APIs: the newest Smart Topology model, with sharper detail for game assets. Use it with `model_type: "smart-topology"`; output is triangle-only, and `target_polycount` accepts 100 to 30,000 (default 15,000). Pricing is the same as `meshy-t2`; see [Pricing](/api/pricing). It is now the default when `model_type: "smart-topology"` is set without `ai_model`; set `ai_model: "meshy-t2"` to keep using Meshy T2. Multi-Image to 3D does not support `meshy-t2.5`. ### `Oct 14` - `model_url` now accepts files up to 400 MB, up from 100 MB, when it is an `http` or `https` URL, on [Retexture](/api/retexture#create-a-retexture-task), [Remesh](/api/remesh#create-a-remesh-task), [Rigging](/api/rigging#create-a-rigging-task), [Convert](/api/convert#create-a-convert-task), [Resize](/api/resize#create-a-resize-task), [UV Unwrap](/api/uv-unwrap#create-an-uv-unwrap-task), [Multi-Color Print](/api/multi-color-print#create-a-multi-color-3d-print-task), [Analyze Printability](/api/analyze-printability#create-an-analyze-printability-task), and [Repair Printability](/api/repair-printability#create-a-repair-printability-task). A `data:` URI stays at 100 MB. A GLB, glTF, FBX, or OBJ file over 100 MB can have at most 10,000,000 faces (8,000,000 for Multi-Color Print), counted as triangles; a file with more returns `400`. Over 100 MB, an FBX file must be binary FBX 7.1 or newer, and a GLB or glTF file must not use Draco compression. The file is downloaded before the create request returns, so allow up to 120 seconds for a large one (see [Task Lifecycle](/api/task-lifecycle#how-long-to-wait)). Files of 100 MB or less behave as before, and pricing is unchanged. - [Analyze Printability](/api/analyze-printability#create-an-analyze-printability-task) now answers an `input_task_id` that belongs to another account with `404` and the same body as an id that doesn't exist, instead of `403`. A task of yours, or of a teammate in a workspace you belong to, works as before. ### `Oct 12` - USDZ files now use metres, so models open at their real size in AR Quick Look, Reality Composer, Blender, and other USD viewers. The `usdz` file in `model_urls` of [Text to 3D](/api/text-to-3d), [Image to 3D](/api/image-to-3d), [Multi-Image to 3D](/api/multi-image-to-3d), [Retexture](/api/retexture), [Remesh](/api/remesh), [Convert](/api/convert), [Resize](/api/resize), and [Auto Split](/api/auto-split) tasks now declares `metersPerUnit = 1`. Until now it declared feet (`metersPerUnit = 0.3048`) while its coordinates were in metres, so the model showed at 30.48% of its size. If you scale USDZ files by 3.28 to compensate, remove that scaling for tasks created from this date on. Files of earlier tasks keep their current unit, and [Rigging](/api/rigging) and [Animation](/api/animation) USDZ files are not affected. ### `Oct 10` - `meshy-5` has been retired. Requests that send `ai_model: "meshy-5"` to [Text to 3D](/api/text-to-3d#create-a-text-to-3d-preview-task), [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), or [Retexture](/api/retexture#create-a-retexture-task) now return `400` with the message `ai_model meshy-5 has been retired; use meshy-6-lite`. Switch to `meshy-6-lite`, which takes the same parameters at the same credit cost. Models you already generated with `meshy-5` stay available, and refining a `meshy-5` preview without setting `ai_model` still works. - `.webp` is now documented as a supported image input format, alongside `.jpg`, `.jpeg`, and `.png`, on [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), [Image to Image](/api/image-to-image#create-an-image-to-image-task), [Retexture](/api/retexture#create-a-retexture-task) (`image_style_url`), and [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task) (`texture_image_url`). It works for both public URLs and data URIs (`data:image/webp;base64,...`). Existing integrations are unaffected, and pricing is unchanged. - [Get Balance](/api/balance#get-balance) now also returns `monthly_credits`, `permanent_credits`, and `monthly_resets_at`, so you can see how much of your balance expires at the next refresh. `balance` itself is unchanged. ### `Oct 6` - [Analyze Printability](/api/analyze-printability#create-an-analyze-printability-task) and [Repair Printability](/api/repair-printability#create-a-repair-printability-task) can now check wall thickness at the size you plan to print. Send `printer_type`, a print size, or both. Analyze reports thin walls in `printability.thin_walls`, and repair thickens them when needed, and can reuse the printer and size of an analyze task passed as `input_task_id`. Integrations that don't use these fields behave as before, and pricing is unchanged. ## September 2026 ### `Sep 29` - The legacy `/v2/text-to-3d` path (without the `/openapi` prefix) is deprecated. It keeps working unchanged for now, but will be removed in a future release. Switch to [`/openapi/v2/text-to-3d`](/api/text-to-3d), which takes the same request and returns the same response. Responses on the legacy path now carry a `Deprecation` header and a `Link` header pointing to the new path. ### `Sep 28` - API responses now include [rate limit headers](/api/rate-limits#rate-limit-headers), including `Retry-After` to tell you how long to wait before retrying or polling again. - [Multi-Color Print](/api/multi-color-print) accepts a new `printer_brand` parameter that writes a matching slicer preset into the 3MF, so the file opens ready to print on Anycubic, Creality, Elegoo, Flashforge, Prusa, Qidi, Snapmaker, and AnkerMake printers as well as Bambu Lab (the default). The page now also documents `max_depth`. ### `Sep 18` - Added `meshy-7.1` as an `ai_model` value for [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), and [Text to 3D](/api/text-to-3d#create-a-text-to-3d-preview-task): same parameters and credit cost as `meshy-7`, higher geometry detail. `latest` now resolves to `meshy-7.1`; `meshy-7` is deprecated but keeps working unchanged. - Added `geometry_resolution` (`standard` / `2k` / `4k`) to the same APIs, replacing the now-deprecated `ultra_mode` (`ultra_mode: true` still works and equals `"2k"`). `4k` requires Meshy 7.1 (`meshy-7.1` or `latest`), is not available on Multi-Image to 3D, and costs the same 5 extra credits as `2k`. ### `Sep 16` - The [Auto Split API](/api/auto-split) now accepts a textured `input_task_id`. It previously rejected one with `400`, which meant generating the same mesh a second time with `should_texture: false` to split it. A split cuts geometry and rebuilds each part's surfaces, so the input's texture is not carried over and the result is an untextured model with one flat color per part. That was already true of every split and is unchanged. - `meshy-5` will be retired on **October 10, 2026**. It is no longer documented as an `ai_model` value for [Text to 3D](/api/text-to-3d#create-a-text-to-3d-preview-task), [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), or [Retexture](/api/retexture#create-a-retexture-task), and after October 10 requests that send `ai_model: "meshy-5"` will return an error. - The shared **test-mode API key** has been retired; requests that still send it now return `401 Unauthorized`. If you copied it into code or CI, replace it with your own key from the [API Keys page](https://www.meshy.ai/developers/keys). That key always returned the same sample model regardless of input, so it never showed what a request would actually generate. To see what the API returns before building against it, use the [Playground](/api/developer-platform#playground) in the Developer Platform, which runs a real task in your browser. On plans without API access it runs Image to 3D without an API key and uses your account's credits like any other task. ### `Sep 15` - Added `gpt-image-2-5-flare` and `gpt-image-2-5-sunburst` to the documented `ai_model` values for the [Text to Image](/api/text-to-image#create-a-text-to-image-task) and [Image to Image](/api/image-to-image#create-an-image-to-image-task) APIs. These are OpenAI GPT Image 2.5 tiers, priced the same as `gpt-image-2` (Text to Image: 9 credits; Image to Image: 12 credits). - The GPT Image models (`gpt-image-2`, `gpt-image-2-5-flare`, `gpt-image-2-5-sunburst`) now also accept the `4:3` and `3:4` aspect ratios on the [Text to Image](/api/text-to-image#create-a-text-to-image-task) and [Image to Image](/api/image-to-image#create-an-image-to-image-task) APIs, in addition to `1:1`, `16:9`, `9:16`, `3:2`, and `2:3`. ### `Sep 14` - The [Image to Image API](/api/image-to-image#create-an-image-to-image-task) now accepts `input_task_id`, so you can chain directly from a completed Text to Image or Image to Image task instead of copying its output URLs into `reference_image_urls`. ### `Sep 11` - Behavior change: `DELETE` on a task that is already `IN_PROGRESS` is now rejected with `409 Conflict`, and the task is left running. It previously returned `200 OK`, stopped the worker, and discarded the result, but kept the credits because only `PENDING` tasks are refundable. The call cost you both the model and the credits with nothing in the response to say so. If your integration deletes tasks in order to cancel them, note that a task the worker has already started cannot be cancelled. Wait for `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. `PENDING` tasks are still deleted and refunded exactly as before, and terminal tasks are still deleted. Applies to every task family under `/openapi`. See [Errors](/api/errors). - Added `meshy-6-lite` to the documented `ai_model` values for the [Text to 3D](/api/text-to-3d#create-a-text-to-3d-preview-task), [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), and [Retexture](/api/retexture#create-a-retexture-task) APIs. It is the successor to `meshy-5`: same parameters, same credit cost (5 for the mesh, 15 with texture, 10 for a retexture). - `meshy-5` is now deprecated across every API that accepts it. It keeps working and nothing about your request or your bill changes, but it will stop accepting new traffic in a future release. If your integration sends `ai_model: "meshy-5"`, migrate to `meshy-6-lite`. ### `Sep 9` - New [Auto Split API](/api/auto-split): Split an untextured Meshy 6 or Meshy 7 model into separately printable parts. It splits automatically, by the parts you name (`by_parts`), or by color region (`by_color`), with optional mortise-and-tenon connectors and thin-wall reinforcement. Exports every part as its own object in `glb`, `obj`, `fbx`, `usdz`, `blend`, or `3mf`, either assembled or laid out on the build plate (`layout`). 10 credits per task. ### `Sep 7` - Added the `name_text` parameter to the [Creative Lab Keychain API](/api/creative-lab-keychain#create-a-keychain-prototype-task) prototype stage: engrave a name of up to 10 characters on the keychain, the same personalization the web app offers. The build stage inherits the engraving automatically, and the prototype task object now returns `name_text` so you can confirm the exact text before building. `name` remains a display-only task label and is not engraved. ### `Sep 5` - Added the [Creative Lab Fidget Pixel API](/api/creative-lab-fidget-pixel): turn a photo into a multi-color 3D-printable pixel-art fidget board in two stages. `POST /prototype` (6 credits) pixelizes the photo into a pixel-art image. Pass `type` as `person` or `other` to pick the pixelization style. `POST /build` (30 credits) samples it onto a `16` or `32` grid and turns every pixel into an interlocking `square` or `hex` piece, delivered as a single color-tagged 3MF for multi-filament printing. Piece geometry is tunable with `piece_size_mm`, `color_count`, and `piece_height_mm`. ### `Sep 4` - Added [`GET /openapi/v1/animations/library`](/api/animation#list-animations) to the [Animation Library](/api/animation-library): fetch every preset action the [Animation API](/api/animation#create-an-animation-task) accepts (`action_id`, name, category, and an animated GIF preview) with search and category filters, so you can build your own action picker instead of reading the reference table. Free; consumes no credits. - Added the [Creative Lab Collapsible Fidget API](/api/creative-lab-fidget-collapsible): turn a photo into a print-in-place collapsible fidget toy, where the subject's silhouette becomes nested concentric rings that collapse flat and stretch out again, printed in one piece with no assembly. A single `POST` carries the image through to the finished model. There is no prototype/build stage pair and no geometry parameters to tune. Each task costs 6 credits and returns a printable STL, plus a GLB for previewing when Meshy can render one. ### `Sep 3` - The [Creative Lab Lamp API](/api/creative-lab-lamp) prototype stage now returns a 3D model. `POST /prototype` turns the concept image into a hollow lampshade GLB, and the prototype task object gains `model_urls.glb` and `thumbnail_url` alongside `image_urls`. The build stage runs only the lamp processor on that model and now produces an open-bottom lampshade with a base plate for the light-source fixture. Pricing moves with the work. Prototype is 30 credits and build 6 credits (previously 6 and 30). The prototype `text` parameter was removed, and `image_url` is required. ### `Sep 2` - The [Animation API](/api/animation#create-an-animation-task) now accepts `action_ids`, so you can apply up to 10 preset actions to a rigged character in one request and receive a **single file containing one animation clip per action**, ready to drive from a state machine in a game engine. Clips keep the order you list them in and carry the animation's library name. Costs 3 credits per action, and `post_process` applies to the merged file. See the [Animation Library Reference](/api/animation-library) for available ids and the [pricing table](/api/pricing). ### `Sep 1` - Added the `ultra_mode` parameter to the [Multi-Image to 3D API](/api/multi-image-to-3d#create-a-multi-image-to-3d-task): enables Ultra generation on `ai_model` `meshy-7` (or `latest`) for higher-fidelity geometry with finer surface detail, for 5 extra credits. It is the same Ultra pass the [Image to 3D API](/api/image-to-3d#create-an-image-to-3d-task) offers, now available with multi-view inputs. - Removed `meshy-t1` from the documented `ai_model` values for the [Image to 3D API](/api/image-to-3d#create-an-image-to-3d-task)'s Smart Topology `model_type`. Smart Topology now only documents `meshy-t2`; new integrations should use it instead. Meshy T1 is planned for deprecation. If your integration currently sends `ai_model: "meshy-t1"`, migrate to `meshy-t2`. ## August 2026 ### `Aug 28` - Added the [Usage API](/api/usage#list-usage-records) for Studio and Enterprise teams: programmatically export historic API task usage (endpoint, status, timestamps, the API key that ran each task, and `consumed_credits`) with standard pagination and time-window, endpoint, and status filters, for cost tracking and finance systems. ### `Aug 26` - The [Animation API](/api/animation#create-an-animation-task) now accepts `motion_task_id`, so you can apply a motion clip generated with the [Text to Motion API](/api/text-to-motion) onto your rigged biped character, as an alternative to a preset `action_id`. Same 3 credits per task. ### `Aug 24` - Expanded `aspect_ratio` support for `gpt-image-2` on the [Text to Image](/api/text-to-image#create-a-text-to-image-task) and [Image to Image](/api/image-to-image#create-an-image-to-image-task) APIs to add `16:9` and `9:16`. `gpt-image-2` now accepts `1:1`, `16:9`, `9:16`, `3:2`, and `2:3`; `4:3` and `3:4` remain unsupported for this model. ### `Aug 21` - Added the [Text to Motion API](/api/text-to-motion): generate a character motion clip from a natural-language description, no character model required. Choose `prime` mode (10 credits, FBX output) for the highest quality or `swift` mode (3 credits, BVH output) for fast, economical generation, with clip durations of 2 to 10 seconds. ### `Aug 20` - Added the `style` parameter to the [Multi-Color Print API](/api/multi-color-print#create-a-multi-color-3d-print-task): choose `realistic` (default) for texture-accurate colors, or `cartoon` for flat, uniform color regions and a smaller 3MF. - Added the `remove_background` parameter to every Creative Lab prototype endpoint: [Figure](/api/creative-lab-figure#create-a-figure-prototype-task), [Vinyl Figure](/api/creative-lab-vinyl-figure#create-a-vinyl-figure-prototype-task), [Brick Figure](/api/creative-lab-brick-figure#create-a-brick-figure-prototype-task), [Keycap](/api/creative-lab-keycap#create-a-keycap-prototype-task), [Keychain](/api/creative-lab-keychain#create-a-keychain-prototype-task), [Fridge Magnet](/api/creative-lab-fridge-magnet#create-a-fridge-magnet-prototype-task), and [Lamp](/api/creative-lab-lamp#create-a-lamp-prototype-task). Set `remove_background: true` to receive the prototype image as a transparent RGBA PNG with the background removed. ### `Aug 18` - Added the `texture_image_urls` parameter to the [Multi-Image to 3D API](/api/multi-image-to-3d#create-a-multi-image-to-3d-task): provide 1 to 4 images of the same object to guide texturing, instead of the single `texture_image_url`. Requires `ai_model` `meshy-7` or `latest`, and is independent of `image_urls`. The two lists can contain different images and different numbers of images. ### `Aug 17` - Added the `remove_background` parameter to the [Text to Image API](/api/text-to-image#create-a-text-to-image-task) and [Image to Image API](/api/image-to-image#create-an-image-to-image-task). Set `remove_background: true` to receive the generated image as a transparent RGBA PNG with the background removed. ### `Aug 13` - Added `ai_model: "meshy-7"` to the [Text to 3D API](/api/text-to-3d#create-a-text-to-3d-preview-task): our newest 3D generation model, with higher-fidelity geometry than Meshy 6. It also introduces the `ultra_mode` parameter on the preview task, which enables Ultra generation for even finer surface detail for 5 extra credits. To texture with Meshy 7, pass `ai_model: "meshy-7"` on the refine task or omit `ai_model` entirely. - Added the **Smart Topology** `model_type` to the [Text to 3D API](/api/text-to-3d#create-a-text-to-3d-preview-task). Set `model_type: "smart-topology"` to generate with `meshy-t2`: cleaner topology, natively separated parts, triangle output, and a face count you can set with `target_polycount` (100 to 15,000, default 4,000). A Smart Topology preview costs 5 credits instead of 20; see [Pricing](/api/pricing). The existing `model_type: "lowpoly"` is now deprecated but continues to serve traffic for backward compatibility. ### `Aug 12` - Added `ai_model: "meshy-7"` to the [Image to 3D API](/api/image-to-3d#create-an-image-to-3d-task): our newest 3D generation model, with higher-fidelity geometry than Meshy 6. It also introduces the `ultra_mode` parameter, which enables Ultra generation for even finer surface detail. - Added `ai_model: "meshy-7"` to the [Multi-Image to 3D API](/api/multi-image-to-3d#create-a-multi-image-to-3d-task): Meshy's multi-view generation model, which conditions on all of your input views together and drives texturing from them. - Added `ai_model: "meshy-7"` to the [Retexture API](/api/retexture#create-a-retexture-task): our newest texturing model, with sharper surface detail and cleaner PBR materials than Meshy 6. It also introduces the `multiview_image_urls` parameter. Provide 1 to 4 ordered views of the same object to drive multi-view texturing. ### `Aug 4` - Expanded `model_url` input support to `.glb`, `.gltf`, `.obj`, `.fbx`, `.stl` for the [Analyze Printability](/api/analyze-printability) and [Repair Printability](/api/repair-printability) endpoints (previously `.glb`, `.stl`, `.obj`). Repair returns the repaired asset in its input format. ## July 2026 ### `Jul 27` - New **[Creative Lab Brick Figure API](/api/creative-lab-brick-figure)**: turn a photo into a brick-style collectible 3D minifigure. It uses the same two-stage workflow as the [Figure API](/api/creative-lab-figure). `prototype` (6 credits) generates a styled concept image, and `build` (30 credits) turns it into a textured 3D model with GLB and OBJ + MTL outputs. See [Pricing](/api/pricing) for the full breakdown. ### `Jul 22` - New **[Creative Lab Keycap API](/api/creative-lab-keycap)**: turn a photo into a full-color custom mechanical keyboard keycap. It uses a two-stage workflow. `prototype` (12 credits) generates a finished-keycap design render, then `build` (50 credits) turns the design you pick (with `candidate_id`) into a textured 3D keycap model with GLB and OBJ bundle outputs, exported at real-world millimeter scale. Currently supports the standard Cherry MX 1u base (`cherry-mx-1x1-r1`); more standard sizes are planned. See [Pricing](/api/pricing) for the full breakdown. ### `Jul 21` - We now support **8K base color textures** through a new `texture_resolution` parameter (`2k` / `4k` / `8k`) on the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task), and [Retexture](/api/retexture#create-a-retexture-task) endpoints. At `8k`, PBR maps are generated at 4K and no emission map is produced. 8K texture generation costs 15 credits (`2k`/`4k` remain 10). See [Pricing](/api/pricing). - The `hd_texture` boolean is deprecated in favor of `texture_resolution`. It is still honored and equivalent to `texture_resolution: "4k"` for backward compatibility. ### `Jul 20` - New **[Creative Lab Vinyl Figure API](/api/creative-lab-vinyl-figure)**: turn a photo into a big-head vinyl collectible 3D figure. It uses the same two-stage workflow as the [Figure API](/api/creative-lab-figure). `prototype` (6 credits) generates a styled concept image, and `build` (30 credits) turns it into a textured 3D model with GLB and OBJ + MTL outputs. See [Pricing](/api/pricing) for the full breakdown. ### `Jul 13` - Added a new **Smart Topology** `model_type` to the [Image to 3D](/api/image-to-3d) API, offering two models through `ai_model`: `meshy-t1` (the current low-poly model) and `meshy-t2` (a new model with cleaner topology, natively separated parts, triangle output, and a face count you can set with `target_polycount`). `meshy-t2` is the default under `smart-topology`. The existing `model_type: lowpoly` is now deprecated but continues to serve traffic for backward compatibility. ### `Jul 7` - Added the `aspect_ratio` parameter to the [Image to Image](/api/image-to-image#create-an-image-to-image-task) API, so you can control the output image ratio when editing. Allowed values are `1:1`, `16:9`, `9:16`, `4:3`, `3:4` for the nano-banana models and `1:1`, `3:2`, `2:3` for `gpt-image-2`. Optional; defaults to `1:1`, and cannot be combined with `generate_multi_view`. ## June 2026 ### `Jun 17` - New **[API Playground](/api/playground)** docs page: an interactive console for trying endpoints without writing code, then copying the equivalent cURL, Python, or JavaScript. Available on the Pro, Premium, Ultra, Studio, and Enterprise plans. ### `Jun 15` - New **[UV Unwrap API](/api/uv-unwrap)**: generate a high-quality UV layout for an existing 3D model (the prerequisite step before texturing, or any time you need a clean, non-overlapping UV layout for downstream tools). Takes either an `input_task_id` (a completed Image to 3D, Text to 3D, or Remesh task) or a `model_url` (`.glb` only) and returns a "UV white model" with brand-new UV coordinates. 5 credits per call. Supports meshes of up to 40,000 faces (run [Remesh](/api/remesh) first if larger); quad and n-gon meshes are triangulated during UV generation. ### `Jun 12` - Updated **Creative Lab API** Build pricing to **30 credits** per call for [Keychain](/api/creative-lab-keychain), [Fridge Magnet](/api/creative-lab-fridge-magnet), and [Figure](/api/creative-lab-figure) (previously 20). [Lamp](/api/creative-lab-lamp) is unchanged at 30 credits. Prototype pricing is unchanged at 6 credits per image. See [Pricing](/api/pricing) for the full breakdown. ### `Jun 5` - Added the optional `alpha_thumbnail` parameter to the [Image to 3D](/api/image-to-3d), [Multi-Image to 3D](/api/multi-image-to-3d), [Text to 3D](/api/text-to-3d), [Retexture](/api/retexture), [Remesh](/api/remesh), and [Repair Printability](/api/repair-printability) APIs. When set to `true`, the task additionally renders a transparent-background (RGBA) version of the preview and returns it under the new `alpha_thumbnail_url` response field. The existing `thumbnail_url` is unchanged. Defaults to `false`. ### `Jun 1` - New **Creative Lab APIs**: a family of product-scoped endpoints that turn a source photo (or text prompt) into a 3D-printable consumer product. Four products at launch: [Keychain](/api/creative-lab-keychain), [Fridge Magnet](/api/creative-lab-fridge-magnet), [Figure](/api/creative-lab-figure), and [Lamp](/api/creative-lab-lamp). Each follows a two-stage `prototype` → `build` workflow chained through `input_task_id`, served under product-scoped URLs (`/openapi/creative-lab//v1/...`) with per-product versioning so products can evolve on independent version lines. Prototype: 6 credits per call. Build: 30 credits per call. --- ## May 2026 ### `May 26` - Added `multi_view_thumbnails` parameter to the [Multi-Image to 3D](/api/multi-image-to-3d) API. When set to `true`, the task additionally renders four cardinal-view thumbnails (front, right, back, left) and returns them under the new `thumbnail_urls` response field. The existing `thumbnail_url` field is unchanged. Adds approximately 3 seconds to task latency. ### `May 22` - The convert and resize functionality from the [Remesh API](/api/remesh) is now available as standalone [Convert API](/api/convert) and [Resize API](/api/resize) endpoints. The deprecated parameters on Remesh will continue to work for backward compatibility. ### `May 13` - Added `multi_view_thumbnails` parameter to the [Image to 3D](/api/image-to-3d) API. When set to `true`, the task additionally renders four cardinal-view thumbnails (front, right, back, left) and returns them under the new `thumbnail_urls` response field. The existing `thumbnail_url` field is unchanged. Adds approximately 3 seconds to task latency. ### `May 12` - Added `resize_longest_side` parameter to the [Remesh](/api/remesh) API. Resizes the model so the longest bounding-box dimension equals the specified value in meters. Mutually exclusive with `resize_height` and `auto_size`. ### `May 11` - Deprecated `symmetry_mode` parameter on [Text to 3D](/api/text-to-3d), [Image to 3D](/api/image-to-3d), and [Multi-Image to 3D](/api/multi-image-to-3d) endpoints. This parameter no longer affects output. ### `May 7` - New [Analyze Printability API](/api/analyze-printability): Analyze a succeeded Meshy task, or any 3D model URL, for FDM 3D printing readiness. Async create + stream pattern: POST returns a task_id, then GET / SSE stream return watertightness, volume, hole, and non-manifold-edge metrics when SUCCEEDED. Free, no credits consumed. - New [Repair Printability API](/api/repair-printability): Repair a 3D model for FDM printability, fixing non-manifold edges, degenerate faces, holes, and other topology issues. Accepts an existing Meshy `input_task_id` or a `model_url` (`.glb`, `.stl`, `.obj`). Output format matches the input. 10 credits per task. --- ## April 2026 ### `Apr 27` - Added `consumed_credits` field to all task responses across every API endpoint. Shows the number of credits consumed by each task. The field is present for tasks in `PENDING`, `IN_PROGRESS`, and `SUCCEEDED` statuses. Returns `0` for `FAILED` tasks (credits are automatically refunded on failure). See [Pricing](/api/pricing) for credit costs per endpoint. ### `Apr 24` - Added `model_url` parameter to the [Multi-Color Print](/api/multi-color-print#create-a-multi-color-3d-print-task) endpoint. Submit a textured 3D model directly (with a URL or Data URI) instead of an `input_task_id` from a prior Meshy task. Supported formats: `.glb`, `.fbx`. When both `model_url` and `input_task_id` are provided, `input_task_id` takes priority. ### `Apr 21` - Added `input_task_id` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) endpoints. Reference a completed Text to Image or Image to Image task's output directly instead of providing `image_url` / `image_urls`. When both are supplied, `input_task_id` takes priority. ### `Apr 20` - Added `hd_texture` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task), and [Retexture](/api/retexture#create-a-retexture-task) endpoints. When enabled, the base color texture is generated at 4K (4096×4096) resolution for higher detail. Only supported for `meshy-6` and `latest`. Defaults to `false`. - The PBR bundle returned when `enable_pbr` is `true` now includes an `emission` map under `texture_urls` for `meshy-6` and `latest` tasks across [Image to 3D](/api/image-to-3d), [Multi-Image to 3D](/api/multi-image-to-3d), [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task), and [Retexture](/api/retexture). No request change is required. ### `Apr 14` - Added `decimation_mode` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task), and [Remesh](/api/remesh#create-a-remesh-task) endpoints. Sets the adaptive decimation polycount level: `1` (ultra), `2` (high), `3` (medium), or `4` (low). ### `Apr 12` - Restructured API documentation: added parameter grouping with dependent fields, inline defaults, required/deprecated badges, expandable sub-navigation, and split Multi-Image, Rigging, and Animation into separate pages. --- ## March 2026 ### `Apr 2` - Added `3mf` format support to `target_formats` parameter across all endpoints ([Image to 3D](/api/image-to-3d), [Text to 3D](/api/text-to-3d), [Remesh](/api/remesh), [Retexture](/api/retexture)). Note: 3MF is opt-in only and must be explicitly requested. - New [Multi-Color Print API](/api/multi-color-print): Convert 3D models to multi-color 3MF format for 3D printing. Supports 1 to 16 color palettes with configurable precision. 10 credits per task. ### `Mar 20` - Retired the Meshy-4 AI model. All API requests using `meshy-4` are no longer supported. Migrate to `meshy-6` or `latest`. - Added `auto_size` and `origin_at` parameters to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), [Text to 3D](/api/text-to-3d), and [Remesh](/api/remesh#create-a-remesh-task) endpoints. When `auto_size` is enabled, the service uses AI vision to estimate real-world height and resize the model automatically. `origin_at` sets the origin position (`bottom` or `center`). In the Remesh API, `auto_size` is mutually exclusive with `resize_height`. ### `Mar 17` - Added optional `target_formats` parameter to [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), [Text to 3D](/api/text-to-3d), and [Retexture](/api/retexture#create-a-retexture-task) endpoints. Specify which 3D formats to generate (for example, `["glb", "fbx"]`) to reduce task completion time. --- ## February 2026 ### `Feb 28` - Added `remove_lighting` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task), and [Retexture](/api/retexture#create-a-retexture-task) APIs. Removes highlights and shadows from the base color texture for cleaner results under custom lighting. Only supported for `meshy-6` and `latest`. Defaults to `true`. - The [Retexture](/api/retexture#create-a-retexture-task) and [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task) APIs now support `meshy-6` as an `ai_model` value for full Meshy 6 texturing. ### `Feb 25` - Added `image_enhancement` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) APIs for users who want to opt out of input image optimization and preserve the exact appearance of their input. Only supported for `meshy-6` and `latest`. Defaults to `true`. ### `Feb 20` - Added `model_type` parameter to the [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task) API for generating low-poly meshes optimized for cleaner polygons. --- ## January 2026 ### `Jan 27` - Added detailed [Failure Modes](/api/errors#task-errors) documentation for all API endpoints, including common HTTP error codes (400, 401, 402, 404, 422, 429) and task failure reasons. This helps developers better understand and handle API errors. ### `Jan 26` - The [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) API now supports Meshy-6 for full mesh generation. The `ai_model` parameter now accepts `meshy-6` and `latest` resolves to Meshy 6. ### `Jan 22` - Deprecated `art_style` for the [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task) API (Meshy-6). The parameter was designed for legacy models (Meshy-4 / Meshy-5) and will be removed in a future release. - Deprecated `enable_pbr` for the [Text to 3D](/api/text-to-3d) and [Image to 3D](/api/image-to-3d) APIs when `ai_model` is `meshy-4`. This parameter will be removed in a future release. - Updated the default value of `should_remesh` parameter for Meshy-6 in the [Text to 3D](/api/text-to-3d) and [Image to 3D](/api/image-to-3d) APIs. The parameter now defaults to `false` for `meshy-6`, and `true` for other models if not specified. ### `Jan 19` - The `latest` option for `ai_model` in the [Text to 3D (Preview)](/api/text-to-3d#create-a-text-to-3d-preview-task) and [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) APIs now resolves to Meshy 6. ### `Jan 12` - Added a new `model_type` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) API for generating low-poly meshes optimized for cleaner polygons. --- ## December 2025 ### `Dec 31` - Launched the [API Playground](https://www.meshy.ai/api-playground), a dedicated space for developers to explore API parameters and test requests directly on the Meshy website. - Introduced the [Text to Image API](/api/text-to-image) and [Image to Image API](/api/image-to-image), enabling AI-powered image generation from text prompts and image editing from reference images. Both APIs support the `nano-banana` and `nano-banana-pro` models, with optional multi-view generation. ### `Dec 22` - The `video_url` field in the [Text to 3D](/api/text-to-3d) API response is now deprecated and will be removed in a future release. ### `Dec 04` - Added a new `pose_mode` parameter to the [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task), [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), and [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) APIs. This parameter accepts `a-pose`, `t-pose`, or an empty string (default). The `is_a_t_pose` parameter is now deprecated in favor of `pose_mode`. --- ## November 2025 ### `Nov 24` - The [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) APIs add an optional `save_pre_remeshed_model` parameter and expose `model_urls.pre_remeshed_glb` when a pre-remesh backup is requested. ### `Nov 06` - The [Text to 3D Refine API](/api/text-to-3d#create-a-text-to-3d-refine-task) now supports `ai_model = latest`, which resolves to Meshy 6 Preview. - The [Image to 3D API](/api/image-to-3d#create-an-image-to-3d-task) now defaults to Meshy-6-preview texturing when `ai_model = latest` and `should_texture = true`. - The [Multi-Image to 3D API](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) now supports `ai_model = latest`, running Meshy-6-preview for texturing by default while mesh generation remains Meshy-5. - The [Retexture API](/api/retexture) adds a `latest` option for `ai_model` (Meshy-6-preview) and now defaults to it when omitted. ### `Nov 04` - The [Remesh API](/api/remesh#create-a-remesh-task) now preserves textures for uploaded models. - The [Retexture API](/api/retexture) now preserves textures for uploaded models when the `enable_original_uv` option is enabled. --- ## October 2025 ### `Oct 28` - Added the `x-api-version` response header to indicate the current API server version. ### `Oct 20` - Added an optional `convert_format_only` boolean parameter to the [Remesh API](/api/remesh#create-a-remesh-task) to support converting the format of the input model file only. - Added `rigged_character_glb_url` to the response of [The Rigging Task Object](/api/rigging#the-rigging-task-object). ### `Oct 01` - Remove `text-to-voxel` APIs --- ## September 2025 ### `Sep 23` - Added a `latest` option for `ai_model` in the [Text to 3D](/api/text-to-3d#create-a-text-to-3d-preview-task) API to use Meshy 6 Preview. - Temporary 50% discount in place for Meshy-6-preview generation tasks to 10 credits that will last until Sep 30, 2025. After the discount period, the cost of Meshy-6-preview tasks will return to the normal 20 credits. ### `Sep 18` - Updated [API pricing](/api/pricing) for [Text to 3D](/api/text-to-3d) and [Image to 3D](/api/image-to-3d) to reflect different costs for Meshy 6 and other models. ### `Sep 16` - Added a `latest` option for `ai_model` in the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) API to use Meshy 6 Preview. ### `Sep 4` - Expanded `model_url` input support to `.glb`, `.gltf`, `.obj`, `.fbx`, `.stl` for [Remesh](/api/remesh#create-a-remesh-task) and [Retexture](/api/retexture). --- ## August 2025 ### `Aug 18` - Added an optional `is_a_t_pose` parameter to the [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task), [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), and [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) APIs to generate models in an A/T pose. ### `Aug 13` - Meshy 5 is now stable for [Text to 3D](/api/text-to-3d) and [Image to 3D](/api/image-to-3d) (`ai_model`: `meshy-5`), delivering improved quality and consistency. --- ## July 2025 ### `Jul 31` - Support PBR texture maps in API through `enable_pbr` parameter for latest `meshy-5` model for [Text to 3D](/api/text-to-3d), [Image to 3D](/api/image-to-3d), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), and [Retexture](/api/retexture) endpoints. --- ## June 2025 ### `Jun 25 ` - Added the [Retexture API](/api/retexture), which lets users retexture 3D models based on Meshy's latest foundation AI models. ### `Jun 19` - Added deletion APIs for [Text to 3D](/api/text-to-3d), [Image to 3D](/api/image-to-3d), [Remesh](/api/remesh), [Rigging](/api/rigging), and [Animation](/api/animation). - Added the `ai_model` parameter to the [Text to 3D Refine API](/api/text-to-3d#create-a-text-to-3d-refine-task). ### `Jun 17` - Added documentation for [Webhooks](/api/webhooks). ### `Jun 10` - The [Remesh API](/api/remesh#create-a-remesh-task) now supports base64-encoded GLB format models in the `model_url` parameter through a Data URI. --- ## May 2025 ### `May 20` - Added an optional `moderation` parameter to the [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task), [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task), [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task), and [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) APIs. When enabled, input content is automatically screened for potentially harmful content before generation. ### `May 15` - Introduced the Auto-rigging & Animation API, enabling users to automatically rig and animate 3D models. [Learn more about Rigging](/api/rigging) and [Animation](/api/animation). --- ## April 2025 ### `Apr 29` - Introduced the [Multi-Image to 3D API](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), allowing generation of 3D models from 1 to 4 input images using the `meshy-5` AI model. - Added the `meshy-5` AI model option to the [Text to 3D](/api/text-to-3d) and [Image to 3D](/api/image-to-3d) APIs. The `latest` tag now also resolves to `meshy-5`. ### `Apr 17` - Added the `texture_image_url` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task) APIs, letting users guide the texture generation process with an image. --- ## March 2025 ### `Mar 28` - Added the `latest` parameter to the [Text to 3D](/api/text-to-3d#create-a-text-to-3d-preview-task) and [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) APIs, enabling access to our upcoming advanced AI models for improved generation quality. ### `Mar 14` - The [Text to Texture API](/api/text-to-texture#create-a-text-to-texture-task) now supports base64-encoded models in the `model_url` parameter through a Data URI, similar to the `image_url` in the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) API. ### `Mar 06` - Updated pricing for API generation tasks: - Text to 3D (Preview): Increased from 2 to 5 credits per call - Text to 3D (Refine): Increased from 5 to 10 credits per call - Image to 3D: Now 5 credits without texture, 15 credits with texture - Text to Texture: Increased from 5 to 10 credits per call - Text to Voxel: Remains at 5 credits per call --- ## February 2025 ### `Feb 18` - Added a test mode API key that lets developers test API integration without consuming credits. All valid requests using this key will return the same sample task results. ### `Feb 13` - **Breaking Changes**: - Free tier task creation will end on `March 20, 2025`. After that, all API task requests will require a paid subscription. To keep your access smooth, we recommend upgrading before the deadline. - Use coupon code `APIACCESS` to enjoy a `40%` discount. Thank you for being with us! - Added Server-Sent Events (SSE) streaming endpoints for real-time task updates: - [Text to 3D Stream API](/api/text-to-3d#stream-a-text-to-3d-task) - [Image to 3D Stream API](/api/image-to-3d#stream-an-image-to-3d-task) - [Remesh Stream API](/api/remesh#stream-a-remesh-task) - [Text to Texture Stream API](/api/text-to-texture#stream-a-text-to-texture-task) ### `Feb 6` - Added the `texture_prompt` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task) APIs, letting users guide the texture generation process with a text prompt. --- ## January 2025 ### `Jan 23` - Added endpoints for listing tasks to the [Text to 3D](/api/text-to-3d#list-text-to-3d-tasks), [Image to 3D](/api/image-to-3d#list-image-to-3d-tasks), [Remesh](/api/remesh#list-remesh-tasks), and [Text to Texture](/api/text-to-texture#list-text-to-texture-tasks) APIs. ### `Jan 14` - Deprecated the legacy Text to 3D and Image to 3D APIs powered by Meshy-3 AI models. ### `Jan 07` - Added the `symmetry_mode` parameter to the [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task) and [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) APIs, allowing for configurable symmetry settings. --- ## December 2024 ### `Dec 19` - Added the [Remesh APIs](/api/remesh), which let users remesh and export existing 3D models generated by other Meshy APIs into various formats. - Updated the polycount limits for our APIs to a range of 100 to 300,000 for Premium users. ### `Dec 12` - Deprecated the `model_url` property in all response objects. - Separated legacy Meshy-3 API from the latest Meshy-4 API. ### `Dec 10` - Added an `enable_pbr` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Text to 3D Refine](/api/text-to-3d#create-a-text-to-3d-refine-task) APIs. - Added a `should_texture` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) API. - Deprecated the `pbr` option in `art_style` parameter for the [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task) API when using the `meshy-4` AI model. - Deprecated the `low-poly` option in `art_style` parameter for the [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task) API. ### `Dec 5` - Added a [Get Balance API](/api/balance) to let users retrieve their credit balance. - Added a `should_remesh` parameter to the [Image to 3D](/api/image-to-3d#create-an-image-to-3d-task) and [Text to 3D Preview](/api/text-to-3d#create-a-text-to-3d-preview-task) APIs. ### `Dec 3` - External APIs now use the `/openapi` prefix. Legacy paths remain supported, but we recommend switching to the new paths. --- ## November 2024 ### `Nov 14` - The [Image to 3D API](/api/image-to-3d#create-an-image-to-3d-task) now supports base64-encoded images. --- --- # Text to 3D API Source: https://docs.meshy.ai/api/text-to-3d # Text to 3D API Generate 3D models from text prompts in your own application. Text to 3D works in two steps. First, create a **preview** task (`mode: "preview"`) to generate a 3D mesh without texture, so you can check the shape. Then, send the successful preview's task ID to a **refine** task (`mode: "refine"`) to texture the mesh. Both steps use the same endpoint. --- ## POST /openapi/v2/text-to-3d -- Create a Text to 3D preview task Creates a Text to 3D preview task, which generates an untextured 3D mesh (geometry only) from a text prompt. This is the first step of the two-step workflow. After the preview succeeds, send its task ID in a refine task to texture the mesh. See [Create a Text to 3D refine task](#create-a-text-to-3d-refine-task). For the full response schema, see [The Text to 3D task object](#the-text-to-3d-task-object). The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). ### Parameters - `mode` · *string* · **required** The step of the two-step workflow. Send `preview` to create a preview task. - `prompt` · *string* · **required** Text that describes the object to generate, up to 800 characters. Longer text returns `400`. - `model_type` · *string* · default: `standard` The type of 3D mesh to generate. Available values: * `standard`: a high-detail 3D mesh * `smart-topology`: a Smart Topology mesh. Choose the model with `ai_model` (`meshy-t2` or `meshy-t2.5`). With `smart-topology`, Meshy ignores `should_remesh` and `decimation_mode`, and accepts only `topology: triangle`. - `ai_model` · *string* · default: `latest` The AI model that generates the 3D model. The available values depend on `model_type`. Standard models (`model_type: standard`): * `meshy-6-lite` * `meshy-6` * `meshy-7.1` * `latest`: Meshy 7.1 * `meshy-7` (deprecated): send `meshy-7.1` instead Smart Topology models (`model_type: smart-topology`): * `meshy-t2`: cleaner topology, natively separated parts, triangle output, and a face count you set with `target_polycount` * `meshy-t2.5` (default): sharper detail for game assets, triangle output, and a face count you set with `target_polycount` See [Models](/api/models#choose-by-project) for which model fits your project, such as a game character or a 3D print. - `geometry_resolution` · *string* · default: `standard` The geometry generation pass. Applies only to preview tasks. A refine with this parameter returns `400`. Available values: * `standard` * `2k`: runs the Ultra pass at 2048³ * `4k`: runs the Ultra pass at 4096³, for finer surface detail `2k` needs `meshy-7.1`, `latest`, or the deprecated `meshy-7`. `4k` needs `meshy-7.1` or `latest`. Other models return `400`. - `ultra_mode` · *boolean* · default: `false` · **deprecated** Send `geometry_resolution` instead. `ultra_mode: true` is the same as `geometry_resolution: "2k"`. - `should_remesh` · *boolean* · default: `true (meshy-6-lite), false (other models)` Whether to remesh the model after generation. For the highest-quality 3D model, send `false`. **Only when `should_remesh` is set:** - `topology` · *string* · default: `triangle` The face type of the remeshed model. Available values: * `quad`: a quad-dominant mesh * `triangle`: a decimated triangle mesh Smart Topology output is triangle-only. Sending `quad` with `ai_model` `meshy-t2` or `meshy-t2.5` returns `400`. - `decimation_mode` · *integer* Adaptive face count, by level. When you set it, Meshy ignores `target_polycount`. Available values: * `1`: ultra * `2`: high * `3`: medium * `4`: low - `target_polycount` · *integer* The number of faces to aim for. The result can differ from the target, depending on the geometry. It applies in two separate cases: * **Remesh**: with `should_remesh: true` on a `standard` model. Meshy remeshes (decimates) the mesh to about this count. If you set `decimation_mode`, Meshy uses it and ignores `target_polycount`. * **Smart Topology**: with `model_type: smart-topology` and `ai_model` `meshy-t2` or `meshy-t2.5`. Meshy generates the model at this face count directly. No remesh runs, and you don't need `should_remesh`. The following table shows the range and default for each case: | Case | Range | Default | | --- | --- | --- | | Remesh | `100` to `300000` | `30000` | | `meshy-t2` | `100` to `15000` | `4000` | | `meshy-t2.5` | `100` to `30000` | `15000` | A value outside the range returns `400`. For a low-poly game asset, use a Smart Topology model instead of remeshing a standard model. See [Models](/api/models#choose-by-project). - `symmetry_mode` · *string* · default: `auto` · **deprecated** Leave it out. This parameter doesn't affect the output. Available values: * `off`: disables symmetry * `auto`: applies symmetry based on the input geometry * `on`: enforces symmetry during generation - `pose_mode` · *string* The pose for a character model, `a-pose` or `t-pose`. To get no pose, leave out `pose_mode` and `is_a_t_pose`. - `is_a_t_pose` · *boolean* · default: `false` · **deprecated** Send `pose_mode` instead. Whether to generate the model in an A pose or a T pose. - `art_style` · *string* · default: `realistic` · **deprecated** Leave it out. Meshy ignores it. - `moderation` · *boolean* · default: `false` Whether to screen `prompt` for harmful content before generating. If Meshy detects harmful content, the request returns `400` and Meshy doesn't create a task. - `target_formats` · *string[]* The file formats to generate. Meshy generates and returns only these formats, which can shorten the task. If you leave it out, Meshy generates every format except `3mf`, which it generates only when you request it. Available values: * `glb` * `obj` * `fbx` * `stl` * `usdz` * `3mf` - `alpha_thumbnail` · *boolean* · default: `false` Whether to also render a preview with a transparent background (RGBA), returned in `alpha_thumbnail_url` when you get the task. `thumbnail_url` doesn't change. - `auto_size` · *boolean* · default: `false` Whether to estimate the object's real-world height with AI vision and resize the model to it. Meshy puts the origin at the bottom unless you set `origin_at`. **Only when `auto_size` is set:** - `origin_at` · *string* · default: `bottom` Where to put the model's origin, `bottom` or `center`. ### Returns The `result` field of the response holds the ID of the new Text to 3D task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: A required parameter, such as `prompt` or `mode`, is missing. * **Prompt too long**: `prompt` is over the character limit. * **Unsupported model for Ultra**: `geometry_resolution` is `2k` or `4k`, with an `ai_model` that can't run it. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` Content moderation blocked the prompt or an input image. Change the input, then retry. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Simple preview with required params only curl https://api.meshy.ai/openapi/v2/text-to-3d \ -H 'Authorization: Bearer ${YOUR_API_KEY}' \ -H 'Content-Type: application/json' \ -d '{ "mode": "preview", "prompt": "a monster mask" }' # Preview with Ultra 4K geometry, remesh, and A-pose curl https://api.meshy.ai/openapi/v2/text-to-3d \ -H 'Authorization: Bearer ${YOUR_API_KEY}' \ -H 'Content-Type: application/json' \ -d '{ "mode": "preview", "prompt": "a futuristic robot warrior", "ai_model": "meshy-7.1", "geometry_resolution": "4k", "should_remesh": true, "target_polycount": 100000, "pose_mode": "a-pose", "target_formats": ["glb"] }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Simple preview with required params only const payload = { mode: 'preview', prompt: 'a monster mask', }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v2/text-to-3d', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Preview with Ultra 4K geometry, remesh, and A-pose const advancedPayload = { mode: 'preview', prompt: 'a futuristic robot warrior', ai_model: 'meshy-7.1', geometry_resolution: '4k', should_remesh: true, target_polycount: 100000, pose_mode: 'a-pose', target_formats: ['glb'], }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v2/text-to-3d', advancedPayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Simple preview with required params only payload = { "mode": "preview", "prompt": "a monster mask", } response = requests.post( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # Preview with Ultra 4K geometry, remesh, and A-pose advanced_payload = { "mode": "preview", "prompt": "a futuristic robot warrior", "ai_model": "meshy-7.1", "geometry_resolution": "4k", "should_remesh": True, "target_polycount": 100000, "pose_mode": "a-pose", "target_formats": ["glb"], } response = requests.post( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, json=advanced_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## POST /openapi/v2/text-to-3d -- Create a Text to 3D refine task Creates a Text to 3D refine task, which textures the mesh of a completed preview task. Send the ID of a successful preview task as `preview_task_id`. See [Create a Text to 3D preview task](#create-a-text-to-3d-preview-task). This is the second step of the two-step workflow. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). ### Parameters - `mode` · *string* · **required** The step of the two-step workflow. Send `refine` to create a refine task. - `preview_task_id` · *string* · **required** The ID of the preview task to texture. The preview task must have the status `SUCCEEDED`. - `enable_pbr` · *boolean* · default: `false` Whether to also generate PBR maps (metallic, roughness, and normal) with the base color. With `ai_model` `meshy-6`, Meshy also generates an emission map, except at `texture_resolution: 8k`. `meshy-6-lite`, `meshy-7`, `meshy-7.1`, and `latest` don't generate an emission map. Neither does a refine of a `meshy-t2` or `meshy-t2.5` preview that doesn't set `ai_model`. With `ai_model: meshy-n1`, `true` returns `400`. - `texture_resolution` · *string* · default: `2k` The resolution of the base color texture. Applies only to refine tasks. A preview with this parameter returns `400`. Available values: * `2k`: 2048×2048 * `4k`: 4096×4096 * `8k`: 8192×8192 Higher resolutions capture more surface detail. `4k` and `8k` need `ai_model` `meshy-6`, `meshy-7.1`, or `latest`. With `meshy-n1`, they return `400`. At `8k`, Meshy doesn't generate an emission map. - `hd_texture` · *boolean* · default: `false` · **deprecated** Send `texture_resolution` instead. `hd_texture: true` is the same as `texture_resolution: "4k"`. If you send both, Meshy uses `texture_resolution`. - `texture_prompt` · *string* Text that guides the texturing, up to 800 characters. Longer text returns `400`. Send `texture_prompt` or `texture_image_url`, not both. If you send both, Meshy uses `texture_prompt`. With `ai_model: meshy-n1`, sending it returns `400`. - `texture_image_url` · *string* A 2D image that guides the texturing, as a public URL or a base64-encoded data URI, such as `data:image/jpeg;base64,`. The image must be a `.jpg`, `.jpeg`, `.png`, or `.webp` file of at most 20 MB, at least 32 pixels on each side, and at most 178,956,970 pixels (width × height). With `ai_model: meshy-n1`, Meshy textures from this image as the front view. > **Note:** Texturing from an image might not work well when the shape in the image differs a lot from the model. - `ai_model` · *string* · default: `inherited from the preview task` The AI model that textures the mesh. Available values: * `meshy-6-lite` * `meshy-6` * `meshy-7.1` * `latest`: Meshy 7.1 * `meshy-n1`: a 2K base color texture from a reference image only. No text prompt, no PBR maps, no 4K or 8K. * `meshy-7` (deprecated): send `meshy-7.1` instead Leave it out to use the preview task's model, so the preview and its refine run on the same model end to end. Send a value to override it. An explicit `latest` resolves the same way as on the preview task, so a `latest` preview and its `latest` refine always use the same texture model. With `meshy-n1`, Meshy textures from `texture_image_url`. Without it, Meshy uses the reference image that a `meshy-7.1` or `latest` preview stores. Any other preview returns `400` unless you send `texture_image_url`. The preview can have at most 7,999,999 triangles. A preview remeshed to quads returns `400`. - `moderation` · *boolean* · default: `false` Whether to screen `texture_prompt` and `texture_image_url` for harmful content before generating. If Meshy detects harmful content, the request returns `400` and Meshy doesn't create a task. - `remove_lighting` · *boolean* · default: `true` Whether to remove highlights and shadows from the base color texture. The cleaner result works better under custom lighting. Takes effect only when `ai_model` is `meshy-6`. `meshy-7.1` and `latest` accept it and ignore it, and so does a refine of a `meshy-t2` or `meshy-t2.5` preview that doesn't set `ai_model`. Sending it with `meshy-6-lite` returns `400`. With `meshy-n1`, `true` returns `400`. - `target_formats` · *string[]* The file formats to generate. Meshy generates and returns only these formats, which can shorten the task. If you leave it out, Meshy generates every format except `3mf`, which it generates only when you request it. Available values: * `glb` * `obj` * `fbx` * `stl` * `usdz` * `3mf` - `alpha_thumbnail` · *boolean* · default: `false` Whether to also render a preview with a transparent background (RGBA), returned in `alpha_thumbnail_url` when you get the task. `thumbnail_url` doesn't change. - `auto_size` · *boolean* · default: `false` Whether to estimate the object's real-world height with AI vision and resize the model to it. Meshy puts the origin at the bottom unless you set `origin_at`. **Only when `auto_size` is set:** - `origin_at` · *string* · default: `bottom` Where to put the model's origin, `bottom` or `center`. ### Returns The `result` field of the response holds the ID of the new Text to 3D task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Invalid task ID**: `preview_task_id` is invalid, or doesn't match one of your preview tasks. * **Task not ready**: The preview task hasn't succeeded yet. * **Model mismatch**: The preview task's AI model doesn't work with the requested refine model. * **Unsupported model for remove_lighting**: `remove_lighting` was sent with `ai_model: "meshy-6-lite"`. * **No reference image for Meshy N1**: `ai_model: meshy-n1` was sent without `texture_image_url`, and the preview has no reference image that Meshy N1 can use. Send `texture_image_url`. * **Quad preview for Meshy N1**: `ai_model: meshy-n1` was sent for a preview remeshed to quads. Refine it with another `ai_model`. * **Too many triangles for Meshy N1**: With `ai_model: meshy-n1`, the preview has more than 7,999,999 triangles. Refine it with another `ai_model`. * **Unsupported option for Meshy N1**: `ai_model: meshy-n1` was sent with one of these options: * `texture_prompt` * `enable_pbr: true` * `texture_resolution` of `4k` or `8k` * `hd_texture: true` without `texture_resolution` * `remove_lighting: true` Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` Content moderation blocked the prompt or an input image. Change the input, then retry. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Basic refine task curl https://api.meshy.ai/openapi/v2/text-to-3d \ -H 'Authorization: Bearer ${YOUR_API_KEY}' \ -H 'Content-Type: application/json' \ -d '{ "mode": "refine", "preview_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "enable_pbr": true }' # Refine with auto-size and GLB format curl https://api.meshy.ai/openapi/v2/text-to-3d \ -H 'Authorization: Bearer ${YOUR_API_KEY}' \ -H 'Content-Type: application/json' \ -d '{ "mode": "refine", "preview_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "target_formats": ["glb"], "auto_size": true }' # Refine with Meshy N1 from the preview's stored reference image curl https://api.meshy.ai/openapi/v2/text-to-3d \ -H 'Authorization: Bearer ${YOUR_API_KEY}' \ -H 'Content-Type: application/json' \ -d '{ "mode": "refine", "preview_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "ai_model": "meshy-n1" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Basic refine task const payload = { mode: 'refine', preview_task_id: '018a210d-8ba4-705c-b111-1f1776f7f578', enable_pbr: true, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v2/text-to-3d', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Refine with auto-size and GLB format const advancedPayload = { mode: 'refine', preview_task_id: '018a210d-8ba4-705c-b111-1f1776f7f578', target_formats: ['glb'], auto_size: true, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v2/text-to-3d', advancedPayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Refine with Meshy N1 from the preview's stored reference image const meshyN1Payload = { mode: 'refine', preview_task_id: '018a210d-8ba4-705c-b111-1f1776f7f578', ai_model: 'meshy-n1', }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v2/text-to-3d', meshyN1Payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Basic refine task payload = { "mode": "refine", "preview_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "enable_pbr": True, } response = requests.post( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # Refine with auto-size and GLB format advanced_payload = { "mode": "refine", "preview_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "target_formats": ["glb"], "auto_size": True, } response = requests.post( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, json=advanced_payload, ) response.raise_for_status() print(response.json()) # Refine with Meshy N1 from the preview's stored reference image meshy_n1_payload = { "mode": "refine", "preview_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "ai_model": "meshy-n1", } response = requests.post( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, json=meshy_n1_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## GET /openapi/v2/text-to-3d/:id -- Get a Text to 3D task Returns a Text to 3D task by its ID. It works for both preview and refine tasks. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Text to 3D task object](#the-text-to-3d-task-object). ### Examples The following table shows a sample model for each mode.
Mode Sample model
Preview ![Preview model](https://cdn.meshy.ai/docs-assets/api/quick-start/preview-model.webp)
Refine ![Refined model](https://cdn.meshy.ai/docs-assets/api/quick-start/refined-model.webp)
**cURL** ```bash curl https://api.meshy.ai/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v2/text-to-3d/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v2/text-to-3d/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "text-to-3d-preview", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "prompt": "a monster mask", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 20 } ``` --- ## DELETE /openapi/v2/text-to-3d/:id -- Delete a Text to 3D task Permanently deletes a Text to 3D task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v2/text-to-3d/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v2/text-to-3d/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v2/text-to-3d -- List Text to 3D tasks Returns a list of your Text to 3D tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, up to `255`. A larger value returns `400`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Text to 3D task objects](#the-text-to-3d-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v2/text-to-3d?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v2/text-to-3d?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v2/text-to-3d", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "text-to-3d-preview", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "prompt": "a monster mask", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 20 } ] ``` --- ## GET /openapi/v2/text-to-3d/:id/stream -- Stream a Text to 3D task Streams a Text to 3D task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Text to 3D task objects](#the-text-to-3d-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 0, "status": "PENDING" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 50, "status": "IN_PROGRESS" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "text-to-3d-preview", "progress": 100, "status": "SUCCEEDED", "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***" }, "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX", "emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 20 } ``` --- ## The Text to 3D task object A Text to 3D task object describes one task that generates a 3D model from a **text** prompt. It holds the status, the progress, and the model files when the task succeeds. Text to 3D has two stages, `preview` and `refine`. A preview task generates a mesh-only 3D model, and a refine task generates a textured 3D model from the preview's result. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, `text-to-3d-preview` for a preview task or `text-to-3d-refine` for a refine task. - `model_urls` · *object* Download URLs for the generated 3D model, one per file format. A format the task didn't generate has no key, rather than an empty string. - `glb` · *string* The GLB file. - `fbx` · *string* The FBX file. - `usdz` · *string* The USDZ file. - `obj` · *string* The OBJ file. - `mtl` · *string* The MTL file. - `stl` · *string* The STL file. - `3mf` · *string* The 3MF file. Present only when `target_formats` includes `3mf`. - `prompt` · *string* The `prompt` you sent to create the task, unmodified. - `texture_prompt` · *string* The text prompt you sent to guide the texturing in the refine stage. - `ultra_mode` · *boolean* · **deprecated** Read `geometry_resolution` instead. - `geometry_resolution` · *string* The Ultra tier the preview task ran, `2k` or `4k`. The field is absent for `standard`. - `texture_image_url` · *string* Download URL for the image you sent to guide the texturing. - `thumbnail_url` · *string* Download URL for a thumbnail image of the 3D model. - `alpha_thumbnail_url` · *string* Download URL for a version of `thumbnail_url` with a transparent background (RGBA). Present only when you created the task with `alpha_thumbnail: true` and Meshy rendered the transparent preview. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `texture_urls` · *array* Download URLs for the generated texture maps, as an array of objects. It usually holds **one** object. Each object has these fields: - `base_color` · *string* The base color map. - `metallic` · *string* The metallic map. Absent when you created the task with `enable_pbr: false`. - `normal` · *string* The normal map. Absent when you created the task with `enable_pbr: false`. - `roughness` · *string* The roughness map. Absent when you created the task with `enable_pbr: false`. - `emission` · *string* The emission map. Absent in any of these cases: * You created the task with `enable_pbr: false`. * `ai_model` is `meshy-6-lite`, `meshy-7`, `meshy-7.1`, or `latest`. * `texture_resolution` is `8k`. * The task refines a `meshy-t2` or `meshy-t2.5` preview without setting `ai_model`. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `task_error` · *object* The error details when the task fails. It's `null` unless the status is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **Example Text to 3D Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "text-to-3d-preview", "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=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" }, "prompt": "a monster mask", "texture_prompt": "green slimy skin with scales and warts", "texture_image_url": "", "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX", "emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 20 } ``` --- # Image to 3D API Source: https://docs.meshy.ai/api/image-to-3d # Image to 3D API Turn an image into a 3D model, textured or untextured, in the formats you choose. Send the image, or use the output of a Text to Image or Image to Image task. --- ## POST /openapi/v1/image-to-3d -- Create an Image to 3D task Creates an Image to 3D task. The task runs in the background. 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 `image_url`. The ID of a Text to Image or Image to Image task whose image you want to use as the input. The task must be one you created with the API, have the status `SUCCEEDED`, and have produced exactly one image. - `image_url` · *string* · **required** Required unless you send `input_task_id`. The image to turn into a 3D model, as a public URL or a base64-encoded data URI, such as `data:image/jpeg;base64,`. If you send both, Meshy uses `input_task_id`. The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB, at least 32 pixels on each side, and at most 178,956,970 pixels (width × height). - `model_type` · *string* · default: `standard` The kind of 3D mesh to generate. Available values: * `standard`: a high-detail mesh * `smart-topology`: a mesh from a Smart Topology model, which you pick with `ai_model` (`meshy-t2` or `meshy-t2.5`) With `smart-topology`, Meshy ignores `should_remesh`, `save_pre_remeshed_model`, and `decimation_mode`, and accepts only `topology: triangle`. - `ai_model` · *string* · default: `latest` The AI model that generates the 3D model. The available values depend on `model_type`. Standard models (`model_type: standard`): * `latest`: Meshy 7.1 * `meshy-7.1` * `meshy-6` * `meshy-6-lite` * `meshy-7` (deprecated): use `meshy-7.1` instead Smart Topology models (`model_type: smart-topology`) produce triangles, at a face count you can set with `target_polycount`: * `meshy-t2`: cleaner topology and natively separated parts * `meshy-t2.5` (default): sharper detail for game assets See [Models](/api/models#choose-by-project) for which model fits your project, such as a game character or a 3D print. - `geometry_resolution` · *string* · default: `standard` The geometry generation pass. Available values: * `standard` * `2k`: runs the Ultra pass at 2048³ * `4k`: runs the Ultra pass at 4096³, for the most surface detail `2k` needs `meshy-7.1`, `latest`, or the deprecated `meshy-7`. `4k` needs `meshy-7.1` or `latest`. - `ultra_mode` · *boolean* · default: `false` · **deprecated** Use `geometry_resolution` instead. `ultra_mode: true` is the same as `geometry_resolution: "2k"`. - `should_texture` · *boolean* · default: `true` Whether to generate textures. `true` returns a textured model, and `false` skips texturing and returns an untextured mesh. **Only when `should_texture` is set:** - `texture_model` · *string* · default: `depends on ai_model` The AI model that textures the 3D model, in the same task. Leave it out to use the default texture model for your `ai_model`. It doesn't change the credit cost. Available values: * `meshy-7`: Meshy 7, with PBR maps and textures up to 8K * `meshy-n1`: Meshy N1, a 2K base color texture from reference images only * `meshy-6-lite`: Meshy 6 Lite, a 2K texture at the lowest cost * `meshy-6`: Meshy 6, only as the default for `ai_model: meshy-6` Every `ai_model` takes `meshy-7`, `meshy-n1`, and `meshy-6-lite`. An option that the chosen texture model doesn't support returns `400`. With `meshy-n1`, a generated model over 7,999,999 triangles fails the task, and Meshy refunds its credits. With `should_texture: false`, Meshy ignores `texture_model`, but an unknown value still returns `400`. See [Models](/api/models#texture-models) for what each texture model does and which to pick. - `enable_pbr` · *boolean* · default: `false` Whether to also generate PBR maps (metallic, roughness, and normal) besides the base color. `true` needs `should_texture: true`, and returns `400` with `should_texture: false`. With `texture_model: meshy-n1`, `true` returns `400`. The Meshy 6 texture model also generates an emission map, except at `texture_resolution: 8k`. - `texture_resolution` · *string* · default: `2k` The size of the base color texture. A larger texture captures more surface detail. Available values: * `2k`: 2048×2048 * `4k`: 4096×4096 * `8k`: 8192×8192 `4k` and `8k` need the Meshy 7 or Meshy 6 texture model, and return `400` with the others. At `8k`, Meshy doesn't produce an emission map. - `hd_texture` · *boolean* · default: `false` · **deprecated** Use `texture_resolution` instead. `hd_texture: true` is the same as `texture_resolution: "4k"`. If you send both, Meshy uses `texture_resolution`. - `texture_prompt` · *string* Text that guides the texture, up to 800 characters. Longer text returns `400`. With `texture_model: meshy-n1`, sending it returns `400`. - `texture_image_url` · *string* An image that guides the texture, as a public URL or a base64-encoded data URI, such as `data:image/jpeg;base64,`. The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB, at least 32 pixels on each side, and at most 178,956,970 pixels (width × height). Meshy guides the texture with only one of `texture_prompt` and `texture_image_url`. If you send both, Meshy uses `texture_prompt`. For the credit cost of texturing, see [Pricing](/api/pricing). With `texture_model: meshy-n1`, Meshy textures from this image as the front view, or from the input image when you leave it out. > **Note:** Texturing from an image might not work well when the image's shape differs a lot from the 3D model's geometry. - `should_remesh` · *boolean* · default: `true (meshy-6-lite), false (other models)` Whether to run the remesh phase. For the highest-quality 3D model, set it to `false`. **Only when `should_remesh` is set:** - `topology` · *string* · default: `triangle` The face type of the remeshed model. Available values: * `quad`: a quad-dominant mesh * `triangle`: a decimated triangle mesh Smart Topology output is triangle-only, so `quad` with `meshy-t2` or `meshy-t2.5` returns `400`. With `texture_model: meshy-n1`, `quad` returns `400` when the model is remeshed, which `meshy-6-lite` does by default. - `decimation_mode` · *integer* Adaptive face count, by level. When you set it, Meshy ignores `target_polycount`. Available values: * `1`: ultra * `2`: high * `3`: medium * `4`: low - `save_pre_remeshed_model` · *boolean* · default: `false` Whether to also store a GLB of the model from before the remesh phase. Meshy returns it in `model_urls.pre_remeshed_glb`. - `target_polycount` · *integer* The number of faces to aim for. The result can differ from the target, depending on the model's geometry. It applies in two separate cases: * **Remesh**: When `should_remesh` is `true` on a `standard` model, Meshy decimates the mesh to about this count. If you set `decimation_mode`, Meshy uses it and ignores `target_polycount`. * **Smart Topology**: When `model_type` is `smart-topology` and `ai_model` is `meshy-t2` or `meshy-t2.5`, Meshy generates the model at this face count. No remesh runs, and you don't need `should_remesh`. The range and default depend on the case: | Case | Range | Default | | --- | --- | --- | | Remesh | `100` to `300000` | `30000` | | `meshy-t2` | `100` to `15000` | `4000` | | `meshy-t2.5` | `100` to `30000` | `15000` | A value outside the range returns `400`. For a low-poly game asset, use a Smart Topology model instead of remeshing a standard model. See [Models](/api/models#choose-by-project). - `symmetry_mode` · *string* · default: `auto` · **deprecated** Leave it out, because it doesn't affect the output. Its values controlled symmetry during generation: * `off`: no symmetry * `auto`: symmetry chosen from the input geometry * `on`: enforced symmetry - `pose_mode` · *string* The pose for a character model, `a-pose` or `t-pose`. To get no pose, leave out `pose_mode` and `is_a_t_pose`. - `is_a_t_pose` · *boolean* · default: `false` · **deprecated** Use `pose_mode` instead. Whether to generate the model in an A or T pose. - `surface_mode` · *string* · **deprecated** Use `ai_model` instead. It doesn't affect the output, because the model generation it selected is retired. Accepted values are `organic` and `hard`. Any other value returns `400`. - `image_enhancement` · *boolean* · default: `true` Whether to optimize the input image before generating. `false` keeps the exact look of the input image, with no style processing. It works only with `meshy-6`, `meshy-7.1`, or `latest`. With `meshy-6-lite` or `model_type: smart-topology`, it returns `400`. - `remove_lighting` · *boolean* · default: `true` Whether to remove highlights and shadows from the base color texture. The result is cleaner and works better under your own lighting. It takes effect only with the Meshy 6 texture model, and a texture model that doesn't support it returns `400` for `true`. With `model_type: smart-topology`, or with `ai_model: meshy-6-lite` and its default texture model, sending it returns `400`. - `moderation` · *boolean* · default: `false` Whether to screen these inputs for harmful content before generating: * `image_url` * `texture_image_url` * `texture_prompt` If Meshy detects harmful content, the request returns `400` and Meshy doesn't create a task. - `target_formats` · *string[]* The file formats to generate. Meshy generates and returns only the formats you list, which can shorten the task. If you leave it out, Meshy generates every format except `3mf`, which you get only when you list it. Available values: * `glb` * `obj` * `fbx` * `stl` * `usdz` * `3mf` - `auto_size` · *boolean* · default: `false` Whether to estimate the object's real-world height with AI vision and resize the model to it. Meshy puts the origin at the bottom unless you set `origin_at`. - `alpha_thumbnail` · *boolean* · default: `false` Whether to also render a preview with a transparent background (RGBA), returned in `alpha_thumbnail_url` when you get the task. `thumbnail_url` doesn't change. - `multi_view_thumbnails` · *boolean* · default: `false` Whether to also render front, right, back, and left previews, returned in `thumbnail_urls` when you get the task. `thumbnail_url` doesn't change and still shows the front view. This adds about 5 seconds to the task. **Only when `auto_size` is set:** - `origin_at` · *string* · default: `bottom` Where to put the model's origin, `bottom` or `center`. ### Returns The `result` field of the response holds the ID of the new Image to 3D task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `image_url` nor `input_task_id` was sent. * **Invalid input task**: `input_task_id` isn't a `SUCCEEDED` Text to Image or Image to Image task that produced exactly one image. * **Invalid image format**: The `image_url` image isn't a JPG, JPEG, PNG, or WebP file. * **Unreachable URL**: Meshy can't download the `image_url` image, because the URL returns `404` or times out. * **Image too large**: The `image_url` or `texture_image_url` image is over 20 MB. * **Invalid image size**: The `image_url` or `texture_image_url` image has a side shorter than 32 pixels, or more than 178,956,970 pixels (width × height). * **Invalid data URI**: The base64 string is malformed. * **Invalid parameter combination**: `enable_pbr` is `true`, and `should_texture` is `false`. * **Unsupported model for Ultra**: `geometry_resolution` is `2k` or `4k`, with an `ai_model` that can't run it. * **Unsupported model for image options**: one of these: * `image_enhancement` was sent with `ai_model: "meshy-6-lite"` or `model_type: "smart-topology"`. * `remove_lighting` was sent with `model_type: "smart-topology"`, or with `ai_model: "meshy-6-lite"` and its default texture model. * **Invalid texture model**: `texture_model` isn't one of the available values. * **Texture model not available**: `texture_model` is `meshy-6` with an `ai_model` other than `meshy-6`. Send `meshy-7`, `meshy-n1`, or `meshy-6-lite`, or leave it out. * **Unsupported option for the texture model**: The request asks the texture model for an option it doesn't support, such as `enable_pbr: true` with `meshy-n1` or a `4k` texture with `meshy-6-lite`. See [Models](/api/models#texture-models). Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` Content moderation blocked the prompt or an input image. Change the input, then retry. - `404 - Not Found` `input_task_id` doesn't match any of your tasks. Check the task ID, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Simple request with required params curl https://api.meshy.ai/openapi/v1/image-to-3d \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "" }' # With Ultra 4K geometry, remesh, PBR, and A-pose curl https://api.meshy.ai/openapi/v1/image-to-3d \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "", "ai_model": "meshy-7.1", "geometry_resolution": "4k", "enable_pbr": true, "should_remesh": true, "target_polycount": 100000, "should_texture": true, "pose_mode": "a-pose", "target_formats": ["glb"] }' # Textured with Meshy N1 from the input image curl https://api.meshy.ai/openapi/v1/image-to-3d \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "", "ai_model": "meshy-7.1", "texture_model": "meshy-n1" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Simple request with required params const payload = { image_url: "", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/image-to-3d', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // With Ultra 4K geometry, remesh, PBR, and A-pose const advancedPayload = { image_url: "", ai_model: "meshy-7.1", geometry_resolution: "4k", enable_pbr: true, should_remesh: true, target_polycount: 100000, should_texture: true, pose_mode: "a-pose", target_formats: ["glb"], }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/image-to-3d', advancedPayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Textured with Meshy N1 from the input image const meshyN1Payload = { image_url: "", ai_model: "meshy-7.1", texture_model: "meshy-n1", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/image-to-3d', meshyN1Payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Simple request with required params payload = { "image_url": "", } response = requests.post( "https://api.meshy.ai/openapi/v1/image-to-3d", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # With Ultra 4K geometry, remesh, PBR, and A-pose advanced_payload = { "image_url": "", "ai_model": "meshy-7.1", "geometry_resolution": "4k", "enable_pbr": True, "should_remesh": True, "target_polycount": 100000, "should_texture": True, "pose_mode": "a-pose", "target_formats": ["glb"], } response = requests.post( "https://api.meshy.ai/openapi/v1/image-to-3d", headers=headers, json=advanced_payload, ) response.raise_for_status() print(response.json()) # Textured with Meshy N1 from the input image meshy_n1_payload = { "image_url": "", "ai_model": "meshy-7.1", "texture_model": "meshy-n1", } response = requests.post( "https://api.meshy.ai/openapi/v1/image-to-3d", headers=headers, json=meshy_n1_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## GET /openapi/v1/image-to-3d/:id -- Get an Image to 3D task Returns an Image to 3D task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Image to 3D task object](#the-image-to-3d-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/image-to-3d/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/image-to-3d/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "image-to-3d", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***", "pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "thumbnail_urls": { "front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***", "right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***", "back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***", "left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***" }, "texture_prompt": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX", "emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 30 } ``` --- ## DELETE /openapi/v1/image-to-3d/:id -- Delete an Image to 3D task Permanently deletes an Image to 3D task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/image-to-3d/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/image-to-3d/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/image-to-3d -- List Image to 3D tasks Returns a list of your Image to 3D tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, up to `255`. A larger value returns `400`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Image to 3D task objects](#the-image-to-3d-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/image-to-3d?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/image-to-3d?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/image-to-3d", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "image-to-3d", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "thumbnail_urls": { "front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***", "right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***", "back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***", "left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***" }, "texture_prompt": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX", "emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 30 } ] ``` --- ## GET /openapi/v1/image-to-3d/:id/stream -- Stream an Image to 3D task Streams an Image to 3D task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Image to 3D task objects](#the-image-to-3d-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 0, "status": "PENDING" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "image-to-3d", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***", "pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "thumbnail_urls": { "front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***", "right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***", "back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***", "left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***" }, "texture_prompt": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX", "emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 30 } ``` --- ## The Image to 3D task object An Image to 3D task object describes one generation of a 3D model from an image. It holds the status, the progress, and the model files when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `image-to-3d`. - `model_urls` · *object* Download URLs for the generated 3D model, one per file format. A format the task didn't generate has no key, rather than an empty string. - `glb` · *string* The GLB file. - `fbx` · *string* The FBX file. - `obj` · *string* The OBJ file. - `usdz` · *string* The USDZ file. - `mtl` · *string* The MTL file, returned with an OBJ file when the model has textures. - `stl` · *string* The STL file. - `3mf` · *string* The 3MF file. Present only when `target_formats` includes `3mf`. - `pre_remeshed_glb` · *string* The GLB file from before the remesh. Present only when you created the task with both `should_remesh: true` and `save_pre_remeshed_model: true`. - `thumbnail_url` · *string* Download URL for a preview image of the 3D model. When `thumbnail_urls` is present, it's the same image as `thumbnail_urls.front`. Meshy keeps it for backward compatibility. - `alpha_thumbnail_url` · *string* Download URL for a version of `thumbnail_url` with a transparent background (RGBA). Present only when you created the task with `alpha_thumbnail: true` and Meshy rendered the transparent preview. - `thumbnail_urls` · *object* Download URLs for previews of the 3D model from four sides. Each value is a signed URL to a 512×512 PNG, rendered with the same materials and lighting as `thumbnail_url`. Use them to preview the model from several angles, for example in a batch pipeline, without downloading the GLB. Present only when you created the task with `multi_view_thumbnails: true` and the task reached `SUCCEEDED`. Tasks created without `multi_view_thumbnails: true` don't include this field. - `front` · *string* The front view, at 0° around the vertical axis. It matches `thumbnail_url`. - `right` · *string* The right view, at 90°. - `back` · *string* The back view, at 180°. - `left` · *string* The left view, at 270°. - `texture_prompt` · *string* The text prompt that guided the texture. - `texture_image_url` · *string* Download URL for the image that guided the texture. - `ultra_mode` · *boolean* · **deprecated** Read `geometry_resolution` instead. - `geometry_resolution` · *string* The Ultra tier the task ran, `2k` or `4k`. A `standard` task doesn't include this field. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `texture_urls` · *array* The texture maps the task generated, as an array of objects. It usually holds one object, with these fields: - `base_color` · *string* Download URL for the base color map. - `metallic` · *string* Download URL for the metallic map. The field is absent when you created the task with `enable_pbr: false`. - `normal` · *string* Download URL for the normal map. The field is absent when you created the task with `enable_pbr: false`. - `roughness` · *string* Download URL for the roughness map. The field is absent when you created the task with `enable_pbr: false`. - `emission` · *string* Download URL for the emission map. Meshy includes it only when you created the task with all of these: * `ai_model: meshy-6`, with its default texture model * `enable_pbr: true` * a `texture_resolution` of `2k` or `4k` - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `task_error` · *object* The error details when the task fails. It's `null` unless the status is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **Example Image to 3D Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "image-to-3d", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***", "pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "thumbnail_urls": { "front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***", "right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***", "back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***", "left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***" }, "texture_prompt": "", "texture_image_url": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX", "emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 30 } ``` --- # Multi-Image to 3D API Source: https://docs.meshy.ai/api/multi-image-to-3d # Multi-Image to 3D API Generate a 3D model from one to four images of the same object, taken from different angles. --- ## POST /openapi/v1/multi-image-to-3d -- Create a Multi-Image to 3D task Creates a Multi-Image to 3D task. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). For the fields a task has, see [The Multi-Image to 3D task object](#the-multi-image-to-3d-task-object). ### Parameters - `input_task_id` · *string* · **required** Required unless you send `image_urls`. The ID of a Text to Image or Image to Image task, including a multi-view one. Meshy uses its one to four images as the input. The task must be one you created with the API and have the status `SUCCEEDED`. - `image_urls` · *array* · **required** Required unless you send `input_task_id`. One to four images, each as a public URL or a data URI, such as `data:image/jpeg;base64,`. If you send both, Meshy uses `input_task_id`. Each image must be a `.jpg`, `.jpeg`, `.png`, or `.webp` file of at most 20 MB, at least 32 pixels on each side, and at most 178,956,970 pixels (width × height). More than four images returns `400`. For the best results, the images should show the same object from different angles. With `meshy-7.1` or `latest`, Meshy uses the first image as the front view, and the order of the others doesn't matter. - `ai_model` · *string* · default: `latest` The AI model that generates the 3D model. Available values: * `latest`: Meshy 7.1 * `meshy-7.1` * `meshy-6` * `meshy-6-lite` * `meshy-7`: deprecated, send `meshy-7.1` instead See [Models](/api/models#choose-by-project) for which model fits your project, such as a real object or a 3D print. - `geometry_resolution` · *string* · default: `standard` How much geometry detail to generate. Available values: * `standard` * `2k`: runs the Ultra pass at 2048³. Needs `meshy-7.1`, `latest`, or the deprecated `meshy-7`. - `ultra_mode` · *boolean* · default: `false` · **deprecated** Send `geometry_resolution` instead. `ultra_mode: true` is the same as `geometry_resolution: "2k"`. - `should_texture` · *boolean* · default: `true` Whether to generate textures. `true` returns a textured model, and `false` skips the texture step and returns a mesh without textures. **Only when `should_texture` is set:** - `texture_model` · *string* · default: `depends on ai_model` The AI model that textures the 3D model from several views, in the same task. Leave it out to use the default texture model for your `ai_model`. It doesn't change the credit cost. Available values: * `meshy-7`: Meshy 7, with PBR maps and textures up to 8K * `meshy-n1`: Meshy N1, a 2K base color texture from reference images only Every `ai_model` takes both. A textured request with `meshy-6` or `meshy-6-lite` returns `400`, and so does an option that the chosen texture model doesn't support. With `should_texture: false`, Meshy ignores `texture_model`, but an unknown value still returns `400`. With `meshy-n1`, Meshy textures from `texture_image_urls` or `texture_image_url`, or from the input images when you send neither. The first image is the front view. A generated model over 7,999,999 triangles fails the task, and Meshy refunds its credits. See [Models](/api/models#texture-models) for what each texture model does and which to pick. - `enable_pbr` · *boolean* · default: `false` Whether to also generate metallic, roughness, and normal maps, in addition to the base color. The Meshy 6 texture model also generates an emission map, except at `texture_resolution: 8k`. With `texture_model: meshy-n1`, `true` returns `400`. - `texture_resolution` · *string* · default: `2k` The size of the base color texture. A larger size captures more surface detail. Available values: * `2k`: 2048×2048 * `4k`: 4096×4096 * `8k`: 8192×8192 `4k` and `8k` need the Meshy 7 or Meshy 6 texture model, and return `400` with the others. At `8k`, Meshy doesn't generate an emission map. - `hd_texture` · *boolean* · default: `false` · **deprecated** Send `texture_resolution` instead. `hd_texture: true` is the same as `texture_resolution: "4k"`. If you send both, Meshy uses `texture_resolution`. - `texture_prompt` · *string* Text that guides the texture, up to 800 characters. Longer text returns `400`. With `texture_model: meshy-n1`, sending it returns `400`. - `texture_image_url` · *string* One 2D image that guides the texture, as a public URL or a data URI, such as `data:image/jpeg;base64,`. The image must be a `.jpg`, `.jpeg`, `.png`, or `.webp` file of at most 20 MB, at least 32 pixels on each side, and at most 178,956,970 pixels (width × height). If you send both `texture_image_url` and `texture_prompt`, Meshy uses `texture_prompt`. With `texture_model: meshy-n1`, Meshy textures from this image as the front view. > **Note:** The texture might not come out well when the shape in the image differs a lot from the 3D model. - `texture_image_urls` · *string[]* One to four images of the object from different views that guide the texture. Meshy uses the first image as the front view. The order of the other views (left, back, right) doesn't matter. Each image follows the same rules as `texture_image_url`. It's a public URL or a data URI, in `.jpg`, `.jpeg`, `.png`, or `.webp` format, of at most 20 MB, at least 32 pixels on each side, and at most 178,956,970 pixels (width × height). These images guide only the texture and don't depend on `image_urls`. The two lists can hold different images and different numbers of images. `texture_image_urls` needs the Meshy 7 or Meshy N1 texture model. Send it with one of these: * `ai_model` of `meshy-7.1`, `latest`, or the deprecated `meshy-7` * `texture_model` of `meshy-7` or `meshy-n1` You can't send it with `texture_image_url` or `texture_prompt`. - `should_remesh` · *boolean* · default: `true (meshy-6-lite), false (other models)` Whether to remesh the model after generation. For the highest-quality 3D model, set it to `false`. **Only when `should_remesh` is set:** - `topology` · *string* · default: `triangle` The face type of the remeshed model. Available values: * `quad`: a quad-dominant mesh * `triangle`: a decimated triangle mesh With `texture_model: meshy-n1`, `quad` returns `400` when the model is remeshed, which `meshy-6-lite` does by default. - `target_polycount` · *integer* · default: `30000` The number of faces to aim for, from `100` to `300000`. The result can differ from the target, depending on the model's geometry. A value outside the range returns `400`. - `decimation_mode` · *integer* Adaptive face count, by level. When you set it, Meshy ignores `target_polycount`. Available values: * `1`: ultra * `2`: high * `3`: medium * `4`: low - `save_pre_remeshed_model` · *boolean* · default: `false` Whether to also save the GLB from before the remesh, returned in `model_urls.pre_remeshed_glb`. - `symmetry_mode` · *string* · default: `auto` · **deprecated** Leave it out. It doesn't affect the output. Available values: * `off`: no symmetry * `auto`: symmetry based on the input geometry * `on`: enforced symmetry - `pose_mode` · *string* The pose for a character model, `a-pose` or `t-pose`. To get no pose, leave out `pose_mode` and `is_a_t_pose`. - `is_a_t_pose` · *boolean* · default: `false` · **deprecated** Send `pose_mode` instead. Whether to generate the model in an A or T pose. - `image_enhancement` · *boolean* · default: `true` Whether to optimize the input images before generating. `false` keeps the exact look of the input images, with no style processing. Supported only with `meshy-6`, `meshy-7.1`, or `latest`. Sending it with `meshy-6-lite` returns `400`. - `remove_lighting` · *boolean* · default: `true` Whether to remove highlights and shadows from the base color texture. The cleaner result works better under your own lighting. Only the Meshy 6 texture model uses it, and at `texture_resolution: 8k` it always removes lighting. With `texture_model: meshy-n1`, `true` returns `400`. With `ai_model: meshy-6-lite` and its default texture model, sending it returns `400`. - `moderation` · *boolean* · default: `false` Whether to screen the inputs for harmful content. Meshy screens each input image, `texture_image_url` or each image in `texture_image_urls`, and the text in `texture_prompt`. If Meshy finds harmful content, the request returns `400` and Meshy doesn't create a task. - `target_formats` · *string[]* The 3D file formats to generate. Meshy generates and returns only the formats you list, which can shorten the task. Available values: * `glb` * `obj` * `fbx` * `stl` * `usdz` * `3mf` If you leave it out, Meshy generates every format except `3mf`. Meshy generates `3mf` only when you list it. - `auto_size` · *boolean* · default: `false` Whether to estimate the object's real-world height with AI vision and resize the model to it. Meshy puts the origin at the bottom unless you set `origin_at`. **Only when `auto_size` is set:** - `origin_at` · *string* · default: `bottom` Where to put the model's origin, `bottom` or `center`. - `alpha_thumbnail` · *boolean* · default: `false` Whether to also render a preview with a transparent background (RGBA), returned in `alpha_thumbnail_url` when you get the task. `thumbnail_url` doesn't change. - `multi_view_thumbnails` · *boolean* · default: `false` Whether to also render front, right, back, and left previews, returned in `thumbnail_urls` when you get the task. `thumbnail_url` doesn't change and still shows the front view. This adds about 5 seconds to the task. ### Returns The `result` field of the response holds the ID of the new Multi-Image to 3D task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `image_urls` nor `input_task_id` was sent. * **Invalid input task**: `input_task_id` isn't a `SUCCEEDED` Text to Image or Image to Image task, or a multi-view one. * **Invalid image count**: `image_urls` or `texture_image_urls` doesn't hold 1 to 4 images. * **Invalid image format**: An image in `image_urls` isn't in a supported format. * **Conflicting texture inputs**: `texture_image_urls` was sent with `texture_image_url`, with `texture_prompt`, or with `should_texture: false`. * **Unsupported model for multi-view texture**: `texture_image_urls` was sent with `ai_model` of `meshy-6` or `meshy-6-lite`, unless `texture_model` is `meshy-7` or `meshy-n1`. * **Unreachable URL**: Meshy can't download an image in `image_urls` or `texture_image_urls`. * **Image too large**: An image in `image_urls`, `texture_image_url`, or `texture_image_urls` is over 20 MB. * **Invalid image size**: An image in `image_urls`, `texture_image_url`, or `texture_image_urls` has a side shorter than 32 pixels, or more than 178,956,970 pixels (width × height). * **Unsupported resolution for multi-image input**: `geometry_resolution` is `"4k"`, which this endpoint doesn't support. Use `2k` or `standard`. * **Unsupported model for image options**: `image_enhancement` was sent with `ai_model: "meshy-6-lite"`, or `remove_lighting` was sent with `ai_model: "meshy-6-lite"` and its default texture model. * **Invalid texture model**: `texture_model` isn't a valid texture model name. * **Texture model not available**: A textured request sent `texture_model` of `meshy-6` or `meshy-6-lite`. Multi-Image to 3D takes only the texture models that texture from several views. Send `meshy-7` or `meshy-n1`, or leave `texture_model` out. * **Unsupported option for the texture model**: The request asks the texture model for an option it doesn't support, such as `enable_pbr: true` with `meshy-n1` or a `4k` texture with `meshy-6-lite`. See [Models](/api/models#texture-models). Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` Content moderation blocked the prompt or an input image. Change the input, then retry. - `404 - Not Found` `input_task_id` doesn't match any of your tasks. Check the task ID, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Simple request curl https://api.meshy.ai/openapi/v1/multi-image-to-3d \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_urls": [ "", "" ] }' # With Ultra 2K geometry, PBR texturing, and GLB format curl https://api.meshy.ai/openapi/v1/multi-image-to-3d \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_urls": [ "", "" ], "ai_model": "meshy-7.1", "geometry_resolution": "2k", "should_texture": true, "enable_pbr": true, "target_formats": ["glb"] }' # Textured with Meshy N1 from the input images, the first as the front view curl https://api.meshy.ai/openapi/v1/multi-image-to-3d \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_urls": [ "", "" ], "ai_model": "meshy-7.1", "texture_model": "meshy-n1" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Simple request const payload = { image_urls: [ "", "" ], }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/multi-image-to-3d', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // With Ultra 2K geometry, PBR texturing, and GLB format const advancedPayload = { image_urls: [ "", "" ], ai_model: "meshy-7.1", geometry_resolution: "2k", should_texture: true, enable_pbr: true, target_formats: ["glb"], }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/multi-image-to-3d', advancedPayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Textured with Meshy N1 from the input images, the first as the front view const meshyN1Payload = { image_urls: [ "", "" ], ai_model: "meshy-7.1", texture_model: "meshy-n1", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/multi-image-to-3d', meshyN1Payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests # Simple request payload = { "image_urls": [ "", "" ], } headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Simple request response = requests.post( "https://api.meshy.ai/openapi/v1/multi-image-to-3d", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # With Ultra 2K geometry, PBR texturing, and GLB format advanced_payload = { "image_urls": [ "", "" ], "ai_model": "meshy-7.1", "geometry_resolution": "2k", "should_texture": True, "enable_pbr": True, "target_formats": ["glb"], } response = requests.post( "https://api.meshy.ai/openapi/v1/multi-image-to-3d", headers=headers, json=advanced_payload, ) response.raise_for_status() print(response.json()) # Textured with Meshy N1 from the input images, the first as the front view meshy_n1_payload = { "image_urls": [ "", "" ], "ai_model": "meshy-7.1", "texture_model": "meshy-n1", } response = requests.post( "https://api.meshy.ai/openapi/v1/multi-image-to-3d", headers=headers, json=meshy_n1_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## GET /openapi/v1/multi-image-to-3d/:id -- Get a Multi-Image to 3D task Returns a Multi-Image to 3D task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Multi-Image to 3D task object](#the-multi-image-to-3d-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/multi-image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/multi-image-to-3d/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/multi-image-to-3d/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "multi-image-to-3d", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***", "pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "thumbnail_urls": { "front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***", "right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***", "back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***", "left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***" }, "texture_prompt": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 30 } ``` --- ## DELETE /openapi/v1/multi-image-to-3d/:id -- Delete a Multi-Image to 3D task Permanently deletes a Multi-Image to 3D task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/multi-image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/multi-image-to-3d/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/multi-image-to-3d/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/multi-image-to-3d -- List Multi-Image to 3D tasks Returns a list of your Multi-Image to 3D tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, up to `255`. A larger value returns `400`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Multi-Image to 3D task objects](#the-multi-image-to-3d-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/multi-image-to-3d?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/multi-image-to-3d?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/multi-image-to-3d", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "multi-image-to-3d", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "thumbnail_urls": { "front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***", "right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***", "back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***", "left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***" }, "texture_prompt": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 30 } ] ``` --- ## GET /openapi/v1/multi-image-to-3d/:id/stream -- Stream a Multi-Image to 3D task Streams a Multi-Image to 3D task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Multi-Image to 3D task objects](#the-multi-image-to-3d-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/multi-image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/multi-image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/multi-image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```text // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 0, "status": "PENDING" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "multi-image-to-3d", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***", "pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "thumbnail_urls": { "front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***", "right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***", "back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***", "left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***" }, "texture_prompt": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 30 } ``` --- ## The Multi-Image to 3D task object A Multi-Image to 3D task object describes one generation of a 3D model from one to four images of an object. It holds the status, the progress, and the model files when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `multi-image-to-3d`. - `model_urls` · *object* Download URLs for the generated 3D model, one per file format. A format the task didn't generate has no key, rather than an empty string. - `glb` · *string* The GLB file. - `fbx` · *string* The FBX file. - `obj` · *string* The OBJ file. - `usdz` · *string* The USDZ file. - `mtl` · *string* The MTL file, returned with the OBJ file when the model has textures. - `stl` · *string* The STL file. - `3mf` · *string* The 3MF file. Present only when `target_formats` includes `3mf`. - `pre_remeshed_glb` · *string* The GLB file from before the remesh. Present only when you created the task with both `should_remesh: true` and `save_pre_remeshed_model: true`. - `thumbnail_url` · *string* Download URL for a preview image of the model. It's the same as `thumbnail_urls.front` when that field is present. - `alpha_thumbnail_url` · *string* Download URL for a version of `thumbnail_url` with a transparent background (RGBA). Present only when you created the task with `alpha_thumbnail: true` and Meshy rendered the transparent preview. - `thumbnail_urls` · *object* Download URLs for previews of the 3D model from four sides. Each is a signed URL to a 512×512 PNG, rendered with the same materials and lighting as `thumbnail_url`. You can use them to preview the model from several angles without downloading the GLB. Present only when you created the task with `multi_view_thumbnails: true` and the task reached `SUCCEEDED`. A task created without `multi_view_thumbnails: true` doesn't have this field. - `front` · *string* The front view, at 0° around the vertical axis. It matches `thumbnail_url`. - `right` · *string* The right view, at 90°. - `back` · *string* The back view, at 180°. - `left` · *string* The left view, at 270°. - `texture_prompt` · *string* The text prompt that guided the texture. - `texture_image_urls` · *string[]* Download URLs for the texture reference images you created the task with, in the order you sent them. Present only when you created the task with `texture_image_urls`. - `ultra_mode` · *boolean* · **deprecated** Read `geometry_resolution` instead. - `geometry_resolution` · *string* The Ultra tier the task ran, which is `2k`. A `standard` task doesn't have this field. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `expires_at` · *timestamp* Time the task's results expire, in Unix milliseconds. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `texture_urls` · *array* Download URLs for the texture maps the task generated, as an array of objects. It usually holds one object. Each object has these fields: - `base_color` · *string* The base color map. - `metallic` · *string* The metallic map. Not included when you created the task with `enable_pbr: false`. - `normal` · *string* The normal map. Not included when you created the task with `enable_pbr: false`. - `roughness` · *string* The roughness map. Not included when you created the task with `enable_pbr: false`. - `emission` · *string* The emission map. Included only when you created the task with all of these: * `ai_model: meshy-6`, with its default texture model * `enable_pbr: true` * a `texture_resolution` of `2k` or `4k` - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `task_error` · *object* The error details when the task fails. It's `null` unless the status is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **Example Multi-Image to 3D Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "multi-image-to-3d", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***", "pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "thumbnail_urls": { "front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***", "right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***", "back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***", "left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***" }, "texture_prompt": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX" } ], "preceding_tasks": 0, "task_error": null, "consumed_credits": 30 } ``` --- # Remesh API Source: https://docs.meshy.ai/api/remesh # Remesh API Rebuild a 3D model's mesh with a new topology and face count, and export it in the formats you choose. The model can come from another Meshy task, such as Image to 3D or Text to 3D, or from a model file. --- ## POST /openapi/v1/remesh -- Create a Remesh task Creates a Remesh task. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). > **Note:** To convert a model's format or resize it, use the [Convert API](/api/convert) or the [Resize API](/api/resize). The deprecated parameters on this page still work, but new integrations should use those endpoints. ### Parameters - `input_task_id` · *string* · **required** Required unless you send `model_url`. The ID of the task whose model you want to remesh, for example a Text to 3D, Image to 3D, Retexture, or Remesh task. The task must be one you created with the API and have the status `SUCCEEDED`. - `model_url` · *string* · **required** Required unless you send `input_task_id`. The model to remesh, as a public URL or a data URI. If you send both, Meshy uses `input_task_id`. The model must be a GLB, glTF, OBJ, FBX, or STL file of at most 400 MB from an `http` or `https` URL, or 100 MB as a data URI. For a data URI, use the MIME type `application/octet-stream`. A file over 100 MB must also follow these rules: * 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. - `target_formats` · *string[]* · default: `["glb"]` The file formats to generate. Available values: * `glb` * `fbx` * `obj` * `usdz` * `blend` * `stl` * `3mf` - `topology` · *string* · default: `triangle` The face type of the remeshed model. Available values: * `quad`: a quad-dominant mesh * `triangle`: a decimated triangle mesh - `target_polycount` · *integer* · default: `30000` The number of faces to aim for, from `100` to `300000`. The result can differ from the target, depending on the model's geometry. A value outside the range returns `400`. - `decimation_mode` · *integer* Adaptive face count, by level. When you set it, Meshy ignores `target_polycount`. Available values: * `1`: ultra * `2`: high * `3`: medium * `4`: low - `resize_height` · *number* · default: `0` · **deprecated** Use the [Resize API](/api/resize) instead. The height to resize the model to, in meters. Send at most one of `resize_height`, `resize_longest_side`, and `auto_size`. - `resize_longest_side` · *number* · default: `0` · **deprecated** Use the [Resize API](/api/resize) instead. The length to resize the longest side of the model's bounding box to, in meters. Send at most one of `resize_height`, `resize_longest_side`, and `auto_size`. - `auto_size` · *boolean* · default: `false` · **deprecated** Use the [Resize API](/api/resize) instead. Whether to estimate the object's real-world height with AI vision and resize the model to it. Send at most one of `resize_height`, `resize_longest_side`, and `auto_size`. - `origin_at` · *string* · default: `bottom` · **deprecated** Use the [Resize API](/api/resize) instead. Where to put the model's origin, `bottom` or `center`. The default applies when you send `resize_height`, `resize_longest_side`, or `auto_size`. Without one of them, Meshy moves the origin only if you send `origin_at`. - `convert_format_only` · *boolean* · **deprecated** Use the [Convert API](/api/convert) instead. Whether to only convert the model to `target_formats`. When `true`, Meshy ignores `topology`, `target_polycount`, `decimation_mode`, `resize_height`, `resize_longest_side`, and `auto_size`, but still checks their values, so an invalid value returns `400`. With `convert_format_only: true`, an empty or `null` `target_formats` returns `400`. - `alpha_thumbnail` · *boolean* · default: `false` Whether to also render a preview with a transparent background (RGBA), returned in `alpha_thumbnail_url` when you get the task. `thumbnail_url` doesn't change. ### Returns The `result` field of the response holds the ID of the new Remesh task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `model_url` nor `input_task_id` was sent. * **Invalid input task**: `input_task_id` isn't a successful API task, or its AI model doesn't support remeshing. * **Invalid model format**: The `model_url` file has an unsupported extension. * **Unreachable URL**: Meshy can't download the `model_url` file. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is over 100 MB and has more than 10,000,000 faces. Reduce the face count, then send the file again. * **ASCII FBX over 100 MB**: The `model_url` file is an ASCII FBX over 100 MB. Send it as binary FBX or GLB. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB or glTF, or a binary FBX older than 7.1. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. * **Invalid topology**: `topology` isn't `quad` or `triangle`. * **Mutually exclusive parameters**: The request has more than one of `auto_size`, `resize_height`, and `resize_longest_side`. Send only one. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` `input_task_id` is a bas-relief model, which this endpoint can't remesh. 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. Check the task ID, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Basic remesh with custom formats and resize curl https://api.meshy.ai/openapi/v1/remesh \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "target_formats": ["glb", "fbx"], "topology": "quad", "target_polycount": 50000, "resize_height": 1.0, "origin_at": "bottom" }' # Quad remesh with auto-size curl https://api.meshy.ai/openapi/v1/remesh \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "target_formats": ["glb", "fbx"], "topology": "quad", "target_polycount": 50000, "auto_size": true }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Basic remesh with custom formats and resize const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", target_formats: ["glb", "fbx"], topology: "quad", target_polycount: 50000, resize_height: 1.0, origin_at: "bottom" }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/remesh', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Quad remesh with auto-size const autoSizePayload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", target_formats: ["glb", "fbx"], topology: "quad", target_polycount: 50000, auto_size: true }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/remesh', autoSizePayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Basic remesh with custom formats and resize payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "target_formats": ["glb", "fbx"], "topology": "quad", "target_polycount": 50000, "resize_height": 1.0, "origin_at": "bottom" } response = requests.post( "https://api.meshy.ai/openapi/v1/remesh", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # Quad remesh with auto-size auto_size_payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "target_formats": ["glb", "fbx"], "topology": "quad", "target_polycount": 50000, "auto_size": True } response = requests.post( "https://api.meshy.ai/openapi/v1/remesh", headers=headers, json=auto_size_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9" } ``` --- ## GET /openapi/v1/remesh/:id -- Get a Remesh task Returns a Remesh task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Remesh task object](#the-remesh-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/remesh/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/remesh/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "remesh", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***", "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***", "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***" }, "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "task_error": null } ``` --- ## DELETE /openapi/v1/remesh/:id -- Delete a Remesh task Permanently deletes a Remesh task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/remesh/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/remesh/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/remesh -- List Remesh tasks Returns a list of your Remesh tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, up to `255`. A larger value returns `400`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Remesh task objects](#the-remesh-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/remesh?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/remesh?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/remesh", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "remesh", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***", "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***", "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***" }, "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "task_error": null } ] ``` --- ## GET /openapi/v1/remesh/:id/stream -- Stream a Remesh task Streams a Remesh task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Remesh task objects](#the-remesh-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "progress": 0, "status": "PENDING" } event: message data: { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "remesh", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***", "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***", "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***" }, "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "task_error": null, } ``` --- ## The Remesh task object A Remesh task object describes one remesh of a 3D model. It holds the status, the progress, and the model files when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `remesh`. - `model_urls` · *object* Download URLs for the remeshed model, one per file format. A format the task didn't generate has no key, rather than an empty string. - `glb` · *string* The GLB file. - `fbx` · *string* The FBX file. - `obj` · *string* The OBJ file. - `usdz` · *string* The USDZ file. - `blend` · *string* The Blender file. - `stl` · *string* The STL file. - `3mf` · *string* The 3MF file. Present only when `target_formats` includes `3mf`. - `thumbnail_url` · *string* Download URL for a preview image of the remeshed model. - `alpha_thumbnail_url` · *string* Download URL for a version of `thumbnail_url` with a transparent background (RGBA). Present only when you created the task with `alpha_thumbnail: true` and Meshy rendered the transparent preview. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's download URLs expire, in Unix milliseconds. It's `0` until the task finishes. - `texture_urls` · *array* Download URLs for the model's texture maps, when the task succeeds: an array of objects, one per texture set. Each object has a `base_color` URL, and can also have `metallic`, `roughness`, `normal`, `emission`, and `metallic_roughness` URLs. It's `null` until the task succeeds, and an empty array when the model has no texture maps. - `task_error` · *object* The error details when the task fails. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **Example Remesh Task Object** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "remesh", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***", "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***", "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***" }, "progress": 100, "status": "SUCCEEDED", "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "task_error": { "message": "" }, "consumed_credits": 5 } ``` --- # Convert API Source: https://docs.meshy.ai/api/convert # Convert API Convert a 3D model to other file formats, from a Meshy task or from a model file. --- ## POST /openapi/v1/convert -- Create a Convert task Creates a Convert task. The task runs in the background. 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, Resize, or Retexture task. The task must come from the API and have the status `SUCCEEDED`. - `model_url` · *string* · **required** Required unless you send `input_task_id`. The model to convert, as a public URL or a data URI. If you send both, Meshy uses `input_task_id`. The model must be a GLB, glTF, OBJ, FBX, or STL file of at most 400 MB from an `http` or `https` URL, or 100 MB as a data URI. For a data URI, use the MIME type `application/octet-stream`. A file over 100 MB must also follow these rules: * 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. - `target_formats` · *string[]* · **required** The file formats to generate. List at least one. A missing or empty list returns `400`. Available values: * `glb` * `fbx` * `obj` * `usdz` * `blend` * `stl` * `3mf` ### Returns The `result` field of the response holds the ID of the new Convert task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `model_url` nor `input_task_id` was sent. * **Missing `target_formats`**: `target_formats` is missing or lists no format. * **Invalid input task**: `input_task_id` isn't a successful API task with a model file. * **Invalid model format**: The `model_url` file has an unsupported extension. * **Unreachable URL**: Meshy can't download the `model_url` file. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is over 100 MB and has more than 10,000,000 faces. Reduce the face count, then send the file again. * **ASCII FBX over 100 MB**: The `model_url` file is an ASCII FBX over 100 MB. Send it as binary FBX or GLB. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB or glTF, or a binary FBX older than 7.1. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` `input_task_id` is a bas-relief model, which this endpoint can't convert. 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. Check the task ID, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). ```bash curl https://api.meshy.ai/openapi/v1/convert \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "target_formats": ["fbx", "stl"] }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", target_formats: ["fbx", "stl"] }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/convert', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "target_formats": ["fbx", "stl"] } response = requests.post( "https://api.meshy.ai/openapi/v1/convert", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9" } ``` --- ## GET /openapi/v1/convert/:id -- Get a Convert task Returns a Convert task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Convert task object](#the-convert-task-object). ```bash curl https://api.meshy.ai/openapi/v1/convert/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/convert/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/convert/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "convert", "model_urls": { "fbx": "https://assets.meshy.ai/.../model.fbx?Expires=...", "stl": "https://assets.meshy.ai/.../model.stl?Expires=..." }, "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "task_error": null, "consumed_credits": 1 } ``` --- ## DELETE /openapi/v1/convert/:id -- Delete a Convert task Permanently deletes a Convert task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/convert/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/convert/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/convert/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/convert -- List Convert tasks Returns a list of your Convert tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, up to `255`. A larger value returns `400`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Convert task objects](#the-convert-task-object). ```bash curl https://api.meshy.ai/openapi/v1/convert?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/convert?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/convert", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "convert", "model_urls": { "fbx": "https://assets.meshy.ai/.../model.fbx?Expires=...", "stl": "https://assets.meshy.ai/.../model.stl?Expires=..." }, "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "task_error": null, "consumed_credits": 1 } ] ``` --- ## GET /openapi/v1/convert/:id/stream -- Stream a Convert task Streams a Convert task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Convert task objects](#the-convert-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. ```bash curl -N https://api.meshy.ai/openapi/v1/convert/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/convert/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/convert/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // 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": "convert", "model_urls": { "fbx": "https://assets.meshy.ai/.../model.fbx?Expires=...", "stl": "https://assets.meshy.ai/.../model.stl?Expires=..." }, "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "task_error": null, "consumed_credits": 1 } ``` --- ## The Convert task object A Convert task object describes one format conversion of a 3D model. It holds the status, the progress, and the model files when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `convert`. - `model_urls` · *object* Download URLs for the converted model, one per file format. Only the formats in `target_formats` have URLs. A format you didn't request has no key, rather than an empty string. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's download URLs expire, in Unix milliseconds. It's `0` until the task finishes. - `texture_urls` · *array* Download URLs for the model's texture maps, when the task succeeds: an array of objects, one per texture set. Each object has a `base_color` URL, and can also have `metallic`, `roughness`, `normal`, `emission`, and `metallic_roughness` URLs. It's `null` until the task succeeds, and an empty array when the model has no texture maps. - `task_error` · *object* The error details when the task fails. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used, which is `1` for a Convert task. It's `0` for a `FAILED` task. --- # Resize API Source: https://docs.meshy.ai/api/resize # Resize API Resize a 3D model to a real-world size, in meters. Set its height or the length of its longest side, or have Meshy estimate the object's real-world height. --- ## POST /openapi/v1/resize -- Create a Resize task Creates a Resize task. The task runs in the background. 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 come from the API and have the status `SUCCEEDED`. Meshy returns the resized model as 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. If you send both, Meshy uses `input_task_id`. The model must be a GLB, glTF, OBJ, FBX, or STL file of at most 400 MB from an `http` or `https` URL, or 100 MB as a data URI. For a data URI, use the MIME type `application/octet-stream`. A file over 100 MB must also follow these rules: * 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. A GLB, OBJ, FBX, or STL file keeps its format in the result. A `.gltf` file or a data URI comes back as GLB. Send exactly one of `resize_height`, `resize_longest_side`, or `auto_size`. Sending none of them, or more than one, returns `400`. - `resize_height` · *number* The model's new height in meters, greater than 0. A negative value returns `400`. - `resize_longest_side` · *number* The new length of the model's longest side in meters, greater than 0. A negative value returns `400`. Meshy keeps the model's aspect ratio. - `auto_size` · *boolean* Whether to estimate the object's real-world height with AI vision and resize the model to it. Unless you set `origin_at`, Meshy puts the origin at the bottom. - `origin_at` · *string* · default: `bottom` Where to put the model's origin after resizing, `bottom` or `center`. ### Returns The `result` field of the response holds the ID of the new Resize task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `model_url` nor `input_task_id` was sent. * **Missing resize mode**: None of `resize_height`, `resize_longest_side`, and `auto_size` was sent. * **Mutually exclusive parameters**: The request has more than one of `resize_height`, `resize_longest_side`, and `auto_size`. Send only one. * **Negative size**: `resize_height` or `resize_longest_side` is negative. * **Invalid input task**: `input_task_id` isn't a successful API task with a model file. * **Invalid model format**: The `model_url` file has an unsupported extension. * **Unreachable URL**: Meshy can't download the `model_url` file. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is over 100 MB and has more than 10,000,000 faces. Reduce the face count, then send the file again. * **ASCII FBX over 100 MB**: The `model_url` file is an ASCII FBX over 100 MB. Send it as binary FBX or GLB. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB or glTF, or a binary FBX older than 7.1. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), 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. Check the task ID, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # 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" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Simple: resize to a specific height const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", resize_height: 1.8 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/resize', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Advanced: resize longest side with custom origin const advancedPayload = { model_url: "https://example.com/model.glb", resize_longest_side: 2.0, origin_at: "center" }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/resize', advancedPayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Simple: resize to a specific height payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "resize_height": 1.8 } response = requests.post( "https://api.meshy.ai/openapi/v1/resize", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # Advanced: resize longest side with custom origin advanced_payload = { "model_url": "https://example.com/model.glb", "resize_longest_side": 2.0, "origin_at": "center" } response = requests.post( "https://api.meshy.ai/openapi/v1/resize", headers=headers, json=advanced_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9" } ``` --- ## GET /openapi/v1/resize/:id -- Get a Resize task Returns a Resize task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Resize task object](#the-resize-task-object). ```bash curl https://api.meshy.ai/openapi/v1/resize/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/resize/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/resize/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "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 /openapi/v1/resize/:id -- Delete a Resize task Permanently deletes a Resize task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/resize/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/resize/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/resize/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/resize -- List Resize tasks Returns a list of your Resize tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, up to `255`. A larger value returns `400`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Resize task objects](#the-resize-task-object). ```bash curl https://api.meshy.ai/openapi/v1/resize?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/resize?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/resize", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "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 } ] ``` --- ## GET /openapi/v1/resize/:id/stream -- Stream a Resize task Streams a Resize task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Resize task objects](#the-resize-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. ```bash curl -N https://api.meshy.ai/openapi/v1/resize/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/resize/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/resize/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // 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 A Resize task object describes one resize of a 3D model. It holds the status, the progress, and the model file when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `resize`. - `model_urls` · *object* Download URL for the resized model file. For `input_task_id`, the file is always GLB. For `model_url`, a GLB, OBJ, FBX, or STL file keeps its format, and a `.gltf` file or a data URI comes back as GLB. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's download URLs expire, in Unix milliseconds. It's `0` until the task finishes. - `texture_urls` · *array* Download URLs for the model's texture maps, when the task succeeds: an array of objects, one per texture set. Each object has a `base_color` URL, and can also have `metallic`, `roughness`, `normal`, `emission`, and `metallic_roughness` URLs. It's `null` until the task succeeds, and an empty array when the model has no texture maps. - `task_error` · *object* The error details when the task fails. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used, which is `1` for a Resize task. It's `0` for a `FAILED` task. --- # UV Unwrap API Source: https://docs.meshy.ai/api/uv-unwrap # UV Unwrap API Generate a UV unwrap for an existing 3D model. Run it before you texture the model, or when a tool such as Blender, Substance Painter, or Unreal needs a clean, non-overlapping UV layout. The output is a UV white model. It has the same shape as the input, fresh UV coordinates, and no real texture. It includes a 2×2 grey placeholder material so that the glTF material slot stays valid, and standard tools treat it as untextured. UV Unwrap supports meshes of up to 40,000 faces. A larger model returns `400`. To reduce the face count, run [Remesh](/api/remesh) first. Meshy triangulates quad and n-gon meshes during UV generation, so the output is always a triangle mesh. --- ## POST /openapi/v1/uv-unwrap -- Create a UV Unwrap task Creates a UV Unwrap task. The task runs in the background. 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 Meshy API task whose GLB output you want to unwrap, for example an Image to 3D, Text to 3D, or Remesh task. The task must have the status `SUCCEEDED` and have produced a GLB file. The mesh can have at most 40,000 faces. A mesh with more returns `400`. To reduce the face count, run [Remesh](/api/remesh) first. - `model_url` · *string* · **required** Required unless you send `input_task_id`. The model to unwrap, as a public URL or a data URI. If you send both, Meshy uses `input_task_id`. The model must be a `.glb` file. To unwrap another format, convert it to GLB with the [Convert API](/api/convert) first. The file can be at most 400 MB from an `http` or `https` URL, or 100 MB as a data URI. For a data URI, use the MIME type `application/octet-stream`. A GLB over 100 MB must not use Draco compression. The same 40,000-face limit applies as for `input_task_id`. A mesh with more returns `400`, so run Remesh first. ### Returns The `result` field of the response holds the ID of the new UV Unwrap task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `input_task_id` nor `model_url` was sent. * **Invalid input task**: `input_task_id` isn't a successful API task with a GLB result. * **Face count exceeded**: The mesh has more faces than UV Unwrap allows. Run [Remesh](/api/remesh) first. * **Invalid model format**: The `model_url` file has an unsupported extension. * **Unreachable URL**: Meshy can't download the `model_url` file. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is over 100 MB and has more than 10,000,000 faces. Reduce the face count, then send the file again. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. A UV Unwrap task costs 5 credits. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` `input_task_id` is a bas-relief model, which this endpoint can't unwrap. 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. Check the task ID, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Chain from an existing Meshy task curl https://api.meshy.ai/openapi/v1/uv-unwrap \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "0193bfc5-ee4f-73f8-8525-44b398884ce9" }' # Or from a publicly accessible model URL curl https://api.meshy.ai/openapi/v1/uv-unwrap \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "model_url": "https://example.com/path/to/model.glb" }' ``` ```javascript import axios from 'axios'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { input_task_id: "0193bfc5-ee4f-73f8-8525-44b398884ce9" }; const { data } = await axios.post( "https://api.meshy.ai/openapi/v1/uv-unwrap", payload, { headers } ); console.log(data); // { result: "" } ``` ```python import requests response = requests.post( "https://api.meshy.ai/openapi/v1/uv-unwrap", headers={"Authorization": f"Bearer {YOUR_API_KEY}"}, json={"input_task_id": "0193bfc5-ee4f-73f8-8525-44b398884ce9"}, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019361c6-9b34-7b23-bef2-d0107c4d92e2" } ``` --- ## GET /openapi/v1/uv-unwrap/:id -- Get a UV Unwrap task Returns a UV Unwrap task's current state by its ID. ### Returns The [UV Unwrap task object](#the-uv-unwrap-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/uv-unwrap/019361c6-9b34-7b23-bef2-d0107c4d92e2 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios'; const taskId = '019361c6-9b34-7b23-bef2-d0107c4d92e2'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const { data } = await axios.get( `https://api.meshy.ai/openapi/v1/uv-unwrap/${taskId}`, { headers } ); ``` ```python import requests task_id = "019361c6-9b34-7b23-bef2-d0107c4d92e2" response = requests.get( f"https://api.meshy.ai/openapi/v1/uv-unwrap/{task_id}", headers={"Authorization": f"Bearer {YOUR_API_KEY}"}, ) response.raise_for_status() ``` For an example response, see the [example UV Unwrap task object](#example-uv-unwrap-task-object). --- ## DELETE /openapi/v1/uv-unwrap/:id -- Delete a UV Unwrap task Permanently deletes a UV Unwrap task, including its outputs. You can't undo a delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. **cURL** ```bash curl https://api.meshy.ai/openapi/v1/uv-unwrap/019361c6-9b34-7b23-bef2-d0107c4d92e2 \ -X DELETE \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` --- ## GET /openapi/v1/uv-unwrap -- List UV Unwrap tasks Returns a paginated list of your UV Unwrap tasks, newest first. To page through the list, use `page_num` and `page_size`. **cURL** ```bash curl "https://api.meshy.ai/openapi/v1/uv-unwrap?page_num=1&page_size=20" \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` --- ## GET /openapi/v1/uv-unwrap/:id/stream -- Stream a UV Unwrap task Streams a UV Unwrap task's updates as Server-Sent Events (SSE). Each `message` event carries a [UV Unwrap task object](#the-uv-unwrap-task-object). The stream closes when the task reaches `SUCCEEDED`, `FAILED`, or `CANCELED`. To learn sooner that the task finished, use this endpoint instead of polling `GET /openapi/v1/uv-unwrap/:id`. **cURL** ```bash curl https://api.meshy.ai/openapi/v1/uv-unwrap/019361c6-9b34-7b23-bef2-d0107c4d92e2/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -N ``` --- ## The UV Unwrap task object A UV Unwrap task object describes one UV unwrap of a 3D model. It holds the status, the progress, and the model file when the task succeeds. - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `uv-unwrap`. - `model_urls` · *object* Signed download URLs for the UV white model. UV Unwrap always returns a single `glb` key. The model keeps the input geometry, has fresh UV coordinates, and uses a default grey material instead of a texture. - `thumbnail_url` · *string* Signed download URL for a PNG preview image of the UV white model. - `progress` · *integer* How much of the task is done, as a percentage from `0` to `100`. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. Present while the task is `PENDING`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the signed download URLs expire, in Unix milliseconds. - `task_error` · *object* The error details when the task fails. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. A successful UV Unwrap task costs 5 credits. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **Example UV Unwrap Task Object** ```json { "id": "019361c6-9b34-7b23-bef2-d0107c4d92e2", "type": "uv-unwrap", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019361c6-9b34-7b23-bef2-d0107c4d92e2/output/model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019361c6-9b34-7b23-bef2-d0107c4d92e2/output/preview.png?Expires=***", "progress": 100, "status": "SUCCEEDED", "preceding_tasks": 0, "created_at": 1716579120000, "started_at": 1716579122000, "finished_at": 1716579180000, "expires_at": 1716665580000, "task_error": { "message": "" }, "consumed_credits": 5 } ``` --- # Rigging API Source: https://docs.meshy.ai/api/rigging # Rigging API Add a skeleton (armature) to a humanoid 3D model and bind the mesh to it, so the character is ready to animate. To apply animations to a rigged character, see the [Animation API](/api/animation). Rigging works well only with standard humanoid (bipedal) characters that have a clearly defined limb and body structure. --- ## POST /openapi/v1/rigging -- Create a Rigging task Creates a Rigging task for a 3D model. When the task succeeds, it returns a rigged character in standard formats and, optionally, basic walking and running animations. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). Rigging isn't suitable for these models: - Untextured meshes - Non-humanoid assets - Humanoid assets with an unclear limb and body structure ### Parameters - `input_task_id` · *string* · **required** Required unless you send `model_url`. The ID of the task whose model you want to rig. Meshy supports textured humanoid models. The model can have at most 380,000 triangles (a quad counts as 2), and a model with more returns `400`. To stay under the limit, run the [Remesh API](/api/remesh) on it first with a `target_polycount` of `300000` or less, or `150000` or less with `topology: quad`. - `model_url` · *string* · **required** Required unless you send `input_task_id`. The model to rig, as a public URL or a data URI. If you send both, Meshy uses `input_task_id`. The model must be a GLB (`.glb`) file of at most 400 MB from an `http` or `https` URL, or 100 MB as a data URI. Rigging supports textured humanoid models. The model can have at most 380,000 triangles (a quad counts as 2), and a model with more returns `400`. To stay under the limit, run the [Remesh API](/api/remesh) on it first with a `target_polycount` of `300000` or less, or `150000` or less with `topology: quad`. The character's face must point toward the +Z axis, the standard glTF forward direction. Pose estimation fails for a model that faces another axis. A file over 100 MB must also follow these rules: * It can have at most 10,000,000 faces. A file with more returns `400`. Meshy counts faces as triangles, and a mesh drawn more than once counts once per copy. * It must not use Draco compression. - `height_meters` · *number* · default: `1.7` The character's approximate height, in meters. Meshy uses it to scale and rig the model more accurately. A negative value returns `400`. - `texture_image_url` · *string* · **deprecated** Leave it out when the model has its own textures. Without it, Meshy uses the textures embedded in the `model_url` file, or the input task's textures. If you send it, this image becomes the rigged model's only texture, and the model loses its PBR maps. The model's UV-unwrapped base color texture, as a public URL or a data URI. The image must be a PNG file of at most 20 MB. Another image format returns `400`. ### Returns The `result` field of the response holds the ID of the new Rigging task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `model_url` nor `input_task_id` was sent. * **Invalid model format**: The `model_url` file has an unsupported extension. Only `.glb` is supported. * **Unreachable URL**: Meshy can't download the `model_url` file. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is over 100 MB and has more than 10,000,000 faces. Reduce the face count, then send the file again. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. * **Image too large**: The `texture_image_url` image is over 20 MB. * **Invalid texture format**: The `texture_image_url` image isn't a PNG file. * **Invalid height**: `height_meters` is negative. * **Invalid input task**: `input_task_id` doesn't refer to a valid API task. * **Input task not ready**: The `input_task_id` task hasn't reached `SUCCEEDED`. Wait until it succeeds, then retry. * **Face count exceeded**: The input model has more than 380,000 triangles (a quad counts as 2). Run the [Remesh API](/api/remesh) on it with a `target_polycount` of `300000` or less, or `150000` or less with `topology: quad`, before you rig the model. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` `input_task_id` is a bas-relief model, which this endpoint can't rig. The message is `This model type does not support this operation`. Send a different model. - `404 - Not Found` Meshy can't find the files of the `input_task_id` task. One of these applies: * Meshy deleted the task's files after its `expires_at`. Create the task again, then send that task's ID. * The task has none of the files rigging needs, such as a preview image, for example a Convert task. Rig the task it came from, or send the model as `model_url`. - `422 - Unprocessable Entity` Pose estimation failed. The model might not be a valid humanoid character. Send a model of a humanoid character. For `model_url`, also check that the character faces the +Z axis. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Rig a model from a URL curl https://api.meshy.ai/openapi/v1/rigging \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "model_url": "YOUR_MODEL_URL_OR_DATA_URI", "height_meters": 1.8 }' ``` ```javascript import axios from 'axios' // Rig a model from a URL const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { model_url: "YOUR_MODEL_URL_OR_DATA_URI", height_meters: 1.8 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/rigging', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests # Rig a model from a URL payload = { "model_url": "YOUR_MODEL_URL_OR_DATA_URI", "height_meters": 1.8 } headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.post( "https://api.meshy.ai/openapi/v1/rigging", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018b314a-a1b5-716d-c222-2f1776f7f579" } ``` --- ## GET /openapi/v1/rigging/:id -- Get a Rigging task Returns a Rigging task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Rigging task object](#the-rigging-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018b314a-a1b5-716d-c222-2f1776f7f579'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/rigging/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018b314a-a1b5-716d-c222-2f1776f7f579" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/rigging/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018b314a-a1b5-716d-c222-2f1776f7f579", "type": "rig", "status": "SUCCEEDED", "created_at": 1747032400453, "progress": 100, "started_at": 1747032401314, "finished_at": 1747032418417, "expires_at": 1747291618417, "task_error": null, "consumed_credits": 5, "result": { "rigged_character_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Character_output.fbx?Expires=...", "rigged_character_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Character_output.glb?Expires=...", "basic_animations": { "walking_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin.glb?Expires=...", "walking_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin.fbx?Expires=...", "walking_armature_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin_armature.glb?Expires=...", "running_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin.glb?Expires=...", "running_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin.fbx?Expires=...", "running_armature_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin_armature.glb?Expires=..." } } } ``` --- ## DELETE /openapi/v1/rigging/:id -- Delete a Rigging task Permanently deletes a Rigging task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018b314a-a1b5-716d-c222-2f1776f7f579' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/rigging/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018b314a-a1b5-716d-c222-2f1776f7f579" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/rigging/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/rigging -- List Rigging tasks Returns a paginated list of your Rigging tasks, newest first. To page through the list, use `page_num` and `page_size`. Tasks you create with the API stay in the API and don't appear in **My Assets** in the web app. To find a task whose ID you no longer have, use this endpoint. **cURL** ```bash curl "https://api.meshy.ai/openapi/v1/rigging?page_num=1&page_size=20" \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` --- ## GET /openapi/v1/rigging/:id/stream -- Stream a Rigging task Streams a Rigging task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Rigging task objects](#the-rigging-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } task_id = "018b314a-a1b5-716d-c222-2f1776f7f579" response = requests.get( f'https://api.meshy.ai/openapi/v1/rigging/{task_id}/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data_str = line.decode('utf-8')[5:] try: data = json.loads(data_str) print(data) if data.get('status') in ['SUCCEEDED', 'FAILED', 'CANCELED']: break except json.JSONDecodeError: print(f"Failed to decode JSON: {data_str}") response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "018b314a-a1b5-716d-c222-2f1776f7f579", "progress": 0, "status": "PENDING" } event: message data: { "id": "018b314a-a1b5-716d-c222-2f1776f7f579", "progress": 50, "status": "IN_PROGRESS" } event: message data: { // Example of a SUCCEEDED task event, with the same fields as the Rigging task object "id": "018b314a-a1b5-716d-c222-2f1776f7f579", "type": "rig", "status": "SUCCEEDED", "created_at": 1747032400453, "progress": 100, "started_at": 1747032401314, "finished_at": 1747032418417, "expires_at": 1747291618417, "task_error": null, "consumed_credits": 5, "result": { "rigged_character_fbx_url": "https://assets.meshy.ai/.../Character_output.fbx?...", "rigged_character_glb_url": "https://assets.meshy.ai/.../Character_output.glb?...", "basic_animations": { "walking_glb_url": "https://assets.meshy.ai/.../Animation_Walking_withSkin.glb?...", "walking_fbx_url": "https://assets.meshy.ai/.../Animation_Walking_withSkin.fbx?...", "walking_armature_glb_url": "https://assets.meshy.ai/.../Animation_Walking_withSkin_armature.glb?...", "running_glb_url": "https://assets.meshy.ai/.../Animation_Running_withSkin.glb?...", "running_fbx_url": "https://assets.meshy.ai/.../Animation_Running_withSkin.fbx?...", "running_armature_glb_url": "https://assets.meshy.ai/.../Animation_Running_withSkin_armature.glb?..." } } } ``` --- ## The Rigging task object A Rigging task object describes the rigging of one character. It holds the status, the progress, and the output files when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `rig`. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's result files expire, in Unix milliseconds. After this time, Meshy can delete the files. - `task_error` · *object* The error details when the task fails. It's `null` unless the status is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. - `result` · *object* The output file URLs. Until the task succeeds, each URL is an empty string, and `basic_animations` is `null`. - `rigged_character_fbx_url` · *string* Download URL for the rigged character as an FBX file. - `rigged_character_glb_url` · *string* Download URL for the rigged character as a GLB file. - `basic_animations` · *object (optional)* Download URLs for the default walking and running animations. - `walking_glb_url` · *string* The walking animation with skin, as a GLB file. - `walking_fbx_url` · *string* The walking animation with skin, as an FBX file. - `walking_armature_glb_url` · *string* The walking animation's armature, as a GLB file. - `running_glb_url` · *string* The running animation with skin, as a GLB file. - `running_fbx_url` · *string* The running animation with skin, as an FBX file. - `running_armature_glb_url` · *string* The running animation's armature, as a GLB file. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. The field is left out when the value is `0`. **Example Rigging Task Object** ```json { "id": "018b314a-a1b5-716d-c222-2f1776f7f579", "type": "rig", "status": "SUCCEEDED", "created_at": 1747032400453, "progress": 100, "started_at": 1747032401314, "finished_at": 1747032418417, "expires_at": 1747291618417, "task_error": null, "consumed_credits": 5, "result": { "rigged_character_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Character_output.fbx?Expires=...", "rigged_character_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Character_output.glb?Expires=...", "basic_animations": { "walking_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin.glb?Expires=...", "walking_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin.fbx?Expires=...", "walking_armature_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin_armature.glb?Expires=...", "running_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin.glb?Expires=...", "running_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin.fbx?Expires=...", "running_armature_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin_armature.glb?Expires=..." } } } ``` --- # Animation API Source: https://docs.meshy.ai/api/animation # Animation API Apply animations to rigged characters, and list the animations you can apply. --- ## POST /openapi/v1/animations -- Create an Animation task Creates an Animation task, which applies an animation to a character you rigged earlier. The animation can be one of the following: * A preset action from the animation library (`action_id`) * Several preset actions merged into one file (`action_ids`) * A motion clip you generated with the [Text to Motion API](/api/text-to-motion) (`motion_task_id`) You can also post-process the output. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). ### Parameters - `rig_task_id` · *string* · **required** The ID of the Rigging task whose character to animate, from `POST /openapi/v1/rigging`. The task must have the status `SUCCEEDED`. Send exactly one of `action_id`, `action_ids`, and `motion_task_id`. - `action_id` · *integer* · **required** Required unless you send `action_ids` or `motion_task_id`. The ID of the preset animation to apply. For the full list of animations, see the [Animation Library reference](/api/animation-library) or [List animations](#list-animations). - `action_ids` · *array of integers* · **required** Required unless you send `action_id` or `motion_task_id`. The IDs of 1 to 10 preset animations to apply at once, with no repeats. More than 10 IDs, or a repeated ID, returns `400`. For the IDs, see the [Animation Library reference](/api/animation-library). Meshy returns one file with one animation clip per action, which suits a state machine in a game engine. Meshy charges for each action in the list. See [Pricing](/api/pricing). A list with one ID works the same as sending that ID as `action_id`. - `motion_task_id` · *string* · **required** Required unless you send `action_id` or `action_ids`. The ID of a [Text to Motion](/api/text-to-motion) task whose clip to apply instead of a preset action. The task must have the status `SUCCEEDED`, and the rig must be a biped. Meshy retargets the clip onto the rigged character. It copies the clip when you create this task, so this task isn't affected if the Text to Motion task later expires or you delete it. Meshy keeps the Text to Motion task's files for 3 days, so apply the clip before then. - `post_process` · *object* Post-processing for the animation output. Leave it out to get the standard animation files. With `motion_task_id`, the retarget can produce a GLB-only animation. If you send `post_process` and no FBX file is available, the task fails with a `task_error`, and Meshy refunds your credits. Without `post_process`, the task succeeds, and `animation_fbx_url` is empty. **Only when `post_process` is set:** - `operation_type` · *string* The operation to run. Without it, Meshy makes no extra file. A value not in the following list returns `400`. Available values: * `change_fps`: changes the frame rate to `fps` * `fbx2usdz`: converts the animation to USDZ * `extract_armature`: extracts the armature as an FBX file - `fps` · *integer* · default: `30` The frame rate to change to, one of `24`, `25`, `30`, or `60`. Applies only when `operation_type` is `change_fps`. Any other value returns `400`. > **Note:** With `action_ids`, the task returns one merged file instead of one file per action. `animation_glb_url` and `animation_fbx_url` each point at one file that holds every requested action as a separate clip. In that file: > > * **Clip order**: the order of the `action_ids` array, not the numeric order of the IDs. > * **Clip names**: the animation's name in the library. These match the names you get when you export all of a character's animations as one file from the Meshy web app. If two requested IDs have the same clip name, Meshy adds the `action_id` to the later one to keep names unique. > * **Post-processing**: Meshy applies it to the merged file, not to each clip. ### Returns The `result` field of the response holds the ID of the new Animation task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: `rig_task_id` is missing, or none of `action_id`, `action_ids`, and `motion_task_id` was sent. * **Conflicting parameters**: The request has more than one of `action_id`, `action_ids`, and `motion_task_id`. Send only one. * **Invalid rig task**: `rig_task_id` isn't a valid task ID, isn't a Rigging task, or points to a task that hasn't succeeded. * **Invalid action ID**: An `action_id`, or an entry in `action_ids`, isn't a valid animation. * **Too many actions**: `action_ids` has more than 10 IDs. * **Duplicate actions**: `action_ids` has the same ID more than once. * **Motion task not ready**: The `motion_task_id` task hasn't reached `SUCCEEDED` yet. * **Unsupported rig**: `motion_task_id` needs a biped rig, and Meshy rejects a quadruped rig. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` The `rig_task_id` task is a bas-relief model, which this endpoint can't animate. The message is `This model type does not support this operation`. Rig a different model. - `404 - Not Found` Meshy can't find a task or file the request needs. One of these applies: * Meshy can't find the `rig_task_id` task among your tasks. Check the ID. * Meshy deleted the `rig_task_id` task's files after its `expires_at`. Rig the character again. * Meshy can't find the `motion_task_id` task. Check the ID. * The motion clip expired, because Meshy keeps a Text to Motion task's files for 3 days. Create another Text to Motion task. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Animate a rigged model with required params only curl https://api.meshy.ai/openapi/v1/animations \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579", "action_id": 92 }' # Apply several preset actions and get one file with one clip per action curl https://api.meshy.ai/openapi/v1/animations \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579", "action_ids": [10, 25, 92] }' # Apply a generated Text to Motion clip instead of a preset action curl https://api.meshy.ai/openapi/v1/animations \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579", "motion_task_id": "018c425b-b2c6-727e-d333-3c1887i9h791" }' # With post-processing to change FPS curl https://api.meshy.ai/openapi/v1/animations \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579", "action_id": 92, "post_process": { "operation_type": "change_fps", "fps": 24 } }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Animate a rigged model with required params only const payload = { rig_task_id: "018b314a-a1b5-716d-c222-2f1776f7f579", action_id: 92 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/animations', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Apply several preset actions and get one file with one clip per action const multiActionPayload = { rig_task_id: "018b314a-a1b5-716d-c222-2f1776f7f579", action_ids: [10, 25, 92] }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/animations', multiActionPayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // With post-processing to change FPS const advancedPayload = { rig_task_id: "018b314a-a1b5-716d-c222-2f1776f7f579", action_id: 92, post_process: { operation_type: "change_fps", fps: 24 } }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/animations', advancedPayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Animate a rigged model with required params only payload = { "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579", "action_id": 92 } response = requests.post( "https://api.meshy.ai/openapi/v1/animations", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # Apply several preset actions and get one file with one clip per action multi_action_payload = { "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579", "action_ids": [10, 25, 92] } response = requests.post( "https://api.meshy.ai/openapi/v1/animations", headers=headers, json=multi_action_payload, ) response.raise_for_status() print(response.json()) # With post-processing to change FPS advanced_payload = { "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579", "action_id": 92, "post_process": { "operation_type": "change_fps", "fps": 24 } } response = requests.post( "https://api.meshy.ai/openapi/v1/animations", headers=headers, json=advanced_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018c425b-b2c6-727e-d333-3c1887i9h791" } ``` --- ## GET /openapi/v1/animations/:id -- Get an Animation task Returns an Animation task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Animation task object](#the-animation-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018c425b-b2c6-727e-d333-3c1887i9h791'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/animations/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018c425b-b2c6-727e-d333-3c1887i9h791" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/animations/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "type": "animate", "status": "SUCCEEDED", "created_at": 1747032440896, "progress": 100, "started_at": 1747032441210, "finished_at": 1747032457530, "expires_at": 1747291657530, "task_error": null, "consumed_credits": 3, "result": { "animation_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/Animation_Reaping_Swing_withSkin.glb?Expires=...", "animation_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/Animation_Reaping_Swing_withSkin.fbx?Expires=...", "processed_usdz_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed.usdz?Expires=...", "processed_armature_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed_armature.fbx?Expires=...", "processed_animation_fps_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed_60fps.fbx?Expires=..." } } ``` --- ## DELETE /openapi/v1/animations/:id -- Delete an Animation task Permanently deletes an Animation task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/animations/018b314a-a1b5-716d-c222-2f1776f7f579 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018b314a-a1b5-716d-c222-2f1776f7f579' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/animations/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018b314a-a1b5-716d-c222-2f1776f7f579" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/animations/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/animations -- List Animation tasks Returns a paginated list of your Animation tasks, newest first. To page through the list, use `page_num` and `page_size`. Tasks you create through the API don't appear in **My Assets** in the web app, so you manage them through the API. To find a task whose ID you no longer have, use this endpoint. **cURL** ```bash curl "https://api.meshy.ai/openapi/v1/animations?page_num=1&page_size=20" \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` --- ## GET /openapi/v1/animations/:id/stream -- Stream an Animation task Streams an Animation task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Animation task objects](#the-animation-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } task_id = "018c425b-b2c6-727e-d333-3c1887i9h791" response = requests.get( f'https://api.meshy.ai/openapi/v1/animations/{task_id}/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data_str = line.decode('utf-8')[5:] try: data = json.loads(data_str) print(data) if data.get('status') in ['SUCCEEDED', 'FAILED', 'CANCELED']: break except json.JSONDecodeError: print(f"Failed to decode JSON: {data_str}") response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "progress": 0, "status": "PENDING" } event: message data: { "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "progress": 50, "status": "IN_PROGRESS" } event: message data: { // Example of a SUCCEEDED task stream item, with the same structure as the Animation task object "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "type": "animate", "status": "SUCCEEDED", "created_at": 1747032440896, "progress": 100, "started_at": 1747032441210, "finished_at": 1747032457530, "expires_at": 1747291657530, "task_error": null, "consumed_credits": 3, "result": { "animation_glb_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.glb?...", "animation_fbx_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.fbx?...", "processed_usdz_url": "https://assets.meshy.ai/.../processed.usdz?...", "processed_armature_fbx_url": "https://assets.meshy.ai/.../processed_armature.fbx?...", "processed_animation_fps_fbx_url": "https://assets.meshy.ai/.../processed_60fps.fbx?..." } } ``` --- ## The Animation task object An Animation task object describes one animation applied to a rigged character. It holds the status, the progress, and the animation files when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `animate`. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's result files expire, in Unix milliseconds. - `task_error` · *object* The error details when the task fails. It's `null` unless the status is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. - `result` · *object* Download URLs for the animation files, when the task has the status `SUCCEEDED`. - `animation_glb_url` · *string* The animation as a GLB file. For a task created with `action_ids`, this one file holds every requested action as a separate clip. - `animation_fbx_url` · *string* The animation as an FBX file. For a task created with `action_ids`, this one file holds every requested action as a separate clip. - `processed_usdz_url` · *string* The processed animation as a USDZ file. - `processed_armature_fbx_url` · *string* The processed armature as an FBX file. - `processed_animation_fps_fbx_url` · *string* The animation at the changed frame rate, as an FBX file, for example when you used the `change_fps` operation. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. The field is left out when the value is `0`. **Example Animation Task Object** ```json { "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "type": "animate", "status": "SUCCEEDED", "created_at": 1747032440896, "progress": 100, "started_at": 1747032441210, "finished_at": 1747032457530, "expires_at": 1747291657530, "task_error": null, "consumed_credits": 3, "result": { "animation_glb_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.glb?...", "animation_fbx_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.fbx?...", "processed_usdz_url": "https://assets.meshy.ai/.../processed.usdz?...", "processed_armature_fbx_url": "https://assets.meshy.ai/.../processed_armature.fbx?...", "processed_animation_fps_fbx_url": "https://assets.meshy.ai/.../processed_60fps.fbx?..." } } ``` --- ## GET /openapi/v1/animations/library -- List animations Returns every animation in the library, ordered by `action_id`. The response is the complete list, with no pages, so one call can fill an action picker. Filters narrow the result. To get every animation, leave them all out. To browse the same list with an animated preview of each action, see the [Animation Library reference](/api/animation-library). This request costs no credits. ### Parameters - `search` · *string* Text to search for. Meshy returns the animations whose `name` or `key` contains this text, ignoring case. Meshy matches the text literally, so `%` and `_` aren't wildcards. - `category` · *string* The category to list, as an exact match. An unknown category returns an empty list. Available values: * `WalkAndRun` * `BodyMovements` * `DailyActions` * `Fighting` * `Dancing` - `sub_category` · *string* The subcategory to list, as an exact match. You can send it without `category`. Subcategory names aren't unique across categories. For example, `Transitioning` is under both `Fighting` and `DailyActions`. So without `category`, the filter matches the subcategory in every category. - `action_ids` · *string* The animations to return, as up to 200 comma-separated `action_id` values. Use it to look up specific IDs instead of browsing. More than 200 IDs returns `400`. The response leaves out an ID that no animation has. So you can also use this filter to check whether IDs you stored are still available. ### Combining filters Meshy applies the filters together. Each one narrows the result, so Meshy returns an animation only if it matches all of them. Within one filter, any of its values can match. For example, `search` matches `name` or `key`, and `action_ids` matches any ID in the list. So a combination with no overlap returns an empty array, not an error. Action `92` is "Double Combo Attack", a `Fighting` animation. For example: * `?action_ids=92&category=Fighting` returns action `92`. * `?action_ids=92&category=Dancing` returns `[]`, because it isn't a `Dancing` animation. * `?action_ids=92&search=walk` returns `[]`, because its name doesn't match `walk`. To get specific animations in any category, send `action_ids` on its own. ### Returns A list of [animation objects](#the-animation-object). > **Note:** [Create an Animation task](#create-an-animation-task) accepts every `action_id` this endpoint returns, and this endpoint returns every ID that create accepts. Neither includes retired animations. If you cache the library, refresh it from time to time, so a retired ID doesn't stay in your picker. **cURL** ```bash curl "https://api.meshy.ai/openapi/v1/animations/library?category=Fighting" \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios'; const headers = {Authorization: `Bearer ${YOUR_API_KEY}`}; try { const response = await axios.get( 'https://api.meshy.ai/openapi/v1/animations/library', { headers, params: {category: 'Fighting'}, } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/animations/library", headers=headers, params={"category": "Fighting"}, ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "action_id": 4, "name": "Attack", "key": "Attack", "category": "Fighting", "sub_category": "AttackingwithWeapon", "preview_url": "https://cdn.meshy.ai/webapp-assets/feature-demo/animation/preview/biped/Attack.gif" }, { "action_id": 92, "name": "Double Combo Attack", "key": "Double_Combo_Attack", "category": "Fighting", "sub_category": "AttackingwithWeapon", "preview_url": "https://cdn.meshy.ai/webapp-assets/feature-demo/animation/preview/biped/Double_Combo_Attack.gif" } ] ``` --- ## The animation object An animation object describes one animation in the library. - `action_id` · *integer* The value to send as `action_id` when you create an Animation task. It's unique and stable, but not contiguous. Retired animations leave gaps in the numbering, so don't assume that every ID in a range is valid. - `name` · *string* The animation's display name. It isn't unique, because some animations share a name with another variant. To identify an animation, use `action_id` or `key`. - `key` · *string* A unique, stable slug for the animation. Use it when you need a non-numeric ID to key your own storage on. - `category` · *string* The top-level group, for example `Fighting`. - `sub_category` · *string* The group within the category, for example `AttackingwithWeapon`. - `preview_url` · *string* URL of an animated GIF preview of the action. You can show it directly in your own picker. **Example Animation Object** ```json { "action_id": 92, "name": "Double Combo Attack", "key": "Double_Combo_Attack", "category": "Fighting", "sub_category": "AttackingwithWeapon", "preview_url": "https://cdn.meshy.ai/webapp-assets/feature-demo/animation/preview/biped/Double_Combo_Attack.gif" } ``` --- # Text to Motion API Source: https://docs.meshy.ai/api/text-to-motion # Text to Motion API Generate character motion clips from text descriptions. Describe an action, such as "a character waving" or "a zombie shambling forward", and get a raw motion clip. You can retarget the clip onto rigged characters in your own pipeline or DCC tools. The output is a standalone motion clip. It doesn't need a character model, and it isn't attached to one. To rig a character first, see the [Rigging API](/api/rigging). To apply a clip to your rigged character, send the task `id` as `motion_task_id` to the [Animation API](/api/animation#create-an-animation-task). --- ## POST /openapi/v1/text-to-motion -- Create a Text to Motion task Creates a Text to Motion task, which generates a motion clip from a text prompt. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). A `prime` task costs 10 credits and uses Meshy's higher-quality motion model. A `swift` task costs 3 credits and uses a faster, lower-cost motion model. ### Parameters - `prompt` · *string* · **required** Text that describes the motion to generate, up to 400 characters. Longer text returns `400`. - `mode` · *string* · default: `prime` The motion model, which also sets the clip's file format. Available values: * `prime`: higher quality, returns an FBX clip * `swift`: faster and cheaper, returns a BVH clip Any other value returns `400`. - `duration` · *number* · **required** The target clip length in seconds, from `2` to `10` in steps of `0.5`, for example `2`, `2.5`, or `3`. Any other value returns `400`. ### Returns The `result` field of the response holds the ID of the new Text to Motion task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing or empty prompt**: `prompt` is missing, blank, or longer than 400 characters. * **Invalid mode**: `mode` isn't `prime` or `swift`. * **Invalid duration**: `duration` is missing, outside the range `2` to `10`, or not on a `0.5` second step. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` Content moderation flagged the prompt. Change the prompt, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Generate a motion clip with required params only curl https://api.meshy.ai/openapi/v1/text-to-motion \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "prompt": "a character waving", "duration": 3 }' # Generate a fast, economical clip with Swift mode curl https://api.meshy.ai/openapi/v1/text-to-motion \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "prompt": "a character waving", "mode": "swift", "duration": 4.5 }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Generate a motion clip with required params only const payload = { prompt: "a character waving", duration: 3 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/text-to-motion', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Generate a fast, economical clip with Swift mode const swiftPayload = { prompt: "a character waving", mode: "swift", duration: 4.5 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/text-to-motion', swiftPayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Generate a motion clip with required params only payload = { "prompt": "a character waving", "duration": 3 } response = requests.post( "https://api.meshy.ai/openapi/v1/text-to-motion", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # Generate a fast, economical clip with Swift mode swift_payload = { "prompt": "a character waving", "mode": "swift", "duration": 4.5 } response = requests.post( "https://api.meshy.ai/openapi/v1/text-to-motion", headers=headers, json=swift_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018c425b-b2c6-727e-d333-3c1887i9h791" } ``` --- ## GET /openapi/v1/text-to-motion/:id -- Get a Text to Motion task Returns a Text to Motion task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Text to Motion task object](#the-text-to-motion-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/text-to-motion/018c425b-b2c6-727e-d333-3c1887i9h791 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018c425b-b2c6-727e-d333-3c1887i9h791'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/text-to-motion/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018c425b-b2c6-727e-d333-3c1887i9h791" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/text-to-motion/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "type": "text-to-motion", "status": "SUCCEEDED", "progress": 100, "created_at": 1787314497437, "started_at": 1787314498012, "finished_at": 1787314505881, "expires_at": 1787573705881, "task_error": null, "result": { "motion_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/clip.fbx?Expires=...", "motion_format": "fbx", "duration_ms": 3000, "mode": "prime" }, "consumed_credits": 10 } ``` --- ## GET /openapi/v1/text-to-motion -- List Text to Motion tasks Returns a paginated list of your Text to Motion tasks, newest first. To page through the list, use `page_num` and `page_size`. The response is an array of [Text to Motion task objects](#the-text-to-motion-task-object). Tasks you create with the API stay in the API and don't appear in **My Assets** in the web app. To find a task whose ID you no longer have, use this endpoint. **cURL** ```bash curl "https://api.meshy.ai/openapi/v1/text-to-motion?page_num=1&page_size=20" \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` **Response** ```json [ { "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "type": "text-to-motion", "status": "SUCCEEDED", "...": "..." } ] ``` --- ## GET /openapi/v1/text-to-motion/:id/stream -- Stream a Text to Motion task Streams a Text to Motion task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Text to Motion task objects](#the-text-to-motion-task-object) as Server-Sent Events. Every `message` event carries the full task object. While the task is `PENDING` or `IN_PROGRESS`, the `result` fields are empty (`""` or `0`), and `finished_at` and `expires_at` are `0`. To follow the task, watch `status` and `progress`. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/text-to-motion/018c425b-b2c6-727e-d333-3c1887i9h791/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/text-to-motion/018c425b-b2c6-727e-d333-3c1887i9h791/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } task_id = "018c425b-b2c6-727e-d333-3c1887i9h791" response = requests.get( f'https://api.meshy.ai/openapi/v1/text-to-motion/{task_id}/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data_str = line.decode('utf-8')[5:] try: data = json.loads(data_str) print(data) if data.get('status') in ['SUCCEEDED', 'FAILED', 'CANCELED']: break except json.JSONDecodeError: print(f"Failed to decode JSON: {data_str}") response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message events carry the full task object at every stage; the result // fields stay empty until the task succeeds. event: message data: { "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "type": "text-to-motion", "status": "IN_PROGRESS", "progress": 50, "created_at": 1787314497437, "started_at": 1787314498012, "finished_at": 0, "expires_at": 0, "task_error": null, "result": { "motion_url": "", "motion_format": "", "duration_ms": 0, "mode": "" }, "consumed_credits": 10 } event: message data: { // Example of a SUCCEEDED task event, with the same fields as the Text to Motion task object "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "type": "text-to-motion", "status": "SUCCEEDED", "progress": 100, "created_at": 1787314497437, "started_at": 1787314498012, "finished_at": 1787314505881, "expires_at": 1787573705881, "task_error": null, "result": { "motion_url": "https://assets.meshy.ai/.../output/clip.fbx?Expires=...", "motion_format": "fbx", "duration_ms": 3000, "mode": "prime" }, "consumed_credits": 10 } ``` --- ## DELETE /openapi/v1/text-to-motion/:id -- Delete a Text to Motion task Permanently deletes a Text to Motion task, including its motion clip. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/text-to-motion/018c425b-b2c6-727e-d333-3c1887i9h791 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018c425b-b2c6-727e-d333-3c1887i9h791' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/text-to-motion/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018c425b-b2c6-727e-d333-3c1887i9h791" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/text-to-motion/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## The Text to Motion task object A Text to Motion task object describes the generation of one motion clip. It holds the status, the progress, and the clip when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `text-to-motion`. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `progress` · *integer* How much of the task is done, as a percentage from `0` to `100`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's result files expire, in Unix milliseconds. It's `0` until the task finishes. Meshy keeps the clip for 3 days after the task finishes, so download it before then. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. The field is left out when the value is `0`. - `consumed_credits` · *integer* The number of credits the task used, `10` for `prime` mode or `3` for `swift` mode. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. - `task_error` · *object* The error details when the task fails, and `null` otherwise. See [Errors](/api/errors#task-errors). - `result` · *object* The generated motion clip when the task succeeds. Until then, the fields are present but empty (`""` or `0`). - `motion_url` · *string* Download URL for the motion clip. Meshy signs the URL again on every read, and it expires with the task's retention window. - `motion_format` · *string* The clip's file format, `fbx` for `prime` mode or `bvh` for `swift` mode. - `duration_ms` · *integer* The clip length, in milliseconds. - `mode` · *string* The mode Meshy used to generate the clip, `prime` or `swift`. **Example Text to Motion Task Object** ```json { "id": "018c425b-b2c6-727e-d333-3c1887i9h791", "type": "text-to-motion", "status": "SUCCEEDED", "progress": 100, "created_at": 1787314497437, "started_at": 1787314498012, "finished_at": 1787314505881, "expires_at": 1787573705881, "task_error": null, "result": { "motion_url": "https://assets.meshy.ai/.../output/clip.fbx?Expires=...", "motion_format": "fbx", "duration_ms": 3000, "mode": "prime" }, "consumed_credits": 10 } ``` --- # Retexture API Source: https://docs.meshy.ai/api/retexture # Retexture API Generate new textures for an existing 3D model from a text prompt or reference images. The model can come from another Meshy task or from a model file. --- ## POST /openapi/v1/retexture -- Create a Retexture task Creates a Retexture task. The task runs in the background. 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 to texture, 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`. Meshy textures the task's GLB. With `meshy-n1`, the task's model can have at most 7,999,999 faces, counted as triangles (a quad counts as 2). - `model_url` · *string* · **required** Required unless you send `input_task_id`. The model to texture, as a public URL or a data URI. If you send both, Meshy uses `input_task_id`. The model must be a GLB, glTF, OBJ, FBX, or STL file of at most 400 MB from an `http` or `https` URL, or 100 MB as a data URI. For a data URI, use the MIME type `application/octet-stream`, for example `data:application/octet-stream;base64,`. A file over 100 MB must also follow these rules: * 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. With `meshy-n1`, the model can have at most 7,999,999 faces, counted as triangles (a quad counts as 2), whatever its file size. Send one of these three style inputs. - `text_style_prompt` · *string* · **required** Required unless you send `image_style_url` or `multiview_image_urls`. Text that describes the texture you want, up to 800 characters. Longer text returns `400`. With `meshy-n1`, sending it without `image_style_url` returns `400`. - `image_style_url` · *string* · **required** Required unless you send `text_style_prompt` or `multiview_image_urls`. A 2D image whose style the texture follows, as a public URL or a data URI (`data:image/jpeg;base64,`). If you send both `text_style_prompt` and `image_style_url`, Meshy uses `image_style_url`. The image must be a `.jpg`, `.jpeg`, `.png`, or `.webp` file of at most 20 MB, and at least 32 pixels on each side. The texture might not fit well when the object in the image has a very different shape from the model. With `meshy-n1`, Meshy treats the image as the front view. - `multiview_image_urls` · *string[]* · **required** Required unless you send `text_style_prompt` or `image_style_url`. One to four images of the same object from different views. The first image is the main (front) view. The order of the other views (left, back, right) doesn't matter. An empty array, or more than four images, returns `400`. Each image follows the same format and size rules as `image_style_url`, at most 20 MB per image. You can't combine `multiview_image_urls` with `text_style_prompt` or `image_style_url`. `multiview_image_urls` needs an explicit `ai_model` of `meshy-7` or `meshy-n1`. Any other `ai_model`, including the default `latest`, returns `400`. - `ai_model` · *string* · default: `latest` The AI model that generates the texture. Available values: * `meshy-6-lite` * `meshy-6` * `meshy-7` * `meshy-n1`: a 2K base color texture from reference images only. No text prompt, no PBR maps, no 4K or 8K. Up to 7,999,999 faces. * `latest`: Meshy 7 - `enable_original_uv` · *boolean* · default: `false` Whether to keep the model's UV layout instead of generating a new one. * For a model Meshy generated, from `input_task_id` or a `model_url` that points to a Meshy output, use `true` to reuse its optimized UV layout. * For a model you uploaded from elsewhere, use `true` to keep UVs that are already good. Leave it `false` to let Meshy generate new UVs, which suits a model without proper UV mapping. - `enable_pbr` · *boolean* · default: `false` Whether to also generate PBR maps (metallic, roughness, and normal) with the base color. With `meshy-6`, Meshy also generates an emission map, except at a `texture_resolution` of `8k`. `meshy-6-lite`, `meshy-7`, and `latest` don't generate an emission map. With `meshy-n1`, `true` returns `400`. - `texture_resolution` · *string* · default: `2k` The size of the base color texture. Higher resolutions capture more surface detail. Available values: * `2k`: 2048 × 2048 pixels * `4k`: 4096 × 4096 pixels * `8k`: 8192 × 8192 pixels `4k` and `8k` need an `ai_model` of `meshy-6`, `meshy-7`, or `latest`. With `meshy-6-lite` or `meshy-n1`, they return `400`. At `8k`, Meshy doesn't generate an emission map. - `hd_texture` · *boolean* · default: `false` · **deprecated** Use `texture_resolution` instead. `true` is the same as `texture_resolution: "4k"`. If you send both, Meshy uses `texture_resolution`. - `remove_lighting` · *boolean* · default: `true` Whether to remove highlights and shadows from the base color texture. The result works better under your own lighting. Meshy applies it only with `meshy-6`, at a `texture_resolution` of `2k` or `4k`. With `meshy-7` or `latest`, or at `8k`, Meshy accepts it and ignores it. With `meshy-6-lite` or `meshy-n1`, sending it with any value returns `400`. - `target_formats` · *string[]* The file formats to generate. Meshy generates only the formats you list, which can shorten the task. If you leave it out, Meshy generates every format except `3mf`. Available values: * `glb` * `obj` * `fbx` * `stl` * `usdz` * `3mf` - `alpha_thumbnail` · *boolean* · default: `false` Whether to also render a preview with a transparent background (RGBA), returned in `alpha_thumbnail_url` when you get the task. `thumbnail_url` doesn't change. ### Returns The `result` field of the response holds the ID of the new Retexture task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `model_url` nor `input_task_id` was sent. * **Missing style**: None of `text_style_prompt`, `image_style_url`, and `multiview_image_urls` was sent. * **Conflicting style inputs**: `multiview_image_urls` was sent with `text_style_prompt` or `image_style_url`. * **Unsupported model for multi-view**: `multiview_image_urls` was sent without an explicit `ai_model` of `meshy-7` or `meshy-n1`. * **Unsupported option for Meshy N1**: `meshy-n1` was sent with `enable_pbr: true`, `remove_lighting`, a `texture_resolution` of `4k` or `8k`, `hd_texture: true` without `texture_resolution`, or `text_style_prompt` without `image_style_url`. * **Too many triangles for Meshy N1**: With `meshy-n1`, the 3D model has more than 7,999,999 triangles. Reduce the triangle count, or use another `ai_model`. * **Model too complex for Meshy N1**: With `meshy-n1`, the `model_url` file is too complex for Meshy to count its triangles. Reduce the triangle count, then send the file again. * **Triangle count timed out**: With `meshy-n1`, counting the triangles of the `model_url` file took too long. Retry, or reduce the model's size. * **Invalid input task**: `input_task_id` isn't a successful task of a supported type. * **Invalid model format**: The `model_url` file has an unsupported extension. * **Unreachable URL**: Meshy can't download the `model_url` file, the `image_style_url` image, or a `multiview_image_urls` image. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is over 100 MB and has more than 10,000,000 faces. Reduce the face count, then send the file again. * **ASCII FBX over 100 MB**: The `model_url` file is an ASCII FBX over 100 MB. Send it as binary FBX or GLB. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB or glTF, or a binary FBX older than 7.1. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. * **Image too large**: The `image_style_url` image or a `multiview_image_urls` image is over 20 MB. With `meshy-n1`, a model that Meshy can't check before the task starts, such as an STL file, isn't refused here. If it has more than 7,999,999 triangles, the task fails, and Meshy refunds its credits. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` One of these applies: * Content moderation blocked the prompt or an input image. Change the input, then retry. * `input_task_id` is a bas-relief model, which this endpoint can't retexture. 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. Check the task ID, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Retexture with text prompt curl https://api.meshy.ai/openapi/v1/retexture \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "model_url": "https://cdn.meshy.ai/model/example_model_2.glb", "text_style_prompt": "red fangs, Samurai outfit that fused with japanese batik style", "enable_original_uv": true, "enable_pbr": true }' # Retexture with image style and PBR curl https://api.meshy.ai/openapi/v1/retexture \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "model_url": "https://cdn.meshy.ai/model/example_model_2.glb", "image_style_url": "", "ai_model": "latest", "enable_pbr": true, "enable_original_uv": true }' # Retexture with Meshy N1 from front and back views curl https://api.meshy.ai/openapi/v1/retexture \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "model_url": "https://cdn.meshy.ai/model/example_model_2.glb", "ai_model": "meshy-n1", "multiview_image_urls": [ "", "" ] }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Retexture with text prompt const payload = { model_url: 'https://cdn.meshy.ai/model/example_model_2.glb', text_style_prompt: 'red fangs, Samurai outfit that fused with japanese batik style', enable_original_uv: true, enable_pbr: true, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/retexture', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Retexture with image style and PBR const imageStylePayload = { model_url: 'https://cdn.meshy.ai/model/example_model_2.glb', image_style_url: '', ai_model: 'latest', enable_pbr: true, enable_original_uv: true, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/retexture', imageStylePayload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } // Retexture with Meshy N1 from front and back views const meshyN1Payload = { model_url: 'https://cdn.meshy.ai/model/example_model_2.glb', ai_model: 'meshy-n1', multiview_image_urls: [ '', '', ], }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/retexture', meshyN1Payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Retexture with text prompt payload = { "model_url": "https://cdn.meshy.ai/model/example_model_2.glb", "text_style_prompt": "red fangs, Samurai outfit that fused with japanese batik style", "enable_original_uv": True, "enable_pbr": True } response = requests.post( "https://api.meshy.ai/openapi/v1/retexture", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) # Retexture with image style and PBR image_style_payload = { "model_url": "https://cdn.meshy.ai/model/example_model_2.glb", "image_style_url": "", "ai_model": "latest", "enable_pbr": True, "enable_original_uv": True } response = requests.post( "https://api.meshy.ai/openapi/v1/retexture", headers=headers, json=image_style_payload, ) response.raise_for_status() print(response.json()) # Retexture with Meshy N1 from front and back views meshy_n1_payload = { "model_url": "https://cdn.meshy.ai/model/example_model_2.glb", "ai_model": "meshy-n1", "multiview_image_urls": [ "", "" ] } response = requests.post( "https://api.meshy.ai/openapi/v1/retexture", headers=headers, json=meshy_n1_payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## GET /openapi/v1/retexture/:id -- Get a Retexture task Returns a Retexture task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Retexture task object](#the-retexture-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/retexture/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/retexture/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/retexture/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "retexture", "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "text_style_prompt": "red fangs, Samurai outfit that fused with japanese batik style", "texture_image_url": "", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX" } ], "task_error": null, "consumed_credits": 10 } ``` --- ## DELETE /openapi/v1/retexture/:id -- Delete a Retexture task Permanently deletes a Retexture task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/retexture/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/retexture/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/retexture/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/retexture -- List Retexture tasks Returns a list of your Retexture tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, up to `255`. A larger value returns `400`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Retexture task objects](#the-retexture-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/retexture?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/retexture?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/retexture", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "retexture", "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=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "text_style_prompt": "red fangs, Samurai outfit that fused with japanese batik style", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX" } ], "task_error": null, "consumed_credits": 10 } ] ``` --- ## GET /openapi/v1/retexture/:id/stream -- Stream a Retexture task Streams a Retexture task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Retexture task objects](#the-retexture-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/retexture/018a210d-8ba4-705c-b111-1f1776f7f578/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/retexture/018a210d-8ba4-705c-b111-1f1776f7f578/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/retexture/018a210d-8ba4-705c-b111-1f1776f7f578/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 0, "status": "PENDING" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 50, "status": "IN_PROGRESS" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "retexture", "progress": 100, "status": "SUCCEEDED", "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "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=***", "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" }, "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX" } ], "task_error": null, "consumed_credits": 10 } ``` --- ## The Retexture task object A Retexture task object describes one retexture of a 3D model. It holds the status, the progress, and the model and texture files when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `retexture`. - `model_urls` · *object* Download URLs for the textured 3D model, one per file format. - `glb` · *string* The GLB file. - `fbx` · *string* The FBX file. - `obj` · *string* The OBJ file. - `usdz` · *string* The USDZ file. - `mtl` · *string* The MTL file. Meshy returns it with the OBJ file when the model has textures. - `stl` · *string* The STL file. - `3mf` · *string* The 3MF file. Present only when `target_formats` includes `3mf`. - `text_style_prompt` · *string* The text prompt you created the task with. - `image_style_url` · *string* The style image you created the task with. - `multiview_image_urls` · *string[]* Download URLs for the multi-view reference images you created the task with. Present only when you created the task with `multiview_image_urls`. - `thumbnail_url` · *string* Download URL for a thumbnail image of the model. - `alpha_thumbnail_url` · *string* Download URL for a version of `thumbnail_url` with a transparent background (RGBA). Present only when you created the task with `alpha_thumbnail: true` and Meshy rendered the transparent preview. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `expires_at` · *timestamp* Time the task's results expire, in Unix milliseconds. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `texture_urls` · *array* Download URLs for the generated textures, as an array of objects. The array usually holds one object. Each object has these fields: - `base_color` · *string* Download URL for the base color map. - `metallic` · *string* Download URL for the metallic map. Meshy leaves this field out when you create the task with `enable_pbr: false`. - `normal` · *string* Download URL for the normal map. Meshy leaves this field out when you create the task with `enable_pbr: false`. - `roughness` · *string* Download URL for the roughness map. Meshy leaves this field out when you create the task with `enable_pbr: false`. - `emission` · *string* Download URL for the emission map. Meshy leaves this field out when you create the task with any of these: * `enable_pbr: false` * an `ai_model` of `meshy-6-lite`, `meshy-7`, or `latest` * `texture_resolution: 8k` - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. Present only while the task is `PENDING`; the field is left out when the value is `0`. - `task_error` · *object* The error details when the task fails. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **Example Retexture Task Model** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "retexture", "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=***", "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***" }, "text_style_prompt": "red fangs, Samurai outfit that fused with japanese batik style", "image_style_url": "https://assets.meshy.ai/***/image/example_image.jpg?Expires=***", "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***", "progress": 100, "started_at": 1692771667037, "created_at": 1692771650657, "expires_at": 1692771679037, "finished_at": 1692771669037, "status": "SUCCEEDED", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX", "normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX", "roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX" } ], "task_error": null, "consumed_credits": 10 } ``` --- # Text to Image API Source: https://docs.meshy.ai/api/text-to-image # Text to Image API Generate images from a text prompt with Meshy's AI models. > **Note:** Text to Image makes **images**. To make a 3D model of what's in an image, use [Image to 3D](/api/image-to-3d). To make an object you can hold or print from a photo, use the [Creative Lab APIs](/api/creative-lab-keychain). They make a prototype image and then build a 3D model from it, for example a keychain, fridge magnet, figure, lamp, or keycap. --- ## POST /openapi/v1/text-to-image -- Create a Text to Image task Creates a Text to Image task. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). ### Parameters - `ai_model` · *string* · **required** The AI model that generates the image. Prices differ by model. For prices, see [Pricing](/api/pricing). Available values: * `nano-banana`: the standard model * `nano-banana-2`: more capable than `nano-banana` * `nano-banana-2-lite`: a lite version of `nano-banana-2` * `nano-banana-2-1`: Nano Banana 2.1 * `nano-banana-pro`: the Pro model, with higher quality. Needs a Pro plan or higher. On a lower plan, it returns `402`. * `gpt-image-2`: OpenAI GPT Image 2 * `gpt-image-2-5-flare`: OpenAI GPT Image 2.5 (Flare) * `gpt-image-2-5-sunburst`: OpenAI GPT Image 2.5 (Sunburst) * `gpt-image-2-6-flare`: OpenAI GPT Image 2.6 (Flare) * `gpt-image-2-6-sunburst`: OpenAI GPT Image 2.6 (Sunburst) - `prompt` · *string* · **required** Text that describes the image to generate. A detailed description gives better results. - `generate_multi_view` · *boolean* · default: `false` Whether to generate a multi-view image that shows the subject from several angles. When it's `true`, you can't send `aspect_ratio`. Sending both returns `400`. - `pose_mode` · *string* The pose for a character, `a-pose` or `t-pose`. Leave it out for no pose. How a pose works depends on `ai_model`: * `nano-banana-2`, `nano-banana-2-lite`, and `nano-banana-2-1`: Meshy keeps the model you chose. The image is always `3:4`, and Meshy ignores `aspect_ratio`. * `nano-banana` and `nano-banana-pro`: Meshy generates the image with `nano-banana-pro`, so the task's `ai_model` reads back as `nano-banana-pro`. This needs a Pro plan or higher. The image is always `3:4`, and Meshy ignores `aspect_ratio`. * The GPT Image models (`gpt-image-2`, `gpt-image-2-5-flare`, `gpt-image-2-5-sunburst`, `gpt-image-2-6-flare`, and `gpt-image-2-6-sunburst`): Meshy keeps the model you chose and your `aspect_ratio`. - `aspect_ratio` · *string* · default: `1:1` The shape of the image. The values you can send depend on `ai_model`. Available values: * `1:1`: square * `16:9`: widescreen landscape * `9:16`: widescreen portrait * `4:3`: standard landscape * `3:4`: standard portrait * `3:2`: landscape, GPT Image models only * `2:3`: portrait, GPT Image models only The `nano-banana` models (`nano-banana`, `nano-banana-2`, `nano-banana-2-lite`, `nano-banana-2-1`, and `nano-banana-pro`) return `400` for `3:2` and `2:3`. - `remove_background` · *boolean* · default: `false` Whether to remove the image's background. `true` returns a transparent RGBA PNG, so you can place the subject on any background. ### Returns The `result` field of the response holds the ID of the new Text to Image task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: A required parameter, such as `ai_model` or `prompt`, is missing. * **Invalid parameter**: `ai_model` or `aspect_ratio` isn't one of the allowed values. * **Conflict**: `aspect_ratio` was sent with `generate_multi_view: true`. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` The account can't run this task. For example: * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. * **Insufficient credits**: The account doesn't have enough credits for this task (`Insufficient funds`), or the account reached a credit limit. * **Plan required**: The request uses `nano-banana-pro`, or `pose_mode` with `nano-banana`, on a plan below Pro (`Only Pro and above users can use nano-banana-pro`, or `Only Pro and above users can use A/T pose feature (requires nano-banana-pro)`). Check your credit balance and plan, then retry. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Generate an image from a text prompt curl https://api.meshy.ai/openapi/v1/text-to-image \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "ai_model": "nano-banana", "prompt": "A majestic dragon soaring through clouds at sunset", "aspect_ratio": "16:9" }' ``` ```javascript import axios from 'axios' // Generate an image from a text prompt const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { ai_model: "nano-banana", prompt: "A majestic dragon soaring through clouds at sunset", aspect_ratio: "16:9" }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/text-to-image', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests # Generate an image from a text prompt payload = { "ai_model": "nano-banana", "prompt": "A majestic dragon soaring through clouds at sunset", "aspect_ratio": "16:9" } headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.post( "https://api.meshy.ai/openapi/v1/text-to-image", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## GET /openapi/v1/text-to-image/:id -- Get a Text to Image task Returns a Text to Image task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Text to Image task object](#the-text-to-image-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/text-to-image/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/text-to-image/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/text-to-image/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "text-to-image", "ai_model": "nano-banana", "prompt": "A majestic dragon soaring through clouds at sunset", "status": "SUCCEEDED", "progress": 100, "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "expires_at": 1692771679037, "image_urls": [ "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ] } ``` --- ## DELETE /openapi/v1/text-to-image/:id -- Delete a Text to Image task Permanently deletes a Text to Image task, including its images and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/text-to-image/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/text-to-image/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/text-to-image/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/text-to-image -- List Text to Image tasks Returns a list of your Text to Image and Image to Image tasks. Each task's `type` field says which of the two it is. ### Parameters - `page_num` · *integer* The page number to return. Starts at and defaults to `1`. - `page_size` · *integer* The number of tasks per page, up to `100`. Defaults to `10`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of task objects, in the same format as the [Text to Image task object](#the-text-to-image-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/text-to-image?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/text-to-image?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/text-to-image", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "text-to-image", "ai_model": "nano-banana", "prompt": "A majestic dragon soaring through clouds at sunset", "status": "SUCCEEDED", "progress": 100, "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "expires_at": 1692771679037, "image_urls": [ "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ] } ] ``` --- ## GET /openapi/v1/text-to-image/:id/stream -- Stream a Text to Image task Streams a Text to Image task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Text to Image task objects](#the-text-to-image-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/text-to-image/018a210d-8ba4-705c-b111-1f1776f7f578/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/text-to-image/018a210d-8ba4-705c-b111-1f1776f7f578/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/text-to-image/018a210d-8ba4-705c-b111-1f1776f7f578/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```text // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 0, "status": "PENDING" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "text-to-image", "ai_model": "nano-banana", "prompt": "A majestic dragon soaring through clouds at sunset", "status": "SUCCEEDED", "progress": 100, "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "expires_at": 1692771679037, "image_urls": [ "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ] } ``` --- ## The Text to Image task object A Text to Image task object describes one image generation from a text prompt. It holds the status, the progress, and the image URLs when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `text-to-image`. - `ai_model` · *string* The AI model the task used. Possible values: * `nano-banana` * `nano-banana-2` * `nano-banana-2-lite` * `nano-banana-2-1` * `nano-banana-pro` * `gpt-image-2` * `gpt-image-2-5-flare` * `gpt-image-2-5-sunburst` * `gpt-image-2-6-flare` * `gpt-image-2-6-sunburst` - `prompt` · *string* The text prompt you created the task with. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. Absent until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. Absent until the task finishes. - `expires_at` · *timestamp* Time the task's results expire, in Unix milliseconds. Absent until the task finishes. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. The field is left out when the value is `0`. - `image_urls` · *array* Download URLs for the generated images. With `generate_multi_view: true`, the array holds one URL per view, usually three. If Meshy can't separate every view, it returns fewer, and the task still succeeds. Otherwise, it holds one URL. - `task_error` · *object* The error details when the task fails. It's `null` unless the status is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **Example Text to Image Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "text-to-image", "ai_model": "nano-banana", "prompt": "A majestic dragon soaring through clouds at sunset", "status": "SUCCEEDED", "progress": 100, "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "expires_at": 1692771679037, "image_urls": [ "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ], "task_error": null, "consumed_credits": 3 } ``` --- # Image to Image API Source: https://docs.meshy.ai/api/image-to-image # Image to Image API Edit and transform images in your own application. Send reference images and a text prompt, and Meshy's AI models generate a new image from them. > **Note:** Image to Image makes **images**. To make a 3D model of what's in an image, use [Image to 3D](/api/image-to-3d). To make an object you can hold or print from a photo, use the [Creative Lab APIs](/api/creative-lab-keychain). They make a prototype image and then build a 3D model from it, for example a keychain, fridge magnet, figure, lamp, or keycap. --- ## POST /openapi/v1/image-to-image -- Create an Image to Image task Creates an Image to Image task. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). ### Parameters - `ai_model` · *string* · **required** The AI model that generates the image. Prices differ by model. See [Pricing](/api/pricing). Available values: * `nano-banana`: the standard model * `nano-banana-2`: more capable than `nano-banana` * `nano-banana-2-lite`: a lite version of `nano-banana-2` * `nano-banana-2-1`: Nano Banana 2.1 * `nano-banana-pro`: the Pro model, with higher quality. It needs a Pro plan or higher. On a lower plan, it returns `402`. * `gpt-image-2`: OpenAI GPT Image 2 * `gpt-image-2-5-flare`: OpenAI GPT Image 2.5 (Flare) * `gpt-image-2-5-sunburst`: OpenAI GPT Image 2.5 (Sunburst) * `gpt-image-2-6-flare`: OpenAI GPT Image 2.6 (Flare) * `gpt-image-2-6-sunburst`: OpenAI GPT Image 2.6 (Sunburst) - `prompt` · *string* · **required** Text that describes the edit or transformation to apply to the reference images. - `input_task_id` · *string* · **required** Required unless you send `reference_image_urls`. The ID of a Text to Image or Image to Image task whose images to use as the references, including multi-view tasks. The task must be one you created with the API and have the status `SUCCEEDED`. Meshy uses every image the task produced. A single-image task gives one reference image, and a multi-view task gives one per view. So one task ID can fill several of the five reference slots. The task must still be within the [asset retention period](/api/asset-retention). After it expires, its ID returns `404`. - `reference_image_urls` · *array* · **required** Required unless you send `input_task_id`. One to five reference images to edit, each a public URL or a data URI, for example `data:image/jpeg;base64,`. An empty array, or more than five images, returns `400`. If you send both, Meshy uses `input_task_id`. Each image must be a `.jpg`, `.jpeg`, `.png`, or `.webp` file of at most 20 MB, and at least 32 pixels on each side. - `generate_multi_view` · *boolean* · default: `false` Whether to generate a multi-view image that shows the subject from several angles. When `true`, you can't send `aspect_ratio`. Sending both returns `400`. - `aspect_ratio` · *string* · default: `1:1` The aspect ratio of the output image. The values you can send depend on `ai_model`. Available values: * `1:1`: square * `16:9`: widescreen landscape * `9:16`: widescreen portrait * `4:3`: standard landscape * `3:4`: standard portrait * `3:2`: landscape, GPT Image models only * `2:3`: portrait, GPT Image models only The GPT Image models are `gpt-image-2`, `gpt-image-2-5-flare`, `gpt-image-2-5-sunburst`, `gpt-image-2-6-flare`, and `gpt-image-2-6-sunburst`. With a `nano-banana` model, `3:2` and `2:3` return `400`. - `remove_background` · *boolean* · default: `false` Whether to remove the background. When `true`, Meshy returns the output image as a transparent RGBA PNG, so you can place the subject on any background. ### Returns The `result` field of the response holds the ID of the new Image to Image task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: A required parameter, such as `ai_model` or `prompt`, is missing, or neither `reference_image_urls` nor `input_task_id` was sent. * **Invalid input task**: `input_task_id` doesn't point to a usable task. It must be a `SUCCEEDED` Text to Image or Image to Image task, multi-view included, that still has image output. Meshy rejects a task of another type, a task that hasn't succeeded, and a task whose images have all expired. * **Invalid image format**: One or more reference images aren't in a supported format. * **Unreachable URL**: Meshy can't download one or more `reference_image_urls` images. * **Image too large**: One or more `reference_image_urls` images are over 20 MB. * **Image too small**: One or more `reference_image_urls` images have a side shorter than 32 pixels. * **Invalid parameter**: `aspect_ratio` isn't one of the values the selected `ai_model` supports. * **Conflict**: The request sends `aspect_ratio` with `generate_multi_view: true`. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` The account can't run this task. For example: * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. * **Plan required**: The request uses `nano-banana-pro` on a plan below Pro. Check your credit balance and plan, then retry. - `404 - Not Found` `input_task_id` doesn't match a task in your account. A task that doesn't exist and a task that belongs to another account return the same response. Check the ID. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Transform a reference image with a text prompt curl https://api.meshy.ai/openapi/v1/image-to-image \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "reference_image_urls": [ "" ] }' ## Using data URI example curl https://api.meshy.ai/openapi/v1/image-to-image \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "reference_image_urls": [ "data:image/png;base64,${YOUR_BASE64_ENCODED_IMAGE_DATA}" ] }' ## Chaining from a previous task, instead of passing image URLs curl https://api.meshy.ai/openapi/v1/image-to-image \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "input_task_id": "" }' ``` ```javascript import axios from 'axios' // Transform a reference image with a text prompt const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { ai_model: "nano-banana", prompt: "Transform this into a cyberpunk style artwork", // Using data URI example // reference_image_urls: ['data:image/png;base64,${YOUR_BASE64_ENCODED_IMAGE_DATA}'], reference_image_urls: [ "" ] }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/image-to-image', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests # Transform a reference image with a text prompt payload = { "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", # Using data URI example # "reference_image_urls": [f"data:image/png;base64,{YOUR_BASE64_ENCODED_IMAGE_DATA}"], "reference_image_urls": [ "" ] } headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.post( "https://api.meshy.ai/openapi/v1/image-to-image", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## GET /openapi/v1/image-to-image/:id -- Get an Image to Image task Returns an Image to Image task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Image to Image task object](#the-image-to-image-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/image-to-image/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/image-to-image/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/image-to-image/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "image-to-image", "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "status": "SUCCEEDED", "progress": 100, "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "expires_at": 1692771679037, "image_urls": [ "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ] } ``` --- ## DELETE /openapi/v1/image-to-image/:id -- Delete an Image to Image task Permanently deletes an Image to Image task, including its images and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/image-to-image/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/image-to-image/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/image-to-image/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/image-to-image -- List Image to Image tasks Returns a list of your Image to Image and Text to Image tasks. Each task's `type` field says which of the two it is. ### Parameters - `page_num` · *integer* The page number to return. Starts at and defaults to `1`. - `page_size` · *integer* The number of tasks per page, up to `100`. Defaults to `10`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of task objects, in the same format as the [Image to Image task object](#the-image-to-image-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/image-to-image?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/image-to-image?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/image-to-image", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "image-to-image", "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "status": "SUCCEEDED", "progress": 100, "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "expires_at": 1692771679037, "image_urls": [ "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ] } ] ``` --- ## GET /openapi/v1/image-to-image/:id/stream -- Stream an Image to Image task Streams an Image to Image task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Image to Image task objects](#the-image-to-image-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/image-to-image/018a210d-8ba4-705c-b111-1f1776f7f578/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/image-to-image/018a210d-8ba4-705c-b111-1f1776f7f578/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/image-to-image/018a210d-8ba4-705c-b111-1f1776f7f578/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```text // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 0, "status": "PENDING" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "image-to-image", "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "status": "SUCCEEDED", "progress": 100, "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "expires_at": 1692771679037, "image_urls": [ "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ] } ``` --- ## The Image to Image task object An Image to Image task object describes one image generated from reference images and a text prompt. It holds the status, the progress, and the images when the task succeeds. ### Properties - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `image-to-image`. - `ai_model` · *string* The AI model the task used. Available values: * `nano-banana` * `nano-banana-2` * `nano-banana-2-lite` * `nano-banana-2-1` * `nano-banana-pro` * `gpt-image-2` * `gpt-image-2-5-flare` * `gpt-image-2-5-sunburst` * `gpt-image-2-6-flare` * `gpt-image-2-6-sunburst` - `prompt` · *string* The text prompt that guided the edit. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. Absent until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. Absent until the task finishes. - `expires_at` · *timestamp* Time the task's results expire, in Unix milliseconds. Absent until the task finishes. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. The field is left out when the value is `0`. - `image_urls` · *array* Download URLs for the generated images. With `generate_multi_view: true`, it holds one URL per view, usually three. If Meshy can't separate every view, it returns fewer, and the task still succeeds. Otherwise, it holds one URL. - `task_error` · *object* The error details when the task fails. It's `null` unless the status is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **Example Image to Image Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "image-to-image", "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "status": "SUCCEEDED", "progress": 100, "created_at": 1692771650657, "started_at": 1692771667037, "finished_at": 1692771669037, "expires_at": 1692771679037, "image_urls": [ "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ], "task_error": null, "consumed_credits": 3 } ``` --- # Multi-Color Print API Source: https://docs.meshy.ai/api/multi-color-print # Multi-Color Print API Convert a 3D model into a multi-color 3MF file for 3D printing. Choose a palette of up to 16 colors and a slicer preset for your printer brand. --- ## POST /openapi/v1/print/multi-color -- Create a Multi-Color Print task Creates a Multi-Color Print task, which converts a 3D model into a multi-color 3MF file for 3D printing. The task runs in the background. 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 the task whose model you want to print, for example an [Image to 3D](/api/image-to-3d), [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task), [Text to 3D](/api/text-to-3d), [Remesh](/api/remesh), or [Retexture](/api/retexture) task. The task must be one you created with the API, and have the status `SUCCEEDED`. Multi-Color Print reads the task's GLB file, which can have at most 8,000,000 faces. A model with more faces returns `400`. In that case, run a [Remesh](/api/remesh) task on it first, and send the Remesh task's ID instead. - `model_url` · *string* · **required** Required unless you send `input_task_id`. The model to print, as a public URL or a data URI. If you send both, Meshy uses `input_task_id`. An `http` or `https` URL must point to a `.glb` or `.fbx` file of at most 400 MB. A data URI must hold a base64 GLB file of at most 100 MB. Use `data:model/gltf-binary;base64,`. Send an `.fbx` file as an `http` or `https` URL. A file over 100 MB must also follow these rules: * It can have at most 8,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 file must not use Draco compression. - `max_colors` · *integer* · default: `4` The maximum number of colors in the output palette, from `1` to `16`. To use the default, leave it out rather than sending `0`. - `style` · *string* · default: `realistic` The color style of the 3MF file. Available values: * `realistic`: samples colors directly from the model's texture for fine, photo-realistic detail, and makes a larger file. * `cartoon`: flattens colors into clean, uniform regions for a stylized look, and makes a smaller file. The model must have color. `realistic` needs a single base color texture, with UVs on every mesh part, and `cartoon` also accepts vertex colors. Meshy rejects an untextured (white) model. See [`model_missing_texture`](/api/errors#model-missing-texture). - `max_depth` · *integer* · default: `4` The subdivision depth Meshy uses to sample texture colors onto the mesh, from `3` to `6`. `0` is the same as leaving it out. Higher values capture finer color detail, and make a larger file. Only the `realistic` style uses it, and `cartoon` ignores it. - `printer_brand` · *string* · default: `bambu` The printer brand whose slicer preset Meshy writes into the 3MF file. The file then opens in that brand's slicer with a matching printer, filament, and process profile. The preset uses the brand's default printer, with a 0.4 mm nozzle. Available values: * `bambu` * `anycubic` * `creality` * `elegoo` * `flashforge` * `prusa` * `qidi` * `snapmaker` * `ankermake` Any other value returns `400`. ### Returns The `result` field of the response holds the ID of the new Multi-Color Print task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `model_url` nor `input_task_id` was sent. * **Invalid model format**: The `model_url` file isn't a `.glb` or `.fbx` file. * **Unreachable URL**: Meshy can't download the `model_url` file. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is over 100 MB and has more than 8,000,000 faces. Reduce the face count, then send the file again. * **ASCII FBX over 100 MB**: The `model_url` file is an ASCII FBX over 100 MB. Send it as binary FBX or GLB. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB, or a binary FBX older than 7.1. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. * **Invalid input task**: `input_task_id` isn't a successful task. * **Too many faces in the input task**: The `input_task_id` model has more than 8,000,000 faces. Run a Remesh task on it, then send the Remesh task's ID instead. * **Invalid max_colors**: `max_colors` is negative or over `16`. * **Invalid style**: `style` isn't `realistic` or `cartoon`. * **Invalid max_depth**: `max_depth` is outside `3` to `6`, and isn't `0`. * **Invalid printer_brand**: `printer_brand` isn't one of its available values. * **No color source**: The model lacks the color that `style` needs. `realistic` needs a single base color texture, with UVs, on every mesh part. `cartoon` accepts a base color texture or vertex colors. Texture the model first, or use `cartoon` for a model with vertex colors. Meshy checks an `.fbx` upload only after the task normalizes it, so the task fails with [`model_missing_texture`](/api/errors#model-missing-texture) instead. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` `input_task_id` is a bas-relief model, which this endpoint can't print. 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. Check the task ID, then send the request again. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Convert a 3D model to a multi-color 3MF with a Creality slicer preset curl https://api.meshy.ai/openapi/v1/print/multi-color \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "max_colors": 8, "printer_brand": "creality" }' ``` ```javascript import axios from 'axios' // Convert a 3D model to a multi-color 3MF with a Creality slicer preset const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", max_colors: 8, printer_brand: "creality" }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/print/multi-color', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests # Convert a 3D model to a multi-color 3MF with a Creality slicer preset payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "max_colors": 8, "printer_brand": "creality" } headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.post( "https://api.meshy.ai/openapi/v1/print/multi-color", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9" } ``` --- ## GET /openapi/v1/print/multi-color/:id -- Get a Multi-Color Print task Returns a Multi-Color Print task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Multi-Color Print task object](#the-3d-print-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/print/multi-color/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/print/multi-color/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/print/multi-color/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-multi-color", "model_urls": { "3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***" }, "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "expires_at": 1700259201000, "task_error": null, "consumed_credits": 10 } ``` --- ## DELETE /openapi/v1/print/multi-color/:id -- Delete a Multi-Color Print task Permanently deletes a Multi-Color Print task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/print/multi-color/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/print/multi-color/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/print/multi-color/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/print/multi-color -- List Multi-Color Print tasks Returns a list of your Multi-Color Print tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return. Page numbers start at `1`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Multi-Color Print task objects](#the-3d-print-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/print/multi-color?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/print/multi-color?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/print/multi-color", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-multi-color", "model_urls": { "3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***" }, "progress": 100, "status": "SUCCEEDED", "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "expires_at": 1700259201000, "task_error": null, "consumed_credits": 10 } ] ``` --- ## GET /openapi/v1/print/multi-color/:id/stream -- Stream a Multi-Color Print task Streams a Multi-Color Print task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Multi-Color Print task objects](#the-3d-print-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its result fields don't have values yet. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/print/multi-color/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/print/multi-color/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/print/multi-color/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // These examples are shortened. Each event holds the full task object. event: message data: { "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f", "progress": 0, "status": "PENDING" } event: message data: { "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f", "type": "print-multi-color", "model_urls": { "3mf": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/model.3mf?Expires=***" }, "progress": 100, "status": "SUCCEEDED", "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "expires_at": 1700259201000, "task_error": null, "consumed_credits": 10 } ``` --- ## The Multi-Color Print task object A Multi-Color Print task object describes one conversion of a 3D model to a multi-color 3MF file. It holds the status, the progress, and the 3MF file when the task succeeds. - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `print-multi-color`. - `model_urls` · *object* Download URLs for the printed model, one per file format. A format the task didn't generate has no key, rather than an empty string. - `3mf` · *string* The multi-color 3MF file. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's `0` until the task finishes. - `task_error` · *object* The error details when the task fails. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used. Present when the status is `PENDING`, `IN_PROGRESS`, or `SUCCEEDED`. It's `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. **The 3D Print Task Object** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-multi-color", "model_urls": { "3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***" }, "progress": 100, "status": "SUCCEEDED", "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "expires_at": 1700259201000, "task_error": null, "consumed_credits": 10 } ``` --- # Analyze Printability API Source: https://docs.meshy.ai/api/analyze-printability # Analyze Printability API Check a 3D model for printing problems by measuring its watertightness, volume, holes, non-manifold edges, and degenerate faces. You can also check wall thickness at the size you plan to print. --- ## POST /openapi/v1/print/analyze -- Create an Analyze Printability task Creates an Analyze Printability task, which evaluates a 3D model and reports its printability metrics. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). When Meshy already has the printability result for the `input_task_id` task, the new task is ready right away. Your first `GET` on it returns the result. ### Parameters - `input_task_id` · *string* · **required** Required unless you send `model_url`. The ID of the task whose model you want to analyze. The task must have the status `SUCCEEDED`, and be one of yours or in a workspace you belong to. It can be one of these task types, using Meshy 6 or newer, including Meshy 7: * [Image to 3D](/api/image-to-3d) * [Multi-Image to 3D](/api/multi-image-to-3d) * [Text to 3D](/api/text-to-3d) * [Remesh](/api/remesh) * [Retexture](/api/retexture) A [Repair Printability](/api/repair-printability) task also works. - `model_url` · *string* · **required** Required unless you send `input_task_id`. The model to analyze, as a public URL or a data URI. If you send both, Meshy uses `input_task_id`. From an `http` or `https` URL, the model must be a `.glb`, `.gltf`, `.obj`, `.fbx`, or `.stl` file of at most 400 MB. A data URI can hold only a base64 GLB (`data:model/gltf-binary;base64,...`) or glTF (`data:model/gltf+json;base64,...`) file of at most 100 MB. Send an `.obj`, `.fbx`, or `.stl` file as an `http` or `https` URL. A file over 100 MB must also follow these rules: * 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. A Meshy download URL (`assets.meshy.ai/…?Expires=…&Signature=…`) is signed and stops working at its task's `expires_at`. Reading the task again doesn't renew it. For a model you made with Meshy, send `input_task_id` instead, which works while Meshy keeps the source task (see [Asset retention](/api/asset-retention)). To use the model after that, download it before `expires_at` and send your own copy. To also check wall thickness at the size you plan to print, send `printer_type`, a print size, or both. The result is in `printability.thin_walls`. Checking wall thickness takes longer, so the task usually isn't ready right away, even if Meshy analyzed the model before. - `printer_type` · *string* The printer you plan to use. It sets the minimum wall thickness for the wall-thickness check. If you send a print size without `printer_type`, Meshy uses `fdm`. Available values: * `fdm`: filament, 1.0 mm minimum wall * `sla`: resin, 0.8 mm minimum wall * `full_color`: full-color, 2.0 mm minimum wall Any other value returns `400`. - `intended_print_height_mm` · *number* The height of the print, in millimeters, from `1` to `1000`. A value outside the range returns `400`. Send this or `intended_print_longest_side_mm`, not both. It works only with GLB input. For a `model_url` that isn't a `.glb` file, send `intended_print_longest_side_mm` instead. - `intended_print_longest_side_mm` · *number* The length of the print's longest side, in millimeters, from `1` to `1000`. A value outside the range returns `400`. It works with every input format. If you send `printer_type` without a size, Meshy uses this print size: * `.glb` file or any `input_task_id`: 150 mm tall * `.stl` file: the file's own longest side, read as millimeters * `.obj`, `.fbx`, or `.gltf` file: 150 mm on the longest side For an STL file in other units, send `intended_print_longest_side_mm`. Meshy rounds both print sizes to the nearest millimeter. ### Returns The `result` field of the response holds the ID of the new Analyze Printability task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `input_task_id` nor `model_url` was sent. * **Invalid UUID**: `input_task_id` isn't a valid UUID. * **Invalid model URL**: `model_url` is malformed, uses an unsupported scheme, or has an unsupported file extension. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is a GLB, glTF, FBX, or OBJ file over 100 MB with more than 10,000,000 faces. Reduce the face count, then send the file again. * **ASCII FBX over 100 MB**: The `model_url` file is an ASCII FBX over 100 MB. Send it as binary FBX or GLB. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB or glTF, or a binary FBX older than 7.1. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. * **Model file can't be downloaded**: `model_url` returned an error, most often because a signed Meshy download URL expired. Reading the task again returns the same URL with the same expiry. Send your own copy of the file, or send `input_task_id` while Meshy keeps the source task. * **Task not succeeded**: The `input_task_id` task is still pending, in progress, or failed. * **Invalid print size**: `intended_print_height_mm` or `intended_print_longest_side_mm` is outside `1` to `1000`, or the request has both. * **Unknown printer type**: `printer_type` isn't `fdm`, `sla`, or `full_color`. * **Height on a non-GLB model**: The request has `intended_print_height_mm` and a `model_url` that isn't a `.glb` file. Send `intended_print_longest_side_mm` instead. * **Can't size this model by height**: At the requested height, or the default 150 mm, the model's longest side would be outside 1 to 1,000 mm. It also happens when the model is flat, or when Meshy can't determine its size. Send `intended_print_longest_side_mm` instead. For a `.glb` `model_url` and some `input_task_id` tasks, Meshy finds this only after the task starts, and the task ends as `FAILED` instead. * **STL size unusable**: The request has `printer_type` without a size, and Meshy can't read the `.stl` file's own longest side, or it's outside 1 to 1,000 mm. Send `intended_print_longest_side_mm`. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `403 - Forbidden` `input_task_id` is a bas-relief model, which this endpoint can't analyze. The message is `This model type does not support this operation`. Send a different model. - `404 - Not Found` Meshy can't find a model to analyze for `input_task_id`. For example: * The task doesn't exist, was deleted, or isn't yours or in a workspace you belong to. * The task uses a model older than Meshy 6, or its type doesn't produce a 3D model. * The task's model file is no longer in storage. Check that `input_task_id` is a supported task that's yours or in one of your workspaces, or send the model as `model_url`. - `429 - Too Many Requests` You exceeded your rate limit, or you have too many pending tasks. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Analyze an existing task curl https://api.meshy.ai/openapi/v1/print/analyze \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578" }' # Or analyze a model URL directly curl https://api.meshy.ai/openapi/v1/print/analyze \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "model_url": "https://example.com/model.glb" }' # Also check wall thickness for a 100 mm tall SLA print curl https://api.meshy.ai/openapi/v1/print/analyze \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "printer_type": "sla", "intended_print_height_mm": 100 }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", // Optional: also check wall thickness for a 100 mm tall SLA print printer_type: "sla", intended_print_height_mm: 100 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/print/analyze', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", # Optional: also check wall thickness for a 100 mm tall SLA print "printer_type": "sla", "intended_print_height_mm": 100, } headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.post( "https://api.meshy.ai/openapi/v1/print/analyze", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9" } ``` --- ## GET /openapi/v1/print/analyze/:id -- Get an Analyze Printability task Returns an Analyze Printability task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Analyze Printability task object](#the-analyze-printability-task-object). Its `printability` field isn't present until the task is `SUCCEEDED`. When Meshy checked wall thickness, `printability` also includes `intended_print` and `thin_walls`. **cURL** ```bash curl https://api.meshy.ai/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/print/analyze/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/print/analyze/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-analyze", "status": "SUCCEEDED", "progress": 100, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "expires_at": 1715725401000, "task_error": null, "printability": { "_version": "v1", "status": "warning", "issue_count": 1, "error_count": 0, "warning_count": 1, "metrics": { "is_watertight": true, "volume": 1.316167354292668, "non_manifold_edges": 0, "degenerate_faces": 43242, "holes": 0 }, "evaluated_at": 1700000001000 }, "consumed_credits": 0 } ``` **Response (wall thickness checked)** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-analyze", "status": "SUCCEEDED", "progress": 100, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000012000, "expires_at": 1715725412000, "task_error": null, "printability": { "_version": "v1", "status": "error", "issue_count": 2, "error_count": 1, "warning_count": 1, "metrics": { "is_watertight": true, "volume": 1.316167354292668, "non_manifold_edges": 0, "degenerate_faces": 43242, "holes": 0 }, "intended_print": { "printer_type": "sla", "height_mm": 100, "longest_side_mm": 118, "wall_thickness_mm": 0.8, "dimensions_mm": [118, 72.41, 99.87] }, "thin_walls": { "thin_area_ratio": 0.083, "has_thin_walls": true, "status": "error" }, "evaluated_at": 1700000012000 }, "consumed_credits": 0 } ``` --- ## DELETE /openapi/v1/print/analyze/:id -- Delete an Analyze Printability task Permanently deletes an Analyze Printability task, including its cached result. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/print/analyze/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/print/analyze/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/print/analyze -- List Analyze Printability tasks Returns a list of your Analyze Printability tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, starting at `1`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Analyze Printability task objects](#the-analyze-printability-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/print/analyze?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/print/analyze?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/print/analyze", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-analyze", "status": "SUCCEEDED", "progress": 100, "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "expires_at": 1715725401000, "task_error": null, "printability": { "_version": "v1", "status": "warning", "issue_count": 1, "error_count": 0, "warning_count": 1, "metrics": { "is_watertight": true, "volume": 1.316167354292668, "non_manifold_edges": 0, "degenerate_faces": 43242, "holes": 0 }, "evaluated_at": 1700000001000 }, "consumed_credits": 0 } ] ``` --- ## GET /openapi/v1/print/analyze/:id/stream -- Stream an Analyze Printability task Streams an Analyze Printability task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Analyze Printability task objects](#the-analyze-printability-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its output fields are empty (`null`, `[]`, or `{}`), and `finished_at` is `0`. Meshy sends the `printability` field only after the task is `SUCCEEDED`. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/print/analyze/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is abbreviated to the fields that change. event: message data: { "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f", "progress": 0, "status": "PENDING" } event: message data: { "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f", "type": "print-analyze", "status": "SUCCEEDED", "progress": 100, "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "expires_at": 1715725401000, "task_error": null, "printability": { "_version": "v1", "status": "warning", "issue_count": 1, "error_count": 0, "warning_count": 1, "metrics": { "is_watertight": true, "volume": 1.316167354292668, "non_manifold_edges": 0, "degenerate_faces": 43242, "holes": 0 }, "evaluated_at": 1700000001000 }, "consumed_credits": 0 } ``` --- ## The Analyze Printability task object An Analyze Printability task object describes one analysis of a 3D model. It holds the status, the progress, and the printability result when the task succeeds. - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `print-analyze`. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's `0` until the task finishes. - `task_error` · *object* The error details when the task fails. It's `null` if the task hasn't failed. See [Errors](/api/errors#task-errors). - `message` · *string* A description of what went wrong. - `printability` · *object* The result of the analysis. It isn't present until the task is `SUCCEEDED`. - `_version` · *string* The schema version of the printability result. The value is `v1`. - `status` · *string* The overall verdict, one of: * `healthy`: no errors and no warnings * `warning`: at least one warning, and no errors * `error`: at least one error * `unknown`: Meshy couldn't analyze the model When Meshy checked wall thickness, this is the worse of the mesh checks and `thin_walls.status`. From worst to best, the order is `error`, `warning`, `unknown`, and `healthy`. - `issue_count` · *integer* The total number of issues, equal to `error_count + warning_count`. - `error_count` · *integer* The number of error-level issues. Meshy counts one error for each of these: * The model isn't watertight and has more than 8 holes. * The model has more than 8 holes. * The volume is zero or less. * The model has more than 50 non-manifold edges. When Meshy checked wall thickness, walls that are too thin (`thin_walls.status` is `error`) count as one more error. - `warning_count` · *integer* The number of warning-level issues. Meshy counts one warning for each of these: * The model isn't watertight and has 8 holes or fewer. * The model has 1 to 8 holes. * The model has 1 to 50 non-manifold edges. * The model has degenerate faces. - `metrics` · *object* The raw geometry measurements of the model. - `is_watertight` · *boolean* `true` when the mesh has no boundary edges, that is, when it's closed. - `volume` · *number* The model's volume, in cubic meters. - `non_manifold_edges` · *integer* The number of non-manifold edges. - `degenerate_faces` · *integer* The number of degenerate faces, which are faces with zero area or invalid faces. - `holes` · *integer* The number of holes in the mesh, counted as boundary loops. - `intended_print` · *object* The printer and size that the wall-thickness check used. Present only when Meshy checked wall thickness. - `printer_type` · *string* The printer type, `fdm`, `sla`, or `full_color`. - `height_mm` · *number* The print height, in millimeters, when the print is sized by height. Otherwise, it's `null`. - `longest_side_mm` · *number* The length of the print's longest side, in millimeters. When the print is sized by height, Meshy calculates it from the model's proportions. - `wall_thickness_mm` · *number* The minimum wall thickness for `printer_type`, in millimeters. Meshy reports thinner walls as too thin. - `dimensions_mm` · *array* The print's `[width, depth, height]`, in millimeters. The height can differ from `height_mm` by a fraction of a millimeter. It's `null` for input other than GLB, or when Meshy can't determine the model's size. - `thin_walls` · *object* The result of the wall-thickness check. Present only when Meshy checked wall thickness. - `thin_area_ratio` · *number* The share of the surface thinner than `intended_print.wall_thickness_mm`, from `0` to `1`. It's `null` when Meshy couldn't measure the model. - `has_thin_walls` · *boolean* `true` if any part of the surface is too thin. Sharp corners alone can make it `true`, so use `status` to decide whether the walls need thickening. It's `null` when Meshy couldn't measure the model. - `status` · *string* The wall-thickness verdict, one of: * `healthy`: 5% or less of the surface is too thin. * `error`: more than 5% of the surface is too thin. To thicken the walls, send this task's `id` to [Repair Printability](/api/repair-printability) as `input_task_id`. If this task analyzed an `.stl`, `.fbx`, or `.gltf` file from `model_url`, send that file as `model_url` instead. * `unknown`: Meshy couldn't measure the model. If the wall-thickness check itself fails, the task ends as `FAILED`. - `evaluated_at` · *timestamp* Time Meshy computed the analysis, in Unix milliseconds. - `consumed_credits` · *integer* The number of credits the task used. It's always `0`, because analysis is free. **The Analyze Printability Task Object** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-analyze", "status": "SUCCEEDED", "progress": 100, "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000001000, "expires_at": 1715725401000, "task_error": null, "printability": { "_version": "v1", "status": "warning", "issue_count": 1, "error_count": 0, "warning_count": 1, "metrics": { "is_watertight": true, "volume": 1.316167354292668, "non_manifold_edges": 0, "degenerate_faces": 43242, "holes": 0 }, "evaluated_at": 1700000001000 }, "consumed_credits": 0 } ``` **The Analyze Printability Task Object (wall thickness checked)** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-analyze", "status": "SUCCEEDED", "progress": 100, "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000012000, "expires_at": 1715725412000, "task_error": null, "printability": { "_version": "v1", "status": "error", "issue_count": 2, "error_count": 1, "warning_count": 1, "metrics": { "is_watertight": true, "volume": 1.316167354292668, "non_manifold_edges": 0, "degenerate_faces": 43242, "holes": 0 }, "intended_print": { "printer_type": "sla", "height_mm": 100, "longest_side_mm": 118, "wall_thickness_mm": 0.8, "dimensions_mm": [118, 72.41, 99.87] }, "thin_walls": { "thin_area_ratio": 0.083, "has_thin_walls": true, "status": "error" }, "evaluated_at": 1700000012000 }, "consumed_credits": 0 } ``` --- # Repair Printability API Source: https://docs.meshy.ai/api/repair-printability # Repair Printability API Repair a 3D model so it's ready to print. Meshy fixes non-manifold edges, degenerate faces, holes, and other topology issues. You can also thicken walls that are too thin at the size you plan to print. --- ## POST /openapi/v1/print/repair -- Create a Repair Printability task Creates a Repair Printability task, which repairs a 3D model's topology and returns a watertight version ready to print. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). The repaired model has the same format as the input. For example, for an `.stl` file in `model_url`, `model_urls.stl` holds the repaired mesh, and `model_urls` has no other format keys. With `input_task_id`, Meshy always repairs the source task's GLB file, so the output is a `.glb` file. Meshy removes the model's textures during repair, because the geometry changes. To add textures back, send the repaired model to the [Retexture API](/api/retexture). ### Parameters - `input_task_id` · *string* · **required** Required unless you send `model_url`. The ID of the task whose model you want to repair, for example an [Image to 3D](/api/image-to-3d), [Multi-Image to 3D](/api/multi-image-to-3d), [Text to 3D](/api/text-to-3d), [Remesh](/api/remesh), [Retexture](/api/retexture), or [Analyze Printability](/api/analyze-printability) task. The task must be one you created with the API, with the status `SUCCEEDED` and a GLB model. An Analyze Printability task that checked wall thickness also passes on its printer and size. The repair then checks wall thickness and thickens thin walls, even if you send neither. A `printer_type` or print size you send replaces the one from the analysis. An Analyze Printability task of an `.stl`, `.fbx`, or `.gltf` file from `model_url` doesn't work. Send that file as `model_url` instead. - `model_url` · *string* · **required** Required unless you send `input_task_id`. The model to repair, as a public URL or a data URI. If you send both, Meshy uses `input_task_id`. From an `http` or `https` URL, the model must be a `.glb`, `.gltf`, `.obj`, `.fbx`, or `.stl` file of at most 400 MB. A data URI can hold only a base64 GLB (`data:model/gltf-binary;base64,...`) or glTF (`data:model/gltf+json;base64,...`) file of at most 100 MB. Send an `.obj`, `.fbx`, or `.stl` file as an `http` or `https` URL. A file over 100 MB must also follow these rules: * 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. A Meshy download URL (`assets.meshy.ai/…?Expires=…&Signature=…`) is signed and stops working at its task's `expires_at`. Reading the task again doesn't renew it. For a model you made with Meshy, send `input_task_id` instead, which works while Meshy keeps the source task (see [Asset retention](/api/asset-retention)). To use the model after that, download it before `expires_at` and send your own copy. - `alpha_thumbnail` · *boolean* · default: `false` Whether to also render a preview with a transparent background (RGBA), returned in `alpha_thumbnail_url` when you get the task. `thumbnail_url` doesn't change. To also thicken walls that are too thin at the size you plan to print, send `printer_type`, a print size, or both. Meshy thickens the walls only when more than 5% of the surface is too thin for that printer. The repaired model keeps its original scale. To scale it, use the [Resize API](/api/resize), which takes sizes in meters, so 100 mm is `0.1`. - `printer_type` · *string* The printer you plan to use. It sets the minimum wall thickness the repair aims for. If you send a print size without `printer_type`, Meshy uses `fdm`, unless an Analyze Printability task in `input_task_id` supplies the printer. Available values: * `fdm`: filament, 1.0 mm minimum wall * `sla`: resin, 0.8 mm minimum wall * `full_color`: full-color, 2.0 mm minimum wall Any other value returns `400`. - `intended_print_height_mm` · *number* The height of the print, in millimeters, from `1` to `1000`. A value outside the range returns `400`. Send this or `intended_print_longest_side_mm`, not both. It works only with GLB input. For a `model_url` that isn't a `.glb` file, send `intended_print_longest_side_mm` instead. - `intended_print_longest_side_mm` · *number* The length of the print's longest side, in millimeters, from `1` to `1000`. A value outside the range returns `400`. It works with every input format. If you send `printer_type` without a size, and Meshy reuses no size from an Analyze Printability task, Meshy uses this print size: * `.glb` file or any `input_task_id`: 150 mm tall * `.stl` file: the file's own longest side, read as millimeters * `.obj`, `.fbx`, or `.gltf` file: 150 mm on the longest side For an STL file in other units, send `intended_print_longest_side_mm`. Meshy rounds both print sizes to the nearest millimeter. ### Returns The `result` field of the response holds the ID of the new Repair Printability task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: Neither `input_task_id` nor `model_url` was sent. * **Invalid UUID**: `input_task_id` isn't a valid UUID. * **Invalid model URL**: `model_url` is malformed, uses an unsupported scheme, or has an unsupported file extension. * **Model file too large**: The `model_url` file is over 400 MB from an `http` or `https` URL, or over 100 MB as a data URI. * **Too many faces**: The `model_url` file is a GLB, glTF, FBX, or OBJ file over 100 MB with more than 10,000,000 faces. Reduce the face count, then send the file again. * **ASCII FBX over 100 MB**: The `model_url` file is an ASCII FBX over 100 MB. Send it as binary FBX or GLB. * **Unreadable model file**: The `model_url` file is over 100 MB, and Meshy can't read its header. For example, it's a Draco-compressed GLB or glTF, or a binary FBX older than 7.1. * **Model header too complex**: The `model_url` file is over 100 MB, and its header has too many meshes, nodes, or records to check. Reduce the number of objects in the file, then send it again. * **Model file can't be downloaded**: `model_url` returned an error, most often because a signed Meshy download URL expired. Reading the task again returns the same URL with the same expiry. Send your own copy of the file, or send `input_task_id` while Meshy keeps the source task. * **Task not succeeded**: The `input_task_id` task is still pending, in progress, or failed. * **Missing GLB**: The `input_task_id` task has no GLB model to repair. * **Invalid print size**: `intended_print_height_mm` or `intended_print_longest_side_mm` is outside `1` to `1000`, or the request has both. * **Unknown printer type**: `printer_type` isn't `fdm`, `sla`, or `full_color`. * **Height on a non-GLB model**: The request has `intended_print_height_mm` and a `model_url` that isn't a `.glb` file. Send `intended_print_longest_side_mm` instead. * **Can't size this model by height**: At the requested height, or the default 150 mm, the model's longest side would be outside 1 to 1,000 mm. It also happens when the model is flat, or when Meshy can't determine its size. Send `intended_print_longest_side_mm` instead. For a `.glb` `model_url` and some `input_task_id` tasks, Meshy finds this only after the task starts, and the task ends as `FAILED` instead. * **STL size unusable**: The request has `printer_type` without a size, and Meshy can't read the `.stl` file's own longest side, or it's outside 1 to 1,000 mm. Send `intended_print_longest_side_mm`. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` `input_task_id` is a bas-relief model, which this endpoint can't repair. The message is `This model type does not support this operation`. Send a different model. - `404 - Not Found` The `input_task_id` task doesn't exist or belongs to another user. Check the ID, and use an API key from the account that created the task. - `429 - Too Many Requests` You exceeded your rate limit, or you have too many pending tasks. Wait, then retry. See [Rate limits](/api/rate-limits). **cURL** ```bash # Repair an existing task curl https://api.meshy.ai/openapi/v1/print/repair \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578" }' # Or repair a model URL directly curl https://api.meshy.ai/openapi/v1/print/repair \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "model_url": "https://example.com/model.stl" }' # Also thicken walls that are too thin for a 100 mm tall SLA print curl https://api.meshy.ai/openapi/v1/print/repair \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "printer_type": "sla", "intended_print_height_mm": 100 }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", // Optional: also thicken walls that are too thin for a 100 mm tall SLA print printer_type: "sla", intended_print_height_mm: 100 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/print/repair', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", # Optional: also thicken walls that are too thin for a 100 mm tall SLA print "printer_type": "sla", "intended_print_height_mm": 100, } headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.post( "https://api.meshy.ai/openapi/v1/print/repair", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9" } ``` --- ## GET /openapi/v1/print/repair/:id -- Get a Repair Printability task Returns a Repair Printability task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Repair Printability task object](#the-repair-printability-task-object). Its `model_urls` field is empty until the task is `SUCCEEDED`. After that, it has only the key that matches the input format. A wall-thickness repair includes `intended_print` from the start, and `print_repair_report` after the task succeeds. **cURL** ```bash curl https://api.meshy.ai/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/print/repair/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/print/repair/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-repair", "status": "SUCCEEDED", "progress": 100, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000030000, "expires_at": 1715725401000, "task_error": null, "model_urls": { "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***", "texture_urls": [], "consumed_credits": 10 } ``` **Response (wall thickness checked)** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-repair", "status": "SUCCEEDED", "progress": 100, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000090000, "expires_at": 1715725490000, "task_error": null, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***", "texture_urls": [], "consumed_credits": 10, "intended_print": { "printer_type": "sla", "height_mm": 100, "longest_side_mm": 118, "wall_thickness_mm": 0.8, "dimensions_mm": [118, 72.41, 99.87] }, "print_repair_report": { "route": "thin_wall", "applied": true, "faces_before": 243112, "faces_after": 251870, "thin_area_ratio_before": 0.083, "thin_area_ratio_after": 0.004 } } ``` --- ## DELETE /openapi/v1/print/repair/:id -- Delete a Repair Printability task Permanently deletes a Repair Printability task, including its repaired model. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/print/repair/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/print/repair/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/print/repair -- List Repair Printability tasks Returns a list of your Repair Printability tasks. ### Parameters - `page_num` · *integer* · default: `1` The page number to return, starting at `1`. - `page_size` · *integer* · default: `10` The number of tasks per page, up to `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Repair Printability task objects](#the-repair-printability-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/print/repair?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/print/repair?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/print/repair", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-repair", "status": "SUCCEEDED", "progress": 100, "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000030000, "expires_at": 1715725401000, "task_error": null, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***", "texture_urls": [], "consumed_credits": 10 } ] ``` --- ## GET /openapi/v1/print/repair/:id/stream -- Stream a Repair Printability task Streams a Repair Printability task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Repair Printability task objects](#the-repair-printability-task-object) as Server-Sent Events. Each event holds the full task object, in the same shape the Get endpoint returns. While the task is `PENDING` or `IN_PROGRESS`, its output fields are empty (`null`, `[]`, or `{}`), and `finished_at` is `0`. `model_urls` is an empty object until the task is `SUCCEEDED`. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is abbreviated to the fields that change. event: message data: { "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f", "progress": 0, "status": "PENDING" } event: message data: { "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f", "type": "print-repair", "status": "SUCCEEDED", "progress": 100, "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000030000, "expires_at": 1715725401000, "task_error": null, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/preview.png?Expires=***", "texture_urls": [], "consumed_credits": 10 } ``` --- ## The Repair Printability task object A Repair Printability task object describes one repair of a 3D model. It holds the status, the progress, and the repaired model when the task succeeds. - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `print-repair`. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's `0` until the task finishes. - `task_error` · *object* The error details when the task fails. It's `null` if the task hasn't failed. See [Errors](/api/errors#task-errors). - `message` · *string* A description of what went wrong. - `model_urls` · *object* Download URLs for the repaired model. **It has only the key that matches the input format.** A format the task didn't generate has no key, rather than an empty string. - `glb` · *string* The repaired GLB file. Set when the input was a GLB file or you sent `input_task_id`. - `gltf` · *string* The repaired glTF file. Set when the input was a glTF file. - `fbx` · *string* The repaired FBX file. Set when the input was an FBX file. - `obj` · *string* The repaired OBJ file. Set when the input was an OBJ file. - `stl` · *string* The repaired STL file. Set when the input was an STL file. - `thumbnail_url` · *string* Download URL for a preview image of the repaired model. - `alpha_thumbnail_url` · *string* Download URL for a version of `thumbnail_url` with a transparent background (RGBA). Present only when you created the task with `alpha_thumbnail: true` and Meshy rendered the transparent preview. - `texture_urls` · *array* Always an empty array. Repair keeps only the input geometry and doesn't re-bake textures. - `consumed_credits` · *integer* The number of credits the task used. It's `10` when the task is `SUCCEEDED`, and `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. - `intended_print` · *object* The printer and size the repair used, whether you sent them or Meshy reused them from an Analyze Printability task. Present on a wall-thickness repair from the start, including while the task is `PENDING`. A value Meshy doesn't know yet is `null`. - `printer_type` · *string* The printer type, `fdm`, `sla`, or `full_color`. - `height_mm` · *number* The print height, in millimeters, when the print is sized by height. Otherwise, it's `null`. - `longest_side_mm` · *number* The length of the print's longest side, in millimeters. When the print is sized by height, Meshy calculates it from the model's proportions, and it's `null` until Meshy measures the model. - `wall_thickness_mm` · *number* The minimum wall thickness for `printer_type`, in millimeters. - `dimensions_mm` · *array* The print's `[width, depth, height]`, in millimeters. The height can differ from `height_mm` by a fraction of a millimeter. It's `null` until the task succeeds, and always `null` for input other than GLB. - `print_repair_report` · *object* What the wall-thickness repair did. Present after a wall-thickness repair succeeds. - `route` · *string* Which repair ran, one of: * `thin_wall`: more than 5% of the surface was too thin, so wall thickening also ran. To see whether it changed the mesh, check `applied`. * `topology`: the walls were thick enough, so only the topology repair ran. * `topology_unmeasured`: Meshy couldn't measure the walls, so only the topology repair ran. - `applied` · *boolean* Whether the wall thickening changed the mesh. Present only when `route` is `thin_wall`. - `faces_before` · *integer* The face count of the input mesh. Present only when `route` is `thin_wall`. - `faces_after` · *integer* The face count of the repaired mesh. Present only when `route` is `thin_wall`. - `thin_area_ratio_before` · *number* The share of the input's surface thinner than `intended_print.wall_thickness_mm`, from `0` to `1`. Left out when Meshy couldn't measure the input. - `thin_area_ratio_after` · *number* The same share, measured on the repaired model. Left out when Meshy couldn't measure it. The task still succeeds. **The Repair Printability Task Object** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-repair", "status": "SUCCEEDED", "progress": 100, "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000030000, "expires_at": 1715725401000, "task_error": null, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***", "texture_urls": [], "consumed_credits": 10 } ``` **The Repair Printability Task Object (wall thickness checked)** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-repair", "status": "SUCCEEDED", "progress": 100, "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000090000, "expires_at": 1715725490000, "task_error": null, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***", "texture_urls": [], "consumed_credits": 10, "intended_print": { "printer_type": "sla", "height_mm": 100, "longest_side_mm": 118, "wall_thickness_mm": 0.8, "dimensions_mm": [118, 72.41, 99.87] }, "print_repair_report": { "route": "thin_wall", "applied": true, "faces_before": 243112, "faces_after": 251870, "thin_area_ratio_before": 0.083, "thin_area_ratio_after": 0.004 } } ``` --- # Auto Split API Source: https://docs.meshy.ai/api/auto-split # Auto Split API Split a 3D model into parts you can print separately. Meshy chooses the cuts, or cuts along the parts or color regions you name, and can add connectors. Meshy always reinforces the thin regions a cut leaves, so every part prints solid. > **Note:** **By default, the split model doesn't keep the input's texture.** You can split a textured model, so you don't need to regenerate it with `should_texture: false`. Meshy rebuilds the cut parts and gives each one a flat vertex color. To keep the texture on every part, send `keep_texture: true`. --- ## POST /openapi/v1/print/split -- Create an Auto Split task Creates an Auto Split task. The task cuts the model of a previous task into parts you can print separately. It returns the split model, with each part as its own object in the file. The task runs in the background. For how long a task usually takes, see [Processing times](/api/task-lifecycle#processing-times). ### Parameters - `input_task_id` · *string* · **required** The ID of the task whose model to split. The task must have the status `SUCCEEDED`. These task types work: * [Image to 3D](/api/image-to-3d) * [Multi-Image to 3D](/api/multi-image-to-3d#create-a-multi-image-to-3d-task) * [Text to 3D](/api/text-to-3d), a preview or refine task * [Retexture](/api/retexture) * [Remesh](/api/remesh) * [Convert](/api/convert) * [Resize](/api/resize) The model must be generated with Meshy 6 or Meshy 7, that is, with `ai_model` set to `meshy-6-lite`, `meshy-6`, `meshy-7`, `meshy-7.1`, or `latest`. Smart Topology models (`meshy-t2` and `meshy-t2.5`) aren't supported. For a refine, Retexture, Remesh, Convert, or Resize task, the rule applies to the model the task started from. A Retexture, Remesh, Convert, or Resize task made from an uploaded model returns `400`. The model can have at most 8,000,000 faces. A model with more faces returns `400`. In that case, run a Remesh task on it first, and send the Remesh task's ID instead. You can split a textured model. To keep its texture on the parts, send `keep_texture: true`. - `mode` · *string* · default: `auto` How to divide the model into parts. Available values: * `auto`: Meshy chooses the cuts and ignores `prompt`. A `prompt` over 600 characters still returns `400`. * `by_parts`: Meshy cuts along the structural parts you name in `prompt`, for example head, arms, and torso. * `by_color`: Meshy cuts along the color regions you name in `prompt`. Meshy finds the regions in the source image, not in the input model's texture. The input must be generated from an uploaded image, with [Image to 3D](/api/image-to-3d) or [Multi-Image to 3D](/api/multi-image-to-3d). Other inputs return `400`. For Multi-Image to 3D, Meshy uses the first source image. **Only when `mode` is set:** - `prompt` · *string* · **required** The parts to split the model into, in any language, up to 600 characters. Longer text returns `400`, even when `mode` is `auto`. Meshy reads 1 to 10 part names from the prompt, so name the parts rather than describing the model. For example, `split into the figure and the base` or `head, torso, left arm, right arm, legs`. You can name a single part. Everything you don't name becomes one more part, so `the head` splits the model into the head and the rest, as in the web app. A prompt that asks for no split, or names more than 10 parts, returns `400`, and Meshy doesn't charge for it. If Meshy can't read any part names from the prompt, it uses the model's reference image instead. It splits along the parts it finds there, in the mode you chose. The task still runs, Meshy charges for it, and the task has `prompt_ignored: true`. If the model has no reference image, or Meshy finds fewer than 2 parts in it, the request returns `400`, and Meshy doesn't charge for it. - `target_formats` · *array* · default: `["glb"]` The file formats to generate. Meshy always generates `glb` and returns it in `model_urls`, plus the other formats you list. Available values: * `glb` * `obj` * `fbx` * `stl` * `usdz` * `blend` * `3mf` Every format except `stl` supports scene objects and holds each part as a separate object. An STL file can't hold separate objects, so Meshy fuses the parts into one solid, arranged by `layout`. To get parts you can select separately in a slicer, request `3mf`. With `keep_texture: true`, these formats hold the texture: * `glb`, `fbx`, `usdz`, and `blend`: The texture is in the file. * `obj`: The texture is in the material file, which `model_urls` returns under `mtl`. * `stl` and `3mf`: The file holds geometry only, without the texture. - `layout` · *string* · default: `assembled` How Meshy arranges the parts, in every file format and in the thumbnail. Available values: * `assembled`: Meshy keeps the parts where they were in the source model. * `on_plate`: Meshy lays the parts flat and spreads them out on the build plate, ready to slice. This is the same arrangement as the On Plate view in the web app. In both layouts, Meshy removes any collapsed sliver or point-like piece a cut leaves before export, so every part you get is printable. Formats that support scene objects hold one object per part, and `stl` fuses the parts into one solid. - `keep_texture` · *boolean* · default: `false` Whether to keep the input model's texture on the parts. `true` gives every part the input's texture, and the task returns the maps in `texture_urls`. `false` gives each part a flat vertex color. With `true`, the task takes about twice as long, and the credit cost doesn't change. An untextured input splits the same way as with `false`. If Meshy can't keep the texture, the task fails with the error code `textured_split_refused`. See [Errors](/api/errors#textured-split-refused). - `connectors` · *boolean* · default: `false` Whether to add mortise-and-tenon connectors at each cut, so the printed parts fit together. **Only when `connectors` is set:** - `connector_type` · *string* · default: `cube` The connector's shape at each cut surface, `cube` or `cylinder`. - `connector_size` · *number* · default: `0.5` The connector's size, relative to the cut surface, from `0.1` to `0.8`. A value outside this range returns `400`, even when `connectors` is `false`. - `connector_height` · *number* · default: `0.1` How far the connector sticks out of the cut surface, relative to the cut surface, from `0.1` to `0.8`. A value outside this range returns `400`, even when `connectors` is `false`. ### Returns The `result` field of the response holds the ID of the new Auto Split task. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing prompt**: `mode` is `by_parts` or `by_color`, and `prompt` is missing. * **Prompt describes no split, or too many parts**: The prompt asks to keep the model in one piece, or names more than 10 parts. `by_parts` and `by_color` accept 1 to 10 named parts. Meshy doesn't charge for the request. * **Unsupported input task**: `input_task_id` isn't a succeeded task of a supported type, generated with Meshy 6 or Meshy 7. * **No reference image**: `mode` is `by_color`, and the input wasn't generated from an uploaded image. * **Out-of-range connector**: `connector_size` or `connector_height` is outside `0.1` to `0.8`. Fix the request, then send it again. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` One of these applies: * Content moderation blocked the prompt. The message is `explicit content` or `prohibited content`. Change the prompt, then retry. * `input_task_id` is a bas-relief model, which this endpoint can't split. The message is `This model type does not support this operation`. Send a different model. - `404 - Not Found` `input_task_id` doesn't exist or doesn't belong to your account. Check the ID, and use an API key from the account that created the task. - `429 - Too Many Requests` You exceeded your rate limit. Wait, then retry. See [Rate limits](/api/rate-limits). `by_parts` and `by_color` requests also share a prompt-reading limit of 12 requests per minute per account. - `503 - Service Unavailable` Splitting by prompt (`by_parts` and `by_color`) is temporarily unavailable. Retry later, or send `mode: "auto"`, which still works. Meshy doesn't charge for the request. **cURL** ```bash # Simple request: let Meshy choose the cuts curl https://api.meshy.ai/openapi/v1/print/split \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578" }' # Advanced request: name the parts, keep the texture, add connectors, export glb and obj curl https://api.meshy.ai/openapi/v1/print/split \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "mode": "by_parts", "prompt": "split into the figure and the base", "target_formats": ["glb", "obj"], "layout": "on_plate", "keep_texture": true, "connectors": true, "connector_type": "cylinder", "connector_size": 0.4 }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Simple request: let Meshy choose the cuts const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578" }; // Advanced request: name the parts, keep the texture, add connectors, export glb and obj const advancedPayload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", mode: "by_parts", prompt: "split into the figure and the base", target_formats: ["glb", "obj"], layout: "on_plate", keep_texture: true, connectors: true, connector_type: "cylinder", connector_size: 0.4 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/print/split', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Simple request: let Meshy choose the cuts payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578" } # Advanced request: name the parts, keep the texture, add connectors, export glb and obj advanced_payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "mode": "by_parts", "prompt": "split into the figure and the base", "target_formats": ["glb", "obj"], "layout": "on_plate", "keep_texture": True, "connectors": True, "connector_type": "cylinder", "connector_size": 0.4 } response = requests.post( "https://api.meshy.ai/openapi/v1/print/split", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9" } ``` --- ## GET /openapi/v1/print/split/:id -- Get an Auto Split task Returns an Auto Split task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Auto Split task object](#the-auto-split-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/print/split/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/print/split/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-split", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/texture_0_metallic.png?Expires=***", "normal": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/texture_0_normal.png?Expires=***", "roughness": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/texture_0_roughness.png?Expires=***" } ], "part_count": 4, "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000082000, "task_error": null, "consumed_credits": 10 } ``` --- ## DELETE /openapi/v1/print/split/:id -- Delete an Auto Split task Permanently deletes an Auto Split task, including its models and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED`, `FAILED`, or `CANCELED`, then delete it. Deleting a task in a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) doesn't refund its credits. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = 'a43b5c6d-7e8f-901a-234b-567c890d1e2f' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/print/split/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "a43b5c6d-7e8f-901a-234b-567c890d1e2f" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/print/split/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/print/split -- List Auto Split tasks Returns a list of your Auto Split tasks. ### Parameters - `page_num` · *integer* The page number to return. Starts at and defaults to `1`. - `page_size` · *integer* The number of tasks per page, up to `100`. Defaults to `10`. Meshy treats a larger value as `100`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Auto Split task objects](#the-auto-split-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/print/split?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/print/split?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/print/split", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-split", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***", "part_count": 4, "progress": 100, "status": "SUCCEEDED", "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000082000, "task_error": null, "consumed_credits": 10 } ] ``` --- ## GET /openapi/v1/print/split/:id/stream -- Stream an Auto Split task Streams an Auto Split task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Auto Split task objects](#the-auto-split-task-object) as Server-Sent Events. Each `message` event holds the full task object, the same one [Get an Auto Split task](#retrieve-an-auto-split-task) returns. That includes `consumed_credits`, the timestamps, and `prompt_ignored`. While the task is `PENDING` or `IN_PROGRESS`, the fields that change between events are `progress`, `status`, `started_at`, and `preceding_tasks`. `model_urls` and `thumbnail_url` get their values, and `part_count` appears, when the task reaches `SUCCEEDED`. An `error` event holds only `status_code` and `message`, so check the event name before you read `status`. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream', headers=headers, stream=True ) event = 'message' for line in response.iter_lines(): if not line: continue if line.startswith(b'event:'): event = line.decode('utf-8')[6:].strip() elif line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(event, data) if event == 'error': break # {"status_code": ..., "message": ...} if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress (other task fields omitted here for brevity; // each frame is the full task object). event: message data: { "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f", "progress": 0, "status": "PENDING" } event: message data: { "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f", "type": "print-split", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/model.glb?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/preview.png?Expires=***", "part_count": 4, "progress": 100, "status": "SUCCEEDED", "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000082000, "task_error": null, "consumed_credits": 10 } ``` --- ## The Auto Split task object An Auto Split task object describes one split of a 3D model. It holds the status, the progress, and the part files when the task succeeds. It doesn't include the prompt fields of other task objects, such as `name`, `object_prompt`, and `texture_prompt`. It also has no single `model_url`. `thumbnail_url`, `model_urls`, and the timestamps fill in as the task runs. They're always present, and empty until they have a value. - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `print-split`. - `model_urls` · *object* Download URLs for the split model, one per format you requested. A format you didn't request has no key. Formats that support scene objects keep each part as a separate object, and `stl` fuses the parts into one solid. - `glb` · *string* The GLB file. - `obj` · *string* The OBJ file. - `mtl` · *string* The MTL file. Present with an OBJ file when `keep_texture` is `true` and the input model is textured. - `fbx` · *string* The FBX file. - `stl` · *string* The STL file, with all parts fused into one solid. To get parts you can select separately, request `3mf`. - `usdz` · *string* The USDZ file. - `blend` · *string* The Blender file. - `3mf` · *string* The 3MF file. - `thumbnail_url` · *string* Download URL for a preview image of the split model, in the `layout` you requested. When the parts keep a texture, the preview shows it. Otherwise, each part has its own color. - `texture_urls` · *array* The texture maps of the split model, as an array with one object. All parts share these maps. Present only when `keep_texture` is `true` and the input model is textured. - `base_color` · *string* Download URL for the base color map. - `metallic` · *string* Download URL for the metallic map. Absent when the input has no metallic map. - `normal` · *string* Download URL for the normal map. Absent when the input has no normal map. - `roughness` · *string* Download URL for the roughness map. Absent when the input has no roughness map. - `alpha_thumbnail_url` · *string* Download URL for a version of `thumbnail_url` with a transparent background (RGBA). Present only after the task succeeds, when Meshy rendered the transparent preview. - `prompt_ignored` · *boolean* Whether Meshy ignored the prompt. It's `true` when the `prompt` of a `by_parts` or `by_color` request named no parts, so Meshy split the model automatically instead. The part names in the result are then Meshy's, not yours. Present from `PENDING` on. Meshy leaves it out for `auto` tasks and whenever it followed the prompt. - `part_count` · *integer* The number of printable parts the split produced. Formats that support scene objects hold one object per part. `stl` fuses the parts into one solid, but `part_count` still counts them. Before export, Meshy removes collapsed slivers that can't become a printable part, and doesn't count them. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`, or `CANCELED`. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The value is meaningful only while the task is `PENDING`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's `0` until the task finishes. - `task_error` · *object* The error details when the task fails. See [Errors](/api/errors#task-errors). If a safety check declines the input model, the task fails with `task_error.type` set to `invalid_input` and `task_error.code` set to `provider_content_refused`. Send a different model. See [Errors](/api/errors#invalid-input). With `keep_texture: true`, if Meshy can't keep the texture, the task fails with `task_error.code` set to `textured_split_refused`. See [Errors](/api/errors#textured-split-refused). - `consumed_credits` · *integer* The number of credits the task used. It's always present. It's `10` after Meshy accepts the task, and `0` for a `FAILED` task, because Meshy refunds the credits when a task fails. Deleting a `PENDING` task also refunds it. **The Auto Split Task Object** ```json { "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9", "type": "print-split", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/texture_0.png?Expires=***", "metallic": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/texture_0_metallic.png?Expires=***", "normal": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/texture_0_normal.png?Expires=***", "roughness": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/texture_0_roughness.png?Expires=***" } ], "part_count": 4, "progress": 100, "status": "SUCCEEDED", "preceding_tasks": 0, "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000082000, "task_error": null, "consumed_credits": 10 } ``` --- # Relief API Source: https://docs.meshy.ai/api/relief # 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/v1/relief -- Create a Relief task Creates a Relief task. The task turns a photo into a bas-relief model. When it succeeds, the task produces the model as a GLB file and an STL file, 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. A Relief task can't be the input of another endpoint, such as Remesh, Convert, or Auto Split. Those requests return `403`. ### Parameters - `image_url` · *string* · **required** 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. - `variant` · *string* · default: `low` The relief style. It shapes the depth map and sets the default `carving_depth_mm`. 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`. - `should_generate_model` · *boolean* · default: `true` 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, and resolution parameters, but doesn't use them. It doesn't change the credit cost. - `size_mm` · *number* · default: `60` 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. - `carving_mode` · *string* · default: `emboss` Whether the subject stands out from the plate or is cut into it. 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. - `carving_depth_mm` · *number* · default: `6 (high), 3 (low)` 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 GLB and STL files have no geometry. - `remove_base` · *boolean* · default: `false` 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. **Only when `remove_base` is set:** - `removal_threshold` · *number* · default: `0.01` 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. - `base_thickness_mm` · *number* · default: `1, or 0 with remove_base` The thickness of the base plate, from `0.1` to `10` millimeters. When `remove_base` is `true`, leave it out or send `0`. - `bend_mode` · *string* · default: `off` 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. Available values: * `off`: a flat relief. * `convex`: the front bulges outward. * `concave`: the front curves inward. **Only when `bend_mode` is set:** - `bend_axis` · *string* · default: `xz` Which edges the bend curls. Available values: * `xz`: the left and right edges. * `yz`: the top and bottom edges. - `bend_angle` · *number* · default: `60` The arc the bend spans, from `0` to `360` degrees. Below `1`, the relief stays flat. - `mesh_resolution` · *integer* · default: `1024` 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`. ### Returns `202 Accepted`, with the ID of the new Relief task in `result`. ### Failure modes - `400 - Bad Request` The request can't run. The error message says which problem it found. For example: * **Missing parameter**: `image_url` wasn't sent. * **Invalid parameter**: 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`, or `mesh_resolution` isn't an integer from `512` to `2048`. * **Base thickness**: `base_thickness_mm` isn't `0` with `remove_base` set to `true`, or is below `0.1` without it. * **Unreachable URL**: Meshy can't download the `image_url` image, for example because the URL returns `404` or times out. * **Invalid image**: 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. * **Extreme aspect ratio**: The image's longer side is more than about 16 times its shorter side. Fix the request, then send it again. Meshy doesn't charge for it. See [Errors](/api/errors#request-errors). - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `402 - Payment Required` For example: * **Insufficient credits**: The account doesn't have enough credits for this task, or the account reached a credit limit. Check your credit balance, then retry. * **Free plan**: Creating a task requires a paid plan. Upgrade your plan in your [subscription settings](https://www.meshy.ai/settings/subscription), then retry. - `403 - Forbidden` Content moderation blocked the image. Meshy doesn't charge for the request. Send a different image. - `429 - Too Many Requests` One of these limits was reached: * You sent too many requests. Wait, then retry. See [Rate limits](/api/rate-limits). * 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](/api/errors#invalid-input). **cURL** ```bash # Simple request: a low relief, 60 mm on its longer side curl https://api.meshy.ai/openapi/v1/relief \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "" }' # Advanced request: a deep 120 mm relief with a thicker base, curved from side to side curl https://api.meshy.ai/openapi/v1/relief \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "", "variant": "high", "size_mm": 120, "carving_depth_mm": 10, "base_thickness_mm": 3, "bend_mode": "convex", "bend_angle": 90 }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Simple request: a low relief, 60 mm on its longer side const payload = { image_url: "" }; // Advanced request: a deep 120 mm relief with a thicker base, curved from side to side const advancedPayload = { image_url: "", variant: "high", size_mm: 120, carving_depth_mm: 10, base_thickness_mm: 3, bend_mode: "convex", bend_angle: 90 }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/v1/relief', payload, // or advancedPayload { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Simple request: a low relief, 60 mm on its longer side payload = { "image_url": "" } # Advanced request: a deep 120 mm relief with a thicker base, curved from side to side advanced_payload = { "image_url": "", "variant": "high", "size_mm": 120, "carving_depth_mm": 10, "base_thickness_mm": 3, "bend_mode": "convex", "bend_angle": 90 } response = requests.post( "https://api.meshy.ai/openapi/v1/relief", headers=headers, json=payload, # or advanced_payload ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20" } ``` --- ## GET /openapi/v1/relief/:id -- Get a Relief task Returns a Relief task by its ID. ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Relief task object](#the-relief-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/relief/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20'; const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/relief/${taskId}`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests task_id = "0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( f"https://api.meshy.ai/openapi/v1/relief/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20", "type": "relief", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/model.glb?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/model.stl?Expires=***" }, "depth_map_url": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/depth.png?Expires=***", "thumbnail_url": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/preview.png?Expires=***", "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000060000, "expires_at": 1700259260000, "task_error": null, "consumed_credits": 20 } ``` --- ## DELETE /openapi/v1/relief/:id -- Delete a Relief task Permanently deletes a Relief task, including its model, depth map, and data. You can't undo a delete. ### Path parameters - `id` · *path* The ID of the task to delete. ### Task status Deleting a `PENDING` task refunds the credits it used when you created it. An `IN_PROGRESS` task can't be deleted. The request returns `409 Conflict`, and the task keeps running. Meshy doesn't refund a task that has started, so deleting it would cost you both the credits and the result. Wait for it to reach `SUCCEEDED` or `FAILED`, then delete it. Deleting a `SUCCEEDED` task doesn't refund its credits. A `FAILED` task was already refunded when it failed. ### Returns `200 OK` when the task is deleted, or `409 Conflict` when the task is `IN_PROGRESS`. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/v1/relief/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/v1/relief/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/v1/relief/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // 200 OK on success, with an empty body. // // 409 Conflict when the task is IN_PROGRESS. The task keeps running: { "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it." } ``` --- ## GET /openapi/v1/relief -- List Relief tasks Returns a list of your Relief tasks. ### Parameters - `page_num` · *integer* The page number to return. Starts at and defaults to `1`. - `page_size` · *integer* The number of tasks per page, up to `100`. Defaults to `10`. Meshy treats a value from `101` to `255` as `100`, and a larger value returns `400`. - `sort_by` · *string* The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first ### Returns A paginated list of [Relief task objects](#the-relief-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/v1/relief?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; try { const response = await axios.get( `https://api.meshy.ai/openapi/v1/relief?page_size=10`, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/relief", headers=headers, params={"page_size": 10} ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20", "type": "relief", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/model.glb?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/model.stl?Expires=***" }, "depth_map_url": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/depth.png?Expires=***", "thumbnail_url": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/preview.png?Expires=***", "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000060000, "expires_at": 1700259260000, "task_error": null, "consumed_credits": 20 } ] ``` --- ## GET /openapi/v1/relief/:id/stream -- Stream a Relief task Streams a Relief task's updates as Server-Sent Events (SSE). ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Relief task objects](#the-relief-task-object) as Server-Sent Events. Each `message` event holds the full task object, the same one [Get a Relief task](#retrieve-a-relief-task) returns. While the task is `PENDING` or `IN_PROGRESS`, the fields that change between events are `progress`, `status`, `started_at`, and `preceding_tasks` (present only while tasks are ahead of this one). `model_urls`, `depth_map_url`, and `thumbnail_url` get their values when the task reaches `SUCCEEDED`. A depth-map-only task keeps `model_urls` `{}` and an empty `thumbnail_url`. An `error` event holds only `status_code` and `message`, so check the event name before you read `status`. **cURL** ```bash curl -N https://api.meshy.ai/openapi/v1/relief/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/v1/relief/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; let event = 'message'; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('event:')) { event = line.slice(6).trim(); } else if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(event, data); if (event === 'error') { reader.cancel(); // {"status_code": ..., "message": ...} } else if (['SUCCEEDED', 'FAILED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/v1/relief/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/stream', headers=headers, stream=True ) event = 'message' for line in response.iter_lines(): if not line: continue if line.startswith(b'event:'): event = line.decode('utf-8')[6:].strip() elif line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(event, data) if event == 'error': break # {"status_code": ..., "message": ...} if data['status'] in ['SUCCEEDED', 'FAILED']: break response.close() ``` **Response Stream** ```javascript // Error event example event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress (other task fields omitted here for brevity; // each frame is the full task object). event: message data: { "id": "0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20", "progress": 0, "status": "PENDING" } event: message data: { "id": "0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20", "type": "relief", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/model.glb?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/model.stl?Expires=***" }, "depth_map_url": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/depth.png?Expires=***", "thumbnail_url": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/preview.png?Expires=***", "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000060000, "expires_at": 1700259260000, "task_error": null, "consumed_credits": 20 } ``` --- ## The Relief task object A Relief task object describes one relief made from a photo. `model_urls`, `depth_map_url`, and `thumbnail_url` are always present, and empty until the task succeeds. - `id` · *string* The task ID. Treat it as an opaque string, and don't rely on its format. - `type` · *string* The task type, always `relief`. - `model_urls` · *object* Download URLs for the relief model. The files can be large; [`mesh_resolution`](#create-a-relief-task) lists typical sizes. - `glb` · *string* The GLB file, without texture. Its units are meters. Absent for a depth-map-only task. - `stl` · *string* The same model as a binary STL file. Its units are millimeters, so it opens at the relief's real size, with Z up. Absent for a depth-map-only task. - `depth_map_url` · *string* Download URL for 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. Empty if there is none. - `thumbnail_url` · *string* Download URL for a preview image of the relief model. Empty if none was rendered, including for a depth-map-only task. - `progress` · *integer* How much of the task is done, as a percentage. It's `0` until the task starts and `100` when it succeeds. - `status` · *string* The task status, one of `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, or `FAILED`. - `preceding_tasks` · *integer* The number of tasks ahead of this one in the queue. The field is left out when the value is `0`, so it appears only while tasks are ahead of this one. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time the task started, in Unix milliseconds. It's `0` until the task starts. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. It's `0` until the task finishes. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's `0` until the task finishes. - `task_error` · *object* The error details when the task fails. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* The number of credits the task used: `20`, or `0` for a `FAILED` task, which Meshy refunds. **The Relief Task Object** ```json { "id": "0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20", "type": "relief", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/model.glb?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/model.stl?Expires=***" }, "depth_map_url": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/depth.png?Expires=***", "thumbnail_url": "https://assets.meshy.ai/***/tasks/0199c3d2-5a7e-7b14-9e2f-3c8d1a6b4f20/output/preview.png?Expires=***", "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000060000, "expires_at": 1700259260000, "task_error": null, "consumed_credits": 20 } ``` **Depth map only** ```json { "id": "0199c3d2-6b8f-7c25-8f3a-4d9e2b7c5a31", "type": "relief", "model_urls": {}, "depth_map_url": "https://assets.meshy.ai/***/tasks/0199c3d2-6b8f-7c25-8f3a-4d9e2b7c5a31/output/depth.png?Expires=***", "thumbnail_url": "", "progress": 100, "status": "SUCCEEDED", "created_at": 1699999999000, "started_at": 1700000000000, "finished_at": 1700000030000, "expires_at": 1700259230000, "task_error": null, "consumed_credits": 20 } ``` --- # Creative Lab — Keychain API Source: https://docs.meshy.ai/api/creative-lab-keychain # Creative Lab Keychain API Turn a photo into a 3D-printable keychain with a colored relief in two stages. A prototype task generates a colorized concept image from the photo. A build task turns that image into a relief 3D model, and takes the prototype task's ID as `input_task_id`. - `POST /openapi/creative-lab/keychain/v1/prototype` - `POST /openapi/creative-lab/keychain/v1/build` --- ## POST /openapi/creative-lab/keychain/v1/prototype -- Create a Keychain prototype task Generates one colorized concept image from a photo. To build the 3D model, pass this task's ID to the [build endpoint](#create-a-keychain-build-task) as `input_task_id`. For the task's fields, see [The Keychain prototype task object](#the-keychain-prototype-task-object). ### Parameters - `image_url` · *string* · **required** The photo to turn into a keychain concept image, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. It labels the task in your dashboard and task lists, and doesn't appear on the keychain. To put a name on the keychain, use `name_text`. - `name_text` · *string* A name to add to the keychain, such as a pet's or a person's name, up to 10 characters. Meshy counts characters, not bytes, so a 10-character Chinese, Japanese, or Korean name fits. A longer name returns `400`. Leave it out for a keychain with no name. The name appears on the keychain's face as a flat colored detail, not as raised or cut text. Meshy trims surrounding whitespace and removes invisible formatting characters. The [prototype task object](#the-keychain-prototype-task-object) returns the result as `name_text`, so you can check the text before you pay for the build. Meshy adds the name at the prototype stage. The [build](#create-a-keychain-build-task) keeps it, and ignores a `name_text` sent to the build endpoint. > **Note:** When the text isn't plain ASCII, send the request body as UTF-8 with `Content-Type: application/json; charset=utf-8`. Some HTTP clients, such as Windows PowerShell's `Invoke-RestMethod`, encode the body as ISO-8859-1 by default. That turns every non-Latin character into `?` before the request reaches Meshy, and Meshy can't tell it apart from a name you meant to send. - `remove_background` · *boolean* · default: `false` Whether to remove the background from the prototype image. `true` returns a transparent RGBA PNG that keeps the whole medallion, so you can place it on any background. The build also starts from the image without its background. If Meshy can't remove the background, it returns the image with its background, and the task still succeeds. The build's `remove_background` option is separate. ### Returns The `result` field holds the ID of the new prototype task. [Get the task](#retrieve-a-keychain-task) or [stream it](#stream-a-keychain-task) until `status` is `SUCCEEDED`. Then pass the ID to the [build endpoint](#create-a-keychain-build-task) as `input_task_id`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` is missing. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * `name_text` is longer than 10 characters. Meshy rejects it instead of shortening it, and doesn't charge for the request. * The image or `name_text` was flagged as NSFW. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. Meshy checks only the image for intellectual property, not `name_text`. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 1: generate a colorized keychain concept image curl https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json; charset=utf-8' \ -d '{ "image_url": "", "name_text": "Luna" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 1: generate a colorized keychain concept image const payload = { image_url: "", name_text: "Luna", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 1: generate a colorized keychain concept image payload = { "image_url": "", "name_text": "Luna", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## POST /openapi/creative-lab/keychain/v1/build -- Create a Keychain build task Generates the 3D-printable keychain from a succeeded prototype task. Meshy turns the prototype's concept image into a depth-map relief, and returns one model file in the format you choose. For the task's fields, see [The Keychain build task object](#the-keychain-build-task-object). ### Parameters - `input_task_id` · *string* · **required** The ID of the prototype task to build. It must be a task your account created with `POST /openapi/creative-lab/keychain/v1/prototype`, with the status `SUCCEEDED`. An ID that isn't one of your Keychain prototype tasks from the API returns `404`, including a prototype made in the web app. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. #### `options` Optional settings for the relief's shape. Every field has a default, so send only the ones you want to change. A value outside a field's range returns `400`. - `badge_shape` · *string* · default: `circle` The keychain's outline when Meshy doesn't trace it from the subject. Meshy uses it when `remove_background` is `false`, or when it can't find the subject's outline. Available values: * `circle` * `rounded-rect` * `hexagon` * `shield` * `star` - `size_mm` · *number* · default: `40` The edge length of the keychain's bounding square, in millimeters, up to `400`. `0` uses the default. - `relief_height_mm` · *number* · default: `2.2` The relief's maximum height above the base, in millimeters, from `0` to `20`. - `relief_offset_mm` · *number* · default: `0` How far to lower the relief, in millimeters, from `0` to `20`. Meshy subtracts it from the relief's height everywhere, down to the base. - `base_thickness_mm` · *number* · default: `0.1` The thickness of the flat base plate behind the relief, in millimeters, from `0` to `20`. - `has_closed_back` · *boolean* · default: `true` Whether to close the back of the keychain. `false` leaves the back open, as a shell. - `relief_curve` · *string* · default: `linear` The curve that maps depth-map values to relief height. Available values: * `linear` * `gamma` * `s-curve` - `curve_param` · *number* · default: `1.0` The strength of the curve, up to `10`. The `gamma` and `s-curve` curves use it, and `linear` ignores it. `0` uses the default. - `invert_depth` · *boolean* · default: `false` Whether to invert the depth map, so darker areas become higher relief. - `smoothing` · *number* · default: `0.24` How much to smooth the depth map before Meshy builds the relief, from `0` to `10`. - `relief_scale` · *number* · default: `1.0` How much to zoom the relief and its texture inside the outline, about the center, up to `10`. A value over `1` enlarges the subject, and a value under `1` shrinks it. It doesn't change the relief's height. `0` uses the default. - `depth_threshold` · *number* · default: `0.1` The depth-map value under which Meshy sets the depth to zero, from `0` to `1`. - `remove_background` · *boolean* · default: `true` Whether to trace the keychain's outline from the subject, so the keychain follows the subject's shape. `false` uses the `badge_shape` outline instead. Meshy also uses `badge_shape` when it can't find the subject's outline. This is separate from the prototype's `remove_background` parameter, which sets whether the prototype image has a transparent background. - `export_resolution` · *integer* · default: `512` The mesh resolution of the exported model, from `64` to `512`. Meshy builds the geometry from a 512-pixel depth map, so a finer mesh would add faces without adding detail. `0` uses the default. #### `output` Optional. Sets the file format the build returns. - `format` · *string* · default: `glb` The file format the build returns. Available values: * `glb`: one `model.glb` file, in `model_urls.glb` * `obj`: a zip file with `model.obj`, `model.mtl`, and `texture.png`, in `model_urls.obj` * `zip`: a zip file with every file Meshy generates, in `model_urls.bundle_zip` ### Returns The `result` field holds the ID of the new build task. [Get the task](#retrieve-a-keychain-task) or [stream it](#stream-a-keychain-task) until `status` is `SUCCEEDED`. Then download the file from the one entry in `model_urls`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `input_task_id` is missing or isn't a valid task ID. * The prototype task's status isn't `SUCCEEDED`. If it's still running, wait and retry. If it failed or was canceled, create a new prototype task. * The prototype task succeeded but has no image. Create a new prototype task. * An `options` field is outside its range or isn't an available value. The error message says which problem it found. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `404 - Not Found` `input_task_id` doesn't match any Keychain prototype task your account created with the API. A prototype made in the web app also returns `404`. Send the `result` ID from a prototype create response. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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 # Stage 2: chain build off a succeeded prototype task curl https://api.meshy.ai/openapi/creative-lab/keychain/v1/build \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "options": { "badge_shape": "circle", "size_mm": 40, "relief_height_mm": 2.5 }, "output": { "format": "glb" } }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 2: chain build off a succeeded prototype task const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", options: { badge_shape: "circle", size_mm: 40, relief_height_mm: 2.5, }, output: { format: "glb" }, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/keychain/v1/build', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 2: chain build off a succeeded prototype task payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "options": { "badge_shape": "circle", "size_mm": 40, "relief_height_mm": 2.5, }, "output": {"format": "glb"}, } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/keychain/v1/build", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb" } ``` --- ## GET /openapi/creative-lab/keychain/v1/(prototype|build)/:id -- Get a Keychain task Returns a prototype or build task. The path must match the task's stage. A build task requested through `/prototype/:id` returns `404`, and so does a prototype task requested through `/build/:id`. For the fields, see [The Keychain prototype task object](#the-keychain-prototype-task-object) and [The Keychain build task object](#the-keychain-build-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [prototype task object](#the-keychain-prototype-task-object) or the [build task object](#the-keychain-build-task-object), matching the stage in the path. ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the prototype task's image for third-party intellectual property. Build tasks and teams on the Enterprise plan don't get this error. Create a prototype task from an image you have the rights to use. - `404 - Not Found` No Keychain task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash # Prototype curl https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # Build curl https://api.meshy.ai/openapi/creative-lab/keychain/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Prototype const prototypeId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const proto = await axios.get( `https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype/${prototypeId}`, { headers } ); console.log(proto.data); // Build const buildId = '019c320e-9a8f-7a1c-9c11-2a1876f8a9bb'; const build = await axios.get( `https://api.meshy.ai/openapi/creative-lab/keychain/v1/build/${buildId}`, { headers } ); console.log(build.data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Prototype prototype_id = "018a210d-8ba4-705c-b111-1f1776f7f578" proto = requests.get( f"https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype/{prototype_id}", headers=headers, ) proto.raise_for_status() print(proto.json()) # Build build_id = "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb" build = requests.get( f"https://api.meshy.ai/openapi/creative-lab/keychain/v1/build/{build_id}", headers=headers, ) build.raise_for_status() print(build.json()) ``` **Prototype Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-keychain-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` **Build Response** ```json { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-keychain-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***" } } ``` --- ## DELETE /openapi/creative-lab/keychain/v1/(prototype|build)/:id -- Delete a Keychain task Cancels a Keychain task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. The path must match the task's stage. For example, `DELETE` on `/prototype/:id` with a build task's ID returns `404`. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Keychain task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/keychain/v1/(prototype|build)/:id/stream -- Stream a Keychain task Streams a Keychain task's updates as Server-Sent Events (SSE). The path must match the task's stage. If it doesn't, for example a build task's ID at `/prototype/:id/stream`, the stream sends one `error` event with `status_code: 404` and closes. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [prototype](#the-keychain-prototype-task-object) or [build](#the-keychain-build-task-object) task objects. Each event has the full task object, as [Get a Keychain task](#retrieve-a-keychain-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/keychain/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/keychain/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/keychain/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (wrong stage or task not found) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is shortened to the fields that change. event: message data: { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "progress": 0, "status": "PENDING" } event: message data: { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-keychain-build", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "task_error": null, "consumed_credits": 30, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***" } } ``` --- ## GET /openapi/creative-lab/keychain/v1/(prototype|build) -- List Keychain tasks Returns your Keychain tasks of one stage, one page at a time. The path selects the stage. `/prototype` returns only prototype tasks, and `/build` returns only build tasks. ### Path parameters - `stage` · *path* · **required** The stage to list, `prototype` or `build`. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [prototype task objects](#the-keychain-prototype-task-object) or [build task objects](#the-keychain-build-task-object), matching the stage in the path. **cURL** ```bash # List prototype tasks curl https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # List build tasks curl https://api.meshy.ai/openapi/creative-lab/keychain/v1/build?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/keychain/v1/prototype", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response (List Prototype Tasks)** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-keychain-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ] ``` --- ## The Keychain prototype task object A prototype task generates a colorized concept image from a photo. To turn the image into a 3D model, pass the task's ID to the [build endpoint](#create-a-keychain-build-task) as `input_task_id`. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-keychain-prototype`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `name_text` · *string* The name Meshy added to the keychain, after trimming whitespace and removing invisible formatting characters. Left out when you didn't send `name_text`. To check that your HTTP client encoded the text correctly, compare it with what you sent. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `image_urls` · *array of strings* Download URLs for the concept image. The array has one URL after the task succeeds, and is empty until then. **Example Keychain Prototype Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-keychain-prototype", "name": "", "name_text": "Luna", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` --- ## The Keychain build task object A build task generates the 3D keychain from a succeeded prototype task. It returns one model file in the format you requested. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-keychain-build`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `model_urls` · *object* Download URLs for the model file, with one entry for the `output.format` you requested. `{}` until the task succeeds. - `glb` · *string* Download URL for the GLB file. Present when `output.format` is `glb`. - `obj` · *string* Download URL for a zip file with `model.obj`, `model.mtl`, and `texture.png`. Present when `output.format` is `obj`. - `bundle_zip` · *string* Download URL for a zip file with every file Meshy generates. Present when `output.format` is `zip`. **Example Keychain Build Task Object** ```json { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-keychain-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***" } } ``` --- # Creative Lab — Fridge Magnet API Source: https://docs.meshy.ai/api/creative-lab-fridge-magnet # Creative Lab Fridge Magnet API Turn a photo into a 3D-printable fridge magnet with a colored relief and a flat back, in two stages. A prototype task generates a colorized concept image from the photo. A build task turns that image into a relief 3D model, and takes the prototype task's ID as `input_task_id`. - `POST /openapi/creative-lab/fridge-magnet/v1/prototype` - `POST /openapi/creative-lab/fridge-magnet/v1/build` --- ## POST /openapi/creative-lab/fridge-magnet/v1/prototype -- Create a Fridge Magnet prototype task Generates one colorized concept image from a photo. To build the 3D model, pass this task's ID to the [build endpoint](#create-a-fridge-magnet-build-task) as `input_task_id`. For the task's fields, see [The Fridge Magnet prototype task object](#the-fridge-magnet-prototype-task-object). ### Parameters - `image_url` · *string* · **required** The photo to turn into a fridge magnet concept image, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. - `remove_background` · *boolean* · default: `false` Whether to remove the background from the prototype image. `true` returns a transparent RGBA PNG that keeps the whole magnet, so you can place it on any background. The build also starts from the image without its background. If Meshy can't remove the background, it returns the image with its background, and the task still succeeds. The build's `remove_background` option is separate. ### Returns The `result` field holds the ID of the new prototype task. [Get the task](#retrieve-a-fridge-magnet-task) or [stream it](#stream-a-fridge-magnet-task) until `status` is `SUCCEEDED`. Then pass the ID to the [build endpoint](#create-a-fridge-magnet-build-task) as `input_task_id`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` is missing. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * The image was flagged as NSFW. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 1: generate a colorized fridge magnet concept image curl https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 1: generate a colorized fridge magnet concept image const payload = { image_url: "", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 1: generate a colorized fridge magnet concept image payload = { "image_url": "", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9" } ``` --- ## POST /openapi/creative-lab/fridge-magnet/v1/build -- Create a Fridge Magnet build task Generates the 3D-printable fridge magnet from a succeeded prototype task. Meshy turns the prototype's concept image into a depth-map relief, and returns one model file in the format you choose. For the task's fields, see [The Fridge Magnet build task object](#the-fridge-magnet-build-task-object). ### Parameters - `input_task_id` · *string* · **required** The ID of the prototype task to build. It must be a task your account created with `POST /openapi/creative-lab/fridge-magnet/v1/prototype`, with the status `SUCCEEDED`. An ID that isn't one of your Fridge Magnet prototype tasks from the API returns `404`, including a prototype made in the web app. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. #### `options` Optional settings for the relief's shape. Every field has a default, so send only the ones you want to change. A value outside a field's range returns `400`. - `badge_shape` · *string* · default: `rounded-rect` The magnet's outline when Meshy doesn't trace it from the subject. Meshy uses it when `remove_background` is `false`, or when it can't find the subject's outline. Available values: * `circle` * `rounded-rect` * `hexagon` * `shield` * `star` - `size_mm` · *number* · default: `60` The edge length of the magnet's bounding square, in millimeters, up to `400`. `0` uses the default. - `relief_height_mm` · *number* · default: `3.3` The relief's maximum height above the base, in millimeters, from `0` to `20`. - `relief_offset_mm` · *number* · default: `0` How far to lower the relief, in millimeters, from `0` to `20`. Meshy subtracts it from the relief's height everywhere, down to the base. - `base_thickness_mm` · *number* · default: `2.0` The thickness of the flat base plate behind the relief, in millimeters, from `0` to `20`. The default 2 mm base gives the magnet enough body to grip the fridge, so the relief doesn't feel fragile. - `has_closed_back` · *boolean* · default: `true` Whether to close the back of the magnet, the side you glue the magnet to. `false` leaves the back open, as a shell. - `relief_curve` · *string* · default: `linear` The curve that maps depth-map values to relief height. Available values: * `linear` * `gamma` * `s-curve` - `curve_param` · *number* · default: `1.0` The strength of the curve, up to `10`. The `gamma` and `s-curve` curves use it, and `linear` ignores it. `0` uses the default. - `invert_depth` · *boolean* · default: `false` Whether to invert the depth map, so darker areas become higher relief. - `smoothing` · *number* · default: `0.24` How much to smooth the depth map before Meshy builds the relief, from `0` to `10`. - `relief_scale` · *number* · default: `1.0` How much to zoom the relief and its texture inside the outline, about the center, up to `10`. A value over `1` enlarges the subject, and a value under `1` shrinks it. It doesn't change the relief's height. `0` uses the default. - `depth_threshold` · *number* · default: `0.1` The depth-map value under which Meshy sets the depth to zero, from `0` to `1`. - `remove_background` · *boolean* · default: `true` Whether to trace the magnet's outline from the subject, so the magnet follows the subject's shape. `false` uses the `badge_shape` outline instead. Meshy also uses `badge_shape` when it can't find the subject's outline. This is separate from the prototype's `remove_background` parameter, which sets whether the prototype image has a transparent background. - `export_resolution` · *integer* · default: `512` The mesh resolution of the exported model, from `64` to `512`. Meshy builds the geometry from a 512-pixel depth map, so a finer mesh would add faces without adding detail. `0` uses the default. #### `output` Optional. Sets the file format the build returns. - `format` · *string* · default: `glb` The file format the build returns. Available values: * `glb`: one `model.glb` file, in `model_urls.glb` * `obj`: a zip file with `model.obj`, `model.mtl`, and `texture.png`, in `model_urls.obj` * `zip`: a zip file with every file Meshy generates, in `model_urls.bundle_zip` ### Returns The `result` field holds the ID of the new build task. [Get the task](#retrieve-a-fridge-magnet-task) or [stream it](#stream-a-fridge-magnet-task) until `status` is `SUCCEEDED`. Then download the file from the one entry in `model_urls`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `input_task_id` is missing or isn't a valid task ID. * The prototype task's status isn't `SUCCEEDED`. If it's still running, wait and retry. If it failed or was canceled, create a new prototype task. * The prototype task succeeded but has no image. Create a new prototype task. * An `options` field is outside its range or isn't an available value. The error message says which problem it found. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `404 - Not Found` `input_task_id` doesn't match any Fridge Magnet prototype task your account created with the API. A prototype made in the web app also returns `404`. Send the `result` ID from a prototype create response. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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 # Stage 2: chain build off a succeeded prototype task curl https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9", "options": { "badge_shape": "rounded-rect", "size_mm": 60, "relief_height_mm": 3.3 }, "output": { "format": "glb" } }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 2: chain build off a succeeded prototype task const payload = { input_task_id: "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9", options: { badge_shape: "rounded-rect", size_mm: 60, relief_height_mm: 3.3, }, output: { format: "glb" }, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 2: chain build off a succeeded prototype task payload = { "input_task_id": "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9", "options": { "badge_shape": "rounded-rect", "size_mm": 60, "relief_height_mm": 3.3, }, "output": {"format": "glb"}, } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0" } ``` --- ## GET /openapi/creative-lab/fridge-magnet/v1/(prototype|build)/:id -- Get a Fridge Magnet task Returns a prototype or build task. The path must match the task's stage. A build task requested through `/prototype/:id` returns `404`, and so does a prototype task requested through `/build/:id`. For the fields, see [The Fridge Magnet prototype task object](#the-fridge-magnet-prototype-task-object) and [The Fridge Magnet build task object](#the-fridge-magnet-build-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [prototype task object](#the-fridge-magnet-prototype-task-object) or the [build task object](#the-fridge-magnet-build-task-object), matching the stage in the path. ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the prototype task's image for third-party intellectual property. Build tasks and teams on the Enterprise plan don't get this error. Create a prototype task from an image you have the rights to use. - `404 - Not Found` No Fridge Magnet task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash # Prototype curl https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype/01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # Build curl https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build/01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Prototype const prototypeId = '01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9'; const proto = await axios.get( `https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype/${prototypeId}`, { headers } ); console.log(proto.data); // Build const buildId = '01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0'; const build = await axios.get( `https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build/${buildId}`, { headers } ); console.log(build.data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Prototype prototype_id = "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9" proto = requests.get( f"https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype/{prototype_id}", headers=headers, ) proto.raise_for_status() print(proto.json()) # Build build_id = "01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0" build = requests.get( f"https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build/{build_id}", headers=headers, ) build.raise_for_status() print(build.json()) ``` **Prototype Response** ```json { "id": "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9", "type": "creative-lab-fridge-magnet-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729543210000, "started_at": 1729543215000, "finished_at": 1729543242000, "expires_at": 1729802442000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` **Build Response** ```json { "id": "01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0", "type": "creative-lab-fridge-magnet-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729543250000, "started_at": 1729543258000, "finished_at": 1729543285000, "expires_at": 1729802485000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0/output/model.glb?Expires=***" } } ``` --- ## DELETE /openapi/creative-lab/fridge-magnet/v1/(prototype|build)/:id -- Delete a Fridge Magnet task Cancels a Fridge Magnet task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. The path must match the task's stage. For example, `DELETE` on `/prototype/:id` with a build task's ID returns `404`. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Fridge Magnet task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype/01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/fridge-magnet/v1/(prototype|build)/:id/stream -- Stream a Fridge Magnet task Streams a Fridge Magnet task's updates as Server-Sent Events (SSE). The path must match the task's stage. If it doesn't, for example a build task's ID at `/prototype/:id/stream`, the stream sends one `error` event with `status_code: 404` and closes. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [prototype](#the-fridge-magnet-prototype-task-object) or [build](#the-fridge-magnet-build-task-object) task objects. Each event has the full task object, as [Get a Fridge Magnet task](#retrieve-a-fridge-magnet-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build/01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build/01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build/01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (wrong stage or task not found) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is shortened to the fields that change. event: message data: { "id": "01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0", "progress": 0, "status": "PENDING" } event: message data: { "id": "01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0", "type": "creative-lab-fridge-magnet-build", "status": "SUCCEEDED", "progress": 100, "created_at": 1729543250000, "started_at": 1729543258000, "finished_at": 1729543285000, "expires_at": 1729802485000, "task_error": null, "consumed_credits": 30, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0/output/model.glb?Expires=***" } } ``` --- ## GET /openapi/creative-lab/fridge-magnet/v1/(prototype|build) -- List Fridge Magnet tasks Returns your Fridge Magnet tasks of one stage, one page at a time. The path selects the stage. `/prototype` returns only prototype tasks, and `/build` returns only build tasks. ### Path parameters - `stage` · *path* · **required** The stage to list, `prototype` or `build`. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [prototype task objects](#the-fridge-magnet-prototype-task-object) or [build task objects](#the-fridge-magnet-build-task-object), matching the stage in the path. **cURL** ```bash # List prototype tasks curl https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # List build tasks curl https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/build?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/fridge-magnet/v1/prototype", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response (List Prototype Tasks)** ```json [ { "id": "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9", "type": "creative-lab-fridge-magnet-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729543210000, "started_at": 1729543215000, "finished_at": 1729543242000, "expires_at": 1729802442000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ] ``` --- ## The Fridge Magnet prototype task object A prototype task generates a colorized concept image from a photo. To turn the image into a 3D model, pass the task's ID to the [build endpoint](#create-a-fridge-magnet-build-task) as `input_task_id`. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-fridge-magnet-prototype`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `image_urls` · *array of strings* Download URLs for the concept image. The array has one URL after the task succeeds, and is empty until then. **Example Fridge Magnet Prototype Task Object** ```json { "id": "01a3d8f1-8c2e-7d04-b223-3f3776a1c8c9", "type": "creative-lab-fridge-magnet-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729543210000, "started_at": 1729543215000, "finished_at": 1729543242000, "expires_at": 1729802442000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` --- ## The Fridge Magnet build task object A build task generates the 3D fridge magnet from a succeeded prototype task. It returns one model file in the format you requested. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-fridge-magnet-build`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `model_urls` · *object* Download URLs for the model file, with one entry for the `output.format` you requested. `{}` until the task succeeds. - `glb` · *string* Download URL for the GLB file. Present when `output.format` is `glb`. - `obj` · *string* Download URL for a zip file with `model.obj`, `model.mtl`, and `texture.png`. Present when `output.format` is `obj`. - `bundle_zip` · *string* Download URL for a zip file with every file Meshy generates. Present when `output.format` is `zip`. **Example Fridge Magnet Build Task Object** ```json { "id": "01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0", "type": "creative-lab-fridge-magnet-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729543250000, "started_at": 1729543258000, "finished_at": 1729543285000, "expires_at": 1729802485000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/01b4e9a2-9d3f-8e15-c334-4f4887b2d9d0/output/model.glb?Expires=***" } } ``` --- # Creative Lab — Figure API Source: https://docs.meshy.ai/api/creative-lab-figure # Creative Lab Figure API Turn a photo into a chibi-style collectible 3D figure in two stages. A prototype task generates a concept image from the photo. A build task turns that image into a textured 3D model, and takes the prototype task's ID as `input_task_id`. - `POST /openapi/creative-lab/figure/v1/prototype` - `POST /openapi/creative-lab/figure/v1/build` --- ## POST /openapi/creative-lab/figure/v1/prototype -- Create a Figure prototype task Generates one chibi-style concept image from a photo. To build the 3D model, pass this task's ID to the [build endpoint](#create-a-figure-build-task) as `input_task_id`. For the task's fields, see [The Figure prototype task object](#the-figure-prototype-task-object). ### Parameters - `image_url` · *string* · **required** The photo to turn into a chibi figure, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. - `remove_background` · *boolean* · default: `false` Whether to remove the background from the prototype image. `true` returns a transparent RGBA PNG, so you can place the subject on any background. The build also starts from the image without its background. If Meshy can't remove the background, it returns the image with its background, and the task still succeeds. ### Returns The `result` field holds the ID of the new prototype task. [Get the task](#retrieve-a-figure-task) or [stream it](#stream-a-figure-task) until `status` is `SUCCEEDED`. Then pass the ID to the [build endpoint](#create-a-figure-build-task) as `input_task_id`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` is missing. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * The image was flagged as NSFW. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 1: generate a chibi-style concept image curl https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 1: generate a chibi-style concept image const payload = { image_url: "", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 1: generate a chibi-style concept image payload = { "image_url": "", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## POST /openapi/creative-lab/figure/v1/build -- Create a Figure build task Generates the textured 3D figure from a succeeded prototype task. For its fields, see [The Figure build task object](#the-figure-build-task-object). ### Parameters - `input_task_id` · *string* · **required** The ID of the prototype task to build. It must be a task your account created with `POST /openapi/creative-lab/figure/v1/prototype`, with the status `SUCCEEDED`. An ID that isn't one of your Figure prototype tasks from the API returns `404`, including a prototype made in the web app. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. ### Returns The `result` field holds the ID of the new build task. [Get the task](#retrieve-a-figure-task) or [stream it](#stream-a-figure-task) until `status` is `SUCCEEDED`. Then download the textured GLB from `model_urls.glb`. For an OBJ instead, download `model_urls.obj` with its material file from `model_urls.mtl`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `input_task_id` is missing or isn't a valid task ID. * The prototype task's status isn't `SUCCEEDED`. If it's still running, wait and retry. If it failed or was canceled, create a new prototype task. * The prototype task succeeded but has no image. Create a new prototype task. The error message says which problem it found. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `404 - Not Found` `input_task_id` doesn't match any Figure prototype task your account created with the API. A prototype made in the web app also returns `404`. Send the `result` ID from a prototype create response. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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 # Stage 2: chain build off a succeeded prototype task curl https://api.meshy.ai/openapi/creative-lab/figure/v1/build \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 2: chain build off a succeeded prototype task const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/figure/v1/build', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 2: chain build off a succeeded prototype task payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/figure/v1/build", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb" } ``` --- ## GET /openapi/creative-lab/figure/v1/(prototype|build)/:id -- Get a Figure task Returns a prototype or build task. The path must match the task's stage. A build task requested through `/prototype/:id` returns `404`, and so does a prototype task requested through `/build/:id`. For the fields, see [The Figure prototype task object](#the-figure-prototype-task-object) and [The Figure build task object](#the-figure-build-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [prototype task object](#the-figure-prototype-task-object) or the [build task object](#the-figure-build-task-object), matching the stage in the path. ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the task's image for third-party intellectual property. Teams on the Enterprise plan don't get this error. Create a prototype task from an image you have the rights to use. - `404 - Not Found` No Figure task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash # Prototype curl https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # Build curl https://api.meshy.ai/openapi/creative-lab/figure/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Prototype const prototypeId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const proto = await axios.get( `https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype/${prototypeId}`, { headers } ); console.log(proto.data); // Build const buildId = '019c320e-9a8f-7a1c-9c11-2a1876f8a9bb'; const build = await axios.get( `https://api.meshy.ai/openapi/creative-lab/figure/v1/build/${buildId}`, { headers } ); console.log(build.data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Prototype prototype_id = "018a210d-8ba4-705c-b111-1f1776f7f578" proto = requests.get( f"https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype/{prototype_id}", headers=headers, ) proto.raise_for_status() print(proto.json()) # Build build_id = "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb" build = requests.get( f"https://api.meshy.ai/openapi/creative-lab/figure/v1/build/{build_id}", headers=headers, ) build.raise_for_status() print(build.json()) ``` **Prototype Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` **Build Response** ```json { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-figure-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/texture_0.png?Expires=***" } ], "remove_lighting": true } ``` --- ## DELETE /openapi/creative-lab/figure/v1/(prototype|build)/:id -- Delete a Figure task Cancels a Figure task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. The path must match the task's stage. For example, `DELETE` on `/prototype/:id` with a build task's ID returns `404`. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Figure task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/figure/v1/(prototype|build)/:id/stream -- Stream a Figure task Streams a Figure task's updates as Server-Sent Events (SSE). The path must match the task's stage. If it doesn't, for example a build task's ID at `/prototype/:id/stream`, the stream sends one `error` event with `status_code: 404` and closes. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [prototype](#the-figure-prototype-task-object) or [build](#the-figure-build-task-object) task objects. Each event has the full task object, as [Get a Figure task](#retrieve-a-figure-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/figure/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/figure/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/figure/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (wrong stage or task not found) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is shortened to the fields that change. event: message data: { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "progress": 0, "status": "PENDING" } event: message data: { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-figure-build", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/texture_0.png?Expires=***" } ], "remove_lighting": true } ``` --- ## GET /openapi/creative-lab/figure/v1/(prototype|build) -- List Figure tasks Returns your Figure tasks of one stage, one page at a time. The path selects the stage. `/prototype` returns only prototype tasks, and `/build` returns only build tasks. ### Path parameters - `stage` · *path* · **required** The stage to list, `prototype` or `build`. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [prototype task objects](#the-figure-prototype-task-object) or [build task objects](#the-figure-build-task-object), matching the stage in the path. **cURL** ```bash # List prototype tasks curl https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # List build tasks curl https://api.meshy.ai/openapi/creative-lab/figure/v1/build?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/figure/v1/prototype", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response (List Prototype Tasks)** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ] ``` --- ## The Figure prototype task object A prototype task generates a chibi-style concept image from a photo. To turn the image into a 3D model, pass the task's ID to the [build endpoint](#create-a-figure-build-task) as `input_task_id`. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-figure-prototype`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `image_urls` · *array of strings* Download URLs for the concept image. The array has one URL after the task succeeds, and is empty until then. **Example Figure Prototype Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` --- ## The Figure build task object A build task generates a textured 3D figure from a succeeded prototype task. Its `model_urls`, `thumbnail_url`, and `texture_urls` fields have the same format as in the [Image to 3D task object](/api/image-to-3d#the-image-to-3d-task-object). ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-figure-build`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `prompt` · *string* Always `""` for a Figure build task. - `negative_prompt` · *string* Always `""` for a Figure build task, like `prompt`. - `texture_prompt` · *string* Always `""` for a Figure build task, like `prompt`. - `texture_image_url` · *string* Always `""` for a Figure build task, like `prompt`. - `model_urls` · *object* Download URLs for the 3D model, as a textured GLB and as an OBJ file with its MTL file. - `glb` · *string* Download URL for the textured GLB file. - `obj` · *string* Download URL for the OBJ file, with the geometry and UVs. - `mtl` · *string* Download URL for the MTL material file that goes with `obj`. Use it with `obj` and the texture in `texture_urls[0].base_color`. - `thumbnail_url` · *string* Download URL for a preview image of the model. - `texture_urls` · *array* The texture maps, as an array with one object that holds the base color map. - `base_color` · *string* Download URL for the base color map. - `remove_lighting` · *boolean* Whether Meshy removed highlights and shadows from the base color texture. **Example Figure Build Task Object** ```json { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-figure-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/texture_0.png?Expires=***" } ], "remove_lighting": true } ``` --- # Creative Lab — Vinyl Figure API Source: https://docs.meshy.ai/api/creative-lab-vinyl-figure # Creative Lab Vinyl Figure API Turn a photo into a big-head vinyl collectible 3D figure in two stages. A prototype task generates a concept image from the photo. A build task turns that image into a textured 3D model, and takes the prototype task's ID as `input_task_id`. - `POST /openapi/creative-lab/vinyl-figure/v1/prototype` - `POST /openapi/creative-lab/vinyl-figure/v1/build` --- ## POST /openapi/creative-lab/vinyl-figure/v1/prototype -- Create a Vinyl Figure prototype task Generates one vinyl-figure-style concept image from a photo. To build the 3D model, pass this task's ID to the [build endpoint](#create-a-vinyl-figure-build-task) as `input_task_id`. For the task's fields, see [The Vinyl Figure prototype task object](#the-vinyl-figure-prototype-task-object). ### Parameters - `image_url` · *string* · **required** The photo to turn into a big-head vinyl figure, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. - `remove_background` · *boolean* · default: `false` Whether to remove the background from the prototype image. `true` returns a transparent RGBA PNG, so you can place the subject on any background. The build also starts from the image without its background. If Meshy can't remove the background, it returns the image with its background, and the task still succeeds. ### Returns The `result` field holds the ID of the new prototype task. [Get the task](#retrieve-a-vinyl-figure-task) or [stream it](#stream-a-vinyl-figure-task) until `status` is `SUCCEEDED`. Then pass the ID to the [build endpoint](#create-a-vinyl-figure-build-task) as `input_task_id`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` is missing. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * The image was flagged as NSFW. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 1: generate a vinyl-figure-style concept image curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 1: generate a vinyl-figure-style concept image const payload = { image_url: "", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 1: generate a vinyl-figure-style concept image payload = { "image_url": "", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de" } ``` --- ## POST /openapi/creative-lab/vinyl-figure/v1/build -- Create a Vinyl Figure build task Generates the textured 3D vinyl figure from a succeeded prototype task. For its fields, see [The Vinyl Figure build task object](#the-vinyl-figure-build-task-object). ### Parameters - `input_task_id` · *string* · **required** The ID of the prototype task to build. It must be a task your account created with `POST /openapi/creative-lab/vinyl-figure/v1/prototype`, with the status `SUCCEEDED`. An ID that isn't one of your Vinyl Figure prototype tasks from the API returns `404`, including a prototype made in the web app. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. ### Returns The `result` field holds the ID of the new build task. [Get the task](#retrieve-a-vinyl-figure-task) or [stream it](#stream-a-vinyl-figure-task) until `status` is `SUCCEEDED`. Then download the textured GLB from `model_urls.glb`. For an OBJ instead, download `model_urls.obj` with its material file from `model_urls.mtl`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `input_task_id` is missing or isn't a valid task ID. * The prototype task's status isn't `SUCCEEDED`. If it's still running, wait and retry. If it failed or was canceled, create a new prototype task. * The prototype task succeeded but has no image. Create a new prototype task. The error message says which problem it found. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `404 - Not Found` `input_task_id` doesn't match any Vinyl Figure prototype task your account created with the API. A prototype made in the web app also returns `404`. Send the `result` ID from a prototype create response. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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 # Stage 2: chain build off a succeeded prototype task curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 2: chain build off a succeeded prototype task const payload = { input_task_id: "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 2: chain build off a succeeded prototype task payload = { "input_task_id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef" } ``` --- ## GET /openapi/creative-lab/vinyl-figure/v1/(prototype|build)/:id -- Get a Vinyl Figure task Returns a prototype or build task. The path must match the task's stage. A build task requested through `/prototype/:id` returns `404`, and so does a prototype task requested through `/build/:id`. For the fields, see [The Vinyl Figure prototype task object](#the-vinyl-figure-prototype-task-object) and [The Vinyl Figure build task object](#the-vinyl-figure-build-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [prototype task object](#the-vinyl-figure-prototype-task-object) or the [build task object](#the-vinyl-figure-build-task-object), matching the stage in the path. ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the task's image for third-party intellectual property. Teams on the Enterprise plan don't get this error. Create a prototype task from an image you have the rights to use. - `404 - Not Found` No Vinyl Figure task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash # Prototype curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype/019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de \ -H "Authorization: Bearer ${YOUR_API_KEY}" # Build curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Prototype const prototypeId = '019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de'; const proto = await axios.get( `https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype/${prototypeId}`, { headers } ); console.log(proto.data); // Build const buildId = '019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef'; const build = await axios.get( `https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build/${buildId}`, { headers } ); console.log(build.data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Prototype prototype_id = "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de" proto = requests.get( f"https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype/{prototype_id}", headers=headers, ) proto.raise_for_status() print(proto.json()) # Build build_id = "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef" build = requests.get( f"https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build/{build_id}", headers=headers, ) build.raise_for_status() print(build.json()) ``` **Prototype Response** ```json { "id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de", "type": "creative-lab-vinyl-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1752969600000, "started_at": 1752969604000, "finished_at": 1752969630000, "expires_at": 1753228830000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` **Build Response** ```json { "id": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef", "type": "creative-lab-vinyl-figure-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1752969700000, "started_at": 1752969710000, "finished_at": 1752969735000, "expires_at": 1753228935000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/texture_0.png?Expires=***" } ] } ``` --- ## DELETE /openapi/creative-lab/vinyl-figure/v1/(prototype|build)/:id -- Delete a Vinyl Figure task Cancels a Vinyl Figure task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. The path must match the task's stage. For example, `DELETE` on `/prototype/:id` with a build task's ID returns `404`. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Vinyl Figure task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype/019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/vinyl-figure/v1/(prototype|build)/:id/stream -- Stream a Vinyl Figure task Streams a Vinyl Figure task's updates as Server-Sent Events (SSE). The path must match the task's stage. If it doesn't, for example a build task's ID at `/prototype/:id/stream`, the stream sends one `error` event with `status_code: 404` and closes. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [prototype](#the-vinyl-figure-prototype-task-object) or [build](#the-vinyl-figure-build-task-object) task objects. Each event has the full task object, as [Get a Vinyl Figure task](#retrieve-a-vinyl-figure-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (wrong stage or task not found) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is shortened to the fields that change. event: message data: { "id": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef", "progress": 0, "status": "PENDING" } event: message data: { "id": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef", "type": "creative-lab-vinyl-figure-build", "status": "SUCCEEDED", "progress": 100, "created_at": 1752969700000, "started_at": 1752969710000, "finished_at": 1752969735000, "expires_at": 1753228935000, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/texture_0.png?Expires=***" } ] } ``` --- ## GET /openapi/creative-lab/vinyl-figure/v1/(prototype|build) -- List Vinyl Figure tasks Returns your Vinyl Figure tasks of one stage, one page at a time. The path selects the stage. `/prototype` returns only prototype tasks, and `/build` returns only build tasks. ### Path parameters - `stage` · *path* · **required** The stage to list, `prototype` or `build`. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [prototype task objects](#the-vinyl-figure-prototype-task-object) or [build task objects](#the-vinyl-figure-build-task-object), matching the stage in the path. **cURL** ```bash # List prototype tasks curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # List build tasks curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response (List Prototype Tasks)** ```json [ { "id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de", "type": "creative-lab-vinyl-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1752969600000, "started_at": 1752969604000, "finished_at": 1752969630000, "expires_at": 1753228830000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ] ``` --- ## The Vinyl Figure prototype task object A prototype task generates a vinyl-figure-style concept image from a photo. To turn the image into a 3D model, pass the task's ID to the [build endpoint](#create-a-vinyl-figure-build-task) as `input_task_id`. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-vinyl-figure-prototype`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `image_urls` · *array of strings* Download URLs for the concept image. The array has one URL after the task succeeds, and is empty until then. **Example Vinyl Figure Prototype Task Object** ```json { "id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de", "type": "creative-lab-vinyl-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1752969600000, "started_at": 1752969604000, "finished_at": 1752969630000, "expires_at": 1753228830000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` --- ## The Vinyl Figure build task object A build task generates a textured 3D vinyl figure from a succeeded prototype task. Its `model_urls`, `thumbnail_url`, and `texture_urls` fields have the same format as in the [Image to 3D task object](/api/image-to-3d#the-image-to-3d-task-object). ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-vinyl-figure-build`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `prompt` · *string* Always `""` for a Vinyl Figure build task. - `negative_prompt` · *string* Always `""` for a Vinyl Figure build task, like `prompt`. - `texture_prompt` · *string* Always `""` for a Vinyl Figure build task, like `prompt`. - `texture_image_url` · *string* Always `""` for a Vinyl Figure build task, like `prompt`. - `model_urls` · *object* Download URLs for the 3D model, as a textured GLB and as an OBJ file with its MTL file. - `glb` · *string* Download URL for the textured GLB file. - `obj` · *string* Download URL for the OBJ file, with the geometry and UVs. - `mtl` · *string* Download URL for the MTL material file that goes with `obj`. Use it with `obj` and the texture in `texture_urls[0].base_color`. - `thumbnail_url` · *string* Download URL for a preview image of the model. - `texture_urls` · *array* The texture maps, as an array with one object that holds the base color map. - `base_color` · *string* Download URL for the base color map. **Example Vinyl Figure Build Task Object** ```json { "id": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef", "type": "creative-lab-vinyl-figure-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1752969700000, "started_at": 1752969710000, "finished_at": 1752969735000, "expires_at": 1753228935000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/texture_0.png?Expires=***" } ] } ``` --- # Creative Lab — Brick Figure API Source: https://docs.meshy.ai/api/creative-lab-brick-figure # Creative Lab Brick Figure API Turn a photo into a brick-style collectible 3D minifigure in two stages. A prototype task generates a concept image from the photo. A build task turns that image into a textured 3D model, and takes the prototype task's ID as `input_task_id`. - `POST /openapi/creative-lab/brick-figure/v1/prototype` - `POST /openapi/creative-lab/brick-figure/v1/build` --- ## POST /openapi/creative-lab/brick-figure/v1/prototype -- Create a Brick Figure prototype task Generates one brick-style concept image from a photo. To build the 3D model, pass this task's ID to the [build endpoint](#create-a-brick-figure-build-task) as `input_task_id`. For the task's fields, see [The Brick Figure prototype task object](#the-brick-figure-prototype-task-object). ### Parameters - `image_url` · *string* · **required** The photo to turn into a brick minifigure, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. - `remove_background` · *boolean* · default: `false` Whether to remove the background from the prototype image. `true` returns a transparent RGBA PNG, so you can place the subject on any background. The build also starts from the image without its background. If Meshy can't remove the background, it returns the image with its background, and the task still succeeds. ### Returns The `result` field holds the ID of the new prototype task. [Get the task](#retrieve-a-brick-figure-task) or [stream it](#stream-a-brick-figure-task) until `status` is `SUCCEEDED`. Then pass the ID to the [build endpoint](#create-a-brick-figure-build-task) as `input_task_id`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` is missing. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * The image was flagged as NSFW. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 1: generate a brick-style concept image curl https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 1: generate a brick-style concept image const payload = { image_url: "", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 1: generate a brick-style concept image payload = { "image_url": "", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## POST /openapi/creative-lab/brick-figure/v1/build -- Create a Brick Figure build task Generates the textured 3D minifigure from a succeeded prototype task. For its fields, see [The Brick Figure build task object](#the-brick-figure-build-task-object). ### Parameters - `input_task_id` · *string* · **required** The ID of the prototype task to build. It must be a task your account created with `POST /openapi/creative-lab/brick-figure/v1/prototype`, with the status `SUCCEEDED`. An ID that isn't one of your Brick Figure prototype tasks from the API returns `404`, including a prototype made in the web app. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. ### Returns The `result` field holds the ID of the new build task. [Get the task](#retrieve-a-brick-figure-task) or [stream it](#stream-a-brick-figure-task) until `status` is `SUCCEEDED`. Then download the textured GLB from `model_urls.glb`. For an OBJ instead, download `model_urls.obj` with its material file from `model_urls.mtl`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `input_task_id` is missing or isn't a valid task ID. * The prototype task's status isn't `SUCCEEDED`. If it's still running, wait and retry. If it failed or was canceled, create a new prototype task. * The prototype task succeeded but has no image. Create a new prototype task. The error message says which problem it found. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `404 - Not Found` `input_task_id` doesn't match any Brick Figure prototype task your account created with the API. A prototype made in the web app also returns `404`. Send the `result` ID from a prototype create response. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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 # Stage 2: chain build off a succeeded prototype task curl https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 2: chain build off a succeeded prototype task const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 2: chain build off a succeeded prototype task payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb" } ``` --- ## GET /openapi/creative-lab/brick-figure/v1/(prototype|build)/:id -- Get a Brick Figure task Returns a prototype or build task. The path must match the task's stage. A build task requested through `/prototype/:id` returns `404`, and so does a prototype task requested through `/build/:id`. For the fields, see [The Brick Figure prototype task object](#the-brick-figure-prototype-task-object) and [The Brick Figure build task object](#the-brick-figure-build-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [prototype task object](#the-brick-figure-prototype-task-object) or the [build task object](#the-brick-figure-build-task-object), matching the stage in the path. ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the task's image for third-party intellectual property. Teams on the Enterprise plan don't get this error. Create a prototype task from an image you have the rights to use. - `404 - Not Found` No Brick Figure task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash # Prototype curl https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # Build curl https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Prototype const prototypeId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const proto = await axios.get( `https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype/${prototypeId}`, { headers } ); console.log(proto.data); // Build const buildId = '019c320e-9a8f-7a1c-9c11-2a1876f8a9bb'; const build = await axios.get( `https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build/${buildId}`, { headers } ); console.log(build.data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Prototype prototype_id = "018a210d-8ba4-705c-b111-1f1776f7f578" proto = requests.get( f"https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype/{prototype_id}", headers=headers, ) proto.raise_for_status() print(proto.json()) # Build build_id = "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb" build = requests.get( f"https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build/{build_id}", headers=headers, ) build.raise_for_status() print(build.json()) ``` **Prototype Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-brick-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` **Build Response** ```json { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-brick-figure-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/texture_0.png?Expires=***" } ] } ``` --- ## DELETE /openapi/creative-lab/brick-figure/v1/(prototype|build)/:id -- Delete a Brick Figure task Cancels a Brick Figure task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. The path must match the task's stage. For example, `DELETE` on `/prototype/:id` with a build task's ID returns `404`. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Brick Figure task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/brick-figure/v1/(prototype|build)/:id/stream -- Stream a Brick Figure task Streams a Brick Figure task's updates as Server-Sent Events (SSE). The path must match the task's stage. If it doesn't, for example a build task's ID at `/prototype/:id/stream`, the stream sends one `error` event with `status_code: 404` and closes. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [prototype](#the-brick-figure-prototype-task-object) or [build](#the-brick-figure-build-task-object) task objects. Each event has the full task object, as [Get a Brick Figure task](#retrieve-a-brick-figure-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (wrong stage or task not found) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is shortened to the fields that change. event: message data: { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "progress": 0, "status": "PENDING" } event: message data: { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-brick-figure-build", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/texture_0.png?Expires=***" } ] } ``` --- ## GET /openapi/creative-lab/brick-figure/v1/(prototype|build) -- List Brick Figure tasks Returns your Brick Figure tasks of one stage, one page at a time. The path selects the stage. `/prototype` returns only prototype tasks, and `/build` returns only build tasks. ### Path parameters - `stage` · *path* · **required** The stage to list, `prototype` or `build`. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [prototype task objects](#the-brick-figure-prototype-task-object) or [build task objects](#the-brick-figure-build-task-object), matching the stage in the path. **cURL** ```bash # List prototype tasks curl https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # List build tasks curl https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/build?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/brick-figure/v1/prototype", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response (List Prototype Tasks)** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-brick-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ] ``` --- ## The Brick Figure prototype task object A prototype task generates a brick-style concept image from a photo. To turn the image into a 3D model, pass the task's ID to the [build endpoint](#create-a-brick-figure-build-task) as `input_task_id`. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-brick-figure-prototype`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `image_urls` · *array of strings* Download URLs for the concept image. The array has one URL after the task succeeds, and is empty until then. **Example Brick Figure Prototype Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-brick-figure-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` --- ## The Brick Figure build task object A build task generates a textured 3D minifigure from a succeeded prototype task. Its `model_urls`, `thumbnail_url`, and `texture_urls` fields have the same format as in the [Image to 3D task object](/api/image-to-3d#the-image-to-3d-task-object). ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-brick-figure-build`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `prompt` · *string* Always `""` for a Brick Figure build task. - `negative_prompt` · *string* Always `""` for a Brick Figure build task, like `prompt`. - `texture_prompt` · *string* Always `""` for a Brick Figure build task, like `prompt`. - `texture_image_url` · *string* Always `""` for a Brick Figure build task, like `prompt`. - `model_urls` · *object* Download URLs for the 3D model, as a textured GLB and as an OBJ file with its MTL file. - `glb` · *string* Download URL for the textured GLB file. - `obj` · *string* Download URL for the OBJ file, with the geometry and UVs. - `mtl` · *string* Download URL for the MTL material file that goes with `obj`. Use it with `obj` and the texture in `texture_urls[0].base_color`. - `thumbnail_url` · *string* Download URL for a preview image of the model. - `texture_urls` · *array* The texture maps, as an array with one object that holds the base color map. - `base_color` · *string* Download URL for the base color map. **Example Brick Figure Build Task Object** ```json { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-brick-figure-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "prompt": "", "negative_prompt": "", "texture_prompt": "", "texture_image_url": "", "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.glb?Expires=***", "obj": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.obj?Expires=***", "mtl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/model.mtl?Expires=***" }, "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/preview.png?Expires=***", "texture_urls": [ { "base_color": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/texture_0.png?Expires=***" } ] } ``` --- # Creative Lab — Lamp API Source: https://docs.meshy.ai/api/creative-lab-lamp # Creative Lab Lamp API Turn a photo into a 3D-printable lampshade in two stages. A prototype task generates a matte-white concept image and turns it into a 3D model. A build task, which takes the prototype task's ID as `input_task_id`, turns that model into printable STL parts. With the default fixture preset, the parts are an open-bottom lampshade with a base plate for the light fixture, and the fixture mount. - `POST /openapi/creative-lab/lamp/v1/prototype` - `POST /openapi/creative-lab/lamp/v1/build` --- ## POST /openapi/creative-lab/lamp/v1/prototype -- Create a Lamp prototype task Generates one matte-white concept image from a photo and turns it into a 3D lampshade model. The task returns the concept image in `image_urls`, and the model in `model_urls.glb` with a preview in `thumbnail_url`. To build the printable parts, pass this task's ID to the [build endpoint](#create-a-lamp-build-task) as `input_task_id`. For the task's fields, see [The Lamp prototype task object](#the-lamp-prototype-task-object). ### Parameters - `image_url` · *string* · **required** The photo to base the lampshade on, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB. - `image_subject` · *string* · default: `character` The kind of subject in the photo, which sets how Meshy stylizes it. Available values: * `character`: a single character or object, such as a figurine, an animal, or a mascot * `landscape`: an outdoor scene or panorama, such as a mountain, a cityscape, or a forest - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. - `remove_background` · *boolean* · default: `false` Whether to remove the background from the prototype image. `true` returns a transparent RGBA PNG, so you can place the subject on any background. Meshy also builds the 3D model from the image without its background. If Meshy can't remove the background, it uses the image with its background, and the task still succeeds. ### Returns The `result` field holds the ID of the new prototype task. [Get the task](#retrieve-a-lamp-task) or [stream it](#stream-a-lamp-task) until `status` is `SUCCEEDED`. Then pass the ID to the [build endpoint](#create-a-lamp-build-task) as `input_task_id`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` is missing. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * The image was flagged as NSFW. * `image_subject` isn't `character` or `landscape`. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 1: concept image + 3D lampshade model from a source photo curl https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "", "image_subject": "character" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 1: concept image + 3D lampshade model from a source photo const payload = { image_url: "", image_subject: "character", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 1: concept image + 3D lampshade model from a source photo payload = { "image_url": "", "image_subject": "character", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## POST /openapi/creative-lab/lamp/v1/build -- Create a Lamp build task Generates the 3D-printable parts from a succeeded prototype task. Meshy scales the prototype's model to `diameter_mm`, cuts the bottom flat by `cut_amount_percent`, and hollows it to `thickness_mm`. With a fixture preset, it also opens the bottom, adds a base plate with the fixture hole, and makes a separate mount for the light. For the task's fields, see [The Lamp build task object](#the-lamp-build-task-object). ### Parameters - `input_task_id` · *string* · **required** The ID of the prototype task to build. It must be a task your account created with `POST /openapi/creative-lab/lamp/v1/prototype`, with the status `SUCCEEDED`. An ID that isn't one of your Lamp prototype tasks from the API returns `404`, including a prototype made in the web app. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. #### `options` Optional settings for the lampshade's shape. Every field has a default, so send only the ones you want to change. - `diameter_mm` · *number* · default: `150` The size of the lampshade's largest dimension, in millimeters, from `50` to `400`. Meshy scales the model evenly to fit. `0` uses the default, and any other value outside the range returns `400`. - `thickness_mm` · *number* · default: `1` The lampshade's wall thickness, in millimeters, up to `10`. `0` uses the default, and a negative value or a value over `10` returns `400`. - `cut_amount_percent` · *number* · default: `1` The percentage of the model's height to cut flat at the bottom, from `1` to `100`. The flat bottom lets the lampshade sit on the print bed and leaves room for the fixture. A value outside the range returns `400`. - `light_source_preset` · *string* · default: `bambu_mh001_60mm` The light fixture preset, which sets how Meshy builds the bottom. Available values: * `bambu_mh001_60mm`: an open-bottom lampshade with a base plate that has a 60 mm fixture hole, both in `model_urls.lamp_stl`, and the fixture mount in `model_urls.base_stl` * `none`: a single sealed lampshade in `model_urls.lamp_stl`, with no `model_urls.base_stl` - `fixture_offset_x_mm` · *number* · default: `0` How far to move the fixture hole along the X axis from the lampshade's center, in millimeters, from `-80` to `80`. Applies only when `light_source_preset` isn't `none`. - `fixture_offset_z_mm` · *number* · default: `0` How far to move the fixture hole along the Z axis (depth) from the lampshade's center, in millimeters, from `-80` to `80`. Applies only when `light_source_preset` isn't `none`. - `rotate_x_deg` · *number* · default: `0` The rotation around the X axis to apply to the model before Meshy processes it, in degrees, from `-360` to `360`. Meshy applies the three rotations as XYZ Euler angles about the model's center. - `rotate_y_deg` · *number* · default: `0` The rotation around the Y axis to apply to the model before Meshy processes it, in degrees, from `-360` to `360`. - `rotate_z_deg` · *number* · default: `0` The rotation around the Z axis to apply to the model before Meshy processes it, in degrees, from `-360` to `360`. - `include_result_json` · *boolean* · default: `false` Whether to add a `result.json` file to the zip bundle, with the name of the pipeline that ran, warnings, and file paths. Requires `output.format` set to `zip`. `true` with `stl` returns `400`. #### `output` Optional. Sets the files the build returns. - `format` · *string* · default: `stl` The files the build returns. Available values: * `stl`: `model_urls.lamp_stl`, the lampshade with its base plate when there's a fixture preset, and `model_urls.base_stl` when `light_source_preset` isn't `none` * `zip`: one zip file in `model_urls.bundle_zip`, with `lamp.stl`, and `base.stl` and `result.json` when they apply ### Returns The `result` field holds the ID of the new build task. [Get the task](#retrieve-a-lamp-task) or [stream it](#stream-a-lamp-task) until `status` is `SUCCEEDED`. Then download the files from `model_urls`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `input_task_id` is missing or isn't a valid task ID. * The prototype task's status isn't `SUCCEEDED`. If it's still running, wait and retry. If it failed or was canceled, create a new prototype task. * The prototype task succeeded but has no 3D model. Create a new prototype task. * An `options` field is outside its range or isn't an available value. * `output.format` isn't `stl` or `zip`, or `include_result_json` is `true` without `zip`. The error message says which problem it found. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `404 - Not Found` `input_task_id` doesn't match any Lamp prototype task your account created with the API. A prototype made in the web app also returns `404`. Send the `result` ID from a prototype create response. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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 # Stage 2: chain build off a succeeded prototype task curl https://api.meshy.ai/openapi/creative-lab/lamp/v1/build \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "options": { "diameter_mm": 120, "thickness_mm": 2, "light_source_preset": "bambu_mh001_60mm", "cut_amount_percent": 30 }, "output": { "format": "stl" } }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 2: chain build off a succeeded prototype task const payload = { input_task_id: "018a210d-8ba4-705c-b111-1f1776f7f578", options: { diameter_mm: 120, thickness_mm: 2, light_source_preset: "bambu_mh001_60mm", cut_amount_percent: 30, }, output: { format: "stl" }, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/lamp/v1/build', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 2: chain build off a succeeded prototype task payload = { "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "options": { "diameter_mm": 120, "thickness_mm": 2, "light_source_preset": "bambu_mh001_60mm", "cut_amount_percent": 30, }, "output": {"format": "stl"}, } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/lamp/v1/build", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb" } ``` --- ## GET /openapi/creative-lab/lamp/v1/(prototype|build)/:id -- Get a Lamp task Returns a prototype or build task. The path must match the task's stage. A build task requested through `/prototype/:id` returns `404`, and so does a prototype task requested through `/build/:id`. For the fields, see [The Lamp prototype task object](#the-lamp-prototype-task-object) and [The Lamp build task object](#the-lamp-build-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [prototype task object](#the-lamp-prototype-task-object) or the [build task object](#the-lamp-build-task-object), matching the stage in the path. ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the prototype task's image for third-party intellectual property. Build tasks and teams on the Enterprise plan don't get this error. Create a prototype task from an image you have the rights to use. - `404 - Not Found` No Lamp task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash # Prototype curl https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # Build curl https://api.meshy.ai/openapi/creative-lab/lamp/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Prototype const prototypeId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const proto = await axios.get( `https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype/${prototypeId}`, { headers } ); console.log(proto.data); // Build const buildId = '019c320e-9a8f-7a1c-9c11-2a1876f8a9bb'; const build = await axios.get( `https://api.meshy.ai/openapi/creative-lab/lamp/v1/build/${buildId}`, { headers } ); console.log(build.data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Prototype prototype_id = "018a210d-8ba4-705c-b111-1f1776f7f578" proto = requests.get( f"https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype/{prototype_id}", headers=headers, ) proto.raise_for_status() print(proto.json()) # Build build_id = "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb" build = requests.get( f"https://api.meshy.ai/openapi/creative-lab/lamp/v1/build/{build_id}", headers=headers, ) build.raise_for_status() print(build.json()) ``` **Prototype Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-lamp-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "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=***", "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` **Build Response** ```json { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-lamp-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "model_urls": { "lamp_stl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/lamp.stl?Expires=***", "base_stl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/base.stl?Expires=***" } } ``` --- ## DELETE /openapi/creative-lab/lamp/v1/(prototype|build)/:id -- Delete a Lamp task Cancels a Lamp task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. The path must match the task's stage. For example, `DELETE` on `/prototype/:id` with a build task's ID returns `404`. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Lamp task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/lamp/v1/(prototype|build)/:id/stream -- Stream a Lamp task Streams a Lamp task's updates as Server-Sent Events (SSE). The path must match the task's stage. If it doesn't, for example a build task's ID at `/prototype/:id/stream`, the stream sends one `error` event with `status_code: 404` and closes. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [prototype](#the-lamp-prototype-task-object) or [build](#the-lamp-build-task-object) task objects. Each event has the full task object, as [Get a Lamp task](#retrieve-a-lamp-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/lamp/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/lamp/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/lamp/v1/build/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (wrong stage or task not found) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is shortened to the fields that change. event: message data: { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "progress": 0, "status": "PENDING" } event: message data: { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-lamp-build", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "task_error": null, "consumed_credits": 6, "model_urls": { "lamp_stl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/lamp.stl?Expires=***", "base_stl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/base.stl?Expires=***" } } ``` --- ## GET /openapi/creative-lab/lamp/v1/(prototype|build) -- List Lamp tasks Returns your Lamp tasks of one stage, one page at a time. The path selects the stage. `/prototype` returns only prototype tasks, and `/build` returns only build tasks. ### Path parameters - `stage` · *path* · **required** The stage to list, `prototype` or `build`. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [prototype task objects](#the-lamp-prototype-task-object) or [build task objects](#the-lamp-build-task-object), matching the stage in the path. **cURL** ```bash # List prototype tasks curl https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # List build tasks curl https://api.meshy.ai/openapi/creative-lab/lamp/v1/build?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/lamp/v1/prototype", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response (List Prototype Tasks)** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-lamp-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "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=***", "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ] ``` --- ## The Lamp prototype task object A prototype task generates a matte-white concept image from a photo and turns it into a 3D model. To make the printable parts, pass the task's ID to the [build endpoint](#create-a-lamp-build-task) as `input_task_id`. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-lamp-prototype`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `model_urls` · *object* Download URLs for the 3D model generated from the concept image. `{}` until the task succeeds. - `glb` · *string* Download URL for the lampshade model, as a GLB file. The build stage turns this model into the printable parts. - `thumbnail_url` · *string* Download URL for a preview image of the 3D model. `""` until the task succeeds. - `image_urls` · *array of strings* Download URLs for the concept image. The array has one URL after the task succeeds, and is empty until then. **Example Lamp Prototype Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-lamp-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123486000, "expires_at": 1729382686000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "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=***", "image_urls": [ "https://assets.meshy.ai/***/concept.png?Expires=***" ] } ``` --- ## The Lamp build task object A build task turns a succeeded prototype task's 3D model into printable lampshade parts. Meshy hollows the model and cuts its bottom flat. With a fixture preset, it also opens the bottom and adds the base plate and the fixture mount. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-lamp-build`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `model_urls` · *object* Download URLs for the printable files. Which keys appear depends on `output.format` and `options.light_source_preset`. - `lamp_stl` · *string* Download URL for `lamp.stl`. With a fixture preset, it's the open-bottom lampshade with the base plate that has the fixture hole. With `options.light_source_preset` set to `none`, it's a single sealed lampshade. Present when `output.format` is `stl`. - `base_stl` · *string* Download URL for `base.stl`, the mount for the light fixture. Present when `output.format` is `stl` and `options.light_source_preset` isn't `none`. - `bundle_zip` · *string* Download URL for a zip file with `lamp.stl`, and with `base.stl` and `result.json` when they apply. Present when `output.format` is `zip`, and then `lamp_stl` and `base_stl` are left out. **Example Lamp Build Task Object** ```json { "id": "019c320e-9a8f-7a1c-9c11-2a1876f8a9bb", "type": "creative-lab-lamp-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123500000, "started_at": 1729123510000, "finished_at": 1729123535000, "expires_at": 1729382735000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "model_urls": { "lamp_stl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/lamp.stl?Expires=***", "base_stl": "https://assets.meshy.ai/***/tasks/019c320e-9a8f-7a1c-9c11-2a1876f8a9bb/output/base.stl?Expires=***" } } ``` --- # Creative Lab — Keycap API Source: https://docs.meshy.ai/api/creative-lab-keycap # Creative Lab Keycap API Turn a photo into a full-color custom keycap for a mechanical keyboard in two stages. A prototype task generates an image of the finished keycap from the photo. A build task turns that image into a textured 3D keycap model. It takes the prototype task's ID as `input_task_id` and the image's candidate ID as `candidate_id`. - `POST /openapi/creative-lab/keycap/v1/prototype` - `POST /openapi/creative-lab/keycap/v1/build` Both `POST` endpoints need a paid plan. A request from a free-plan account returns `402`. --- ## POST /openapi/creative-lab/keycap/v1/prototype -- Create a Keycap prototype task Generates one image of the finished keycap from a photo. The task's `image_urls` holds the image, and `candidate_ids` holds its ID, with one entry in each. If you don't like the design, create another prototype task. Meshy charges for each prototype task separately. To build the 3D keycap, pass this task's ID to the [build endpoint](#create-a-keycap-build-task) as `input_task_id`, with the `candidate_ids` entry as `candidate_id`. For the task's fields, see [The Keycap prototype task object](#the-keycap-prototype-task-object). ### Parameters - `image_url` · *string* · **required** The photo to turn into a keycap design, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB (20,000,000 bytes). Each side must be at least 32 pixels, and the image can have at most 178,956,970 pixels in total. An image outside these limits returns `400`. Meshy detects the format from the image data, not from the file extension in the URL. A URL with no extension works, and Meshy follows HTTP redirects. Meshy applies the EXIF orientation, so a rotated phone photo comes out the way it looks. A data URI must be base64-encoded with an image type, such as `data:image/png;base64,...`, and the decoded image must be JPEG, PNG, or WebP. The 20 MB limit applies to the decoded image, so the base64 text can be about a third larger. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. - `remove_background` · *boolean* · default: `false` Whether to remove the background from the prototype image. `true` returns a transparent RGBA PNG, so you can place the keycap on any background. If Meshy can't remove the background, it returns the image with its background, and the task still succeeds. The head design that the build turns into 3D keeps its background either way. The build paints the keycap base from the image in `image_urls`, without its background if you sent `true`. The build returns that image as `process_image_urls.composite`. ### Returns The `result` field holds the ID of the new prototype task. [Get the task](#retrieve-a-keycap-task) or [stream it](#stream-a-keycap-task) until `status` is `SUCCEEDED`. Then pass the ID to the [build endpoint](#create-a-keycap-build-task) as `input_task_id`, with the entry from `candidate_ids` as `candidate_id`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` is missing. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * The image was flagged as NSFW. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because content moderation or the intellectual property check couldn't run, or Meshy couldn't store the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 1: generate a finished-keycap design render curl https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 1: generate a finished-keycap design render const payload = { image_url: "", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 1: generate a finished-keycap design render payload = { "image_url": "", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef" } ``` --- ## POST /openapi/creative-lab/keycap/v1/build -- Create a Keycap build task Generates the textured 3D keycap from a succeeded prototype task and one of its candidates. For its fields, see [The Keycap build task object](#the-keycap-build-task-object). One build task runs every step. It generates a 3D model from the design and colors it. Then it seats and cuts the model onto the keycap base in a calibrated default pose, so you don't need to adjust it by hand. Last, it assembles the keycap and exports the files. A build typically takes 3 to 7 minutes. ### Parameters - `input_task_id` · *string* · **required** The ID of the prototype task to build. It must be a task your account created with `POST /openapi/creative-lab/keycap/v1/prototype`, with the status `SUCCEEDED`. An ID that isn't one of your Keycap prototype tasks from the API returns `404`, including a prototype made in the web app. - `candidate_id` · *string* · **required** The candidate to build, from the `candidate_ids` array of the prototype task. A value that isn't in that array returns `400`. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. #### `options` Optional geometry settings. Each field has a calibrated default, so send only the fields you want to change. - `base_model` · *string* · default: `cherry-mx-1x1-r1` The keycap base to build on. The only value is `cherry-mx-1x1-r1`, a standard Cherry MX profile 1u keycap. Custom sizes aren't supported, and any other value returns `400`. - `head_size_mm` · *number* · default: `23` The size of the head along its longest dimension, in millimeters, from `10` to `40`. Meshy scales the head so its longest dimension matches this value. A value outside the range returns `400`. For a value above about `32.9`, Meshy might reduce the size so the head fits the base's protective footprint limit. The head can then come out smaller than you asked. The task object doesn't return the size Meshy applied. To check it, measure the bounding box of the `keycap-head` mesh in the model. - `vertical_offset_mm` · *number* · default: `0` The vertical offset to apply to the head before Meshy seats it on the base, in millimeters, from `-5` to `5`. A value outside the range returns `400`. ### Returns The `result` field holds the ID of the new build task. [Get the task](#retrieve-a-keycap-task) or [stream it](#stream-a-keycap-task) until `status` is `SUCCEEDED`. Then download the GLB file from `model_urls.glb` and the OBJ bundle from `model_urls.obj_zip`. > **Note:** Meshy exports the GLB file and the OBJ bundle at real-world scale in millimeters. Both use a Y-up coordinate system, with the front of the keycap facing +Z. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `input_task_id` is missing or isn't a valid task ID. * The prototype task's status isn't `SUCCEEDED`. If it's still running, wait and retry. If it failed or was canceled, create a new prototype task. * The prototype task succeeded but has no candidates. Create a new prototype task. * `candidate_id` is missing, or isn't in the prototype task's `candidate_ids`. Send a value from that array. * A field in `options` is out of range, or `base_model` isn't an available value. The error message says which problem it found. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `404 - Not Found` `input_task_id` doesn't match any Keycap prototype task your account created with the API. A prototype made in the web app also returns `404`. Send the `result` ID from a prototype create response. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy couldn't create the task because of a server error. Meshy refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 2: build the chosen candidate into a 3D keycap curl https://api.meshy.ai/openapi/creative-lab/keycap/v1/build \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef", "candidate_id": "0198c1b2-33f5-7d21-a4b7-8e9d0c1f2a3b", "options": { "base_model": "cherry-mx-1x1-r1", "head_size_mm": 23, "vertical_offset_mm": 0 } }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 2: build the chosen candidate into a 3D keycap const payload = { input_task_id: "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef", candidate_id: "0198c1b2-33f5-7d21-a4b7-8e9d0c1f2a3b", options: { base_model: "cherry-mx-1x1-r1", head_size_mm: 23, vertical_offset_mm: 0, }, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/keycap/v1/build', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 2: build the chosen candidate into a 3D keycap payload = { "input_task_id": "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef", "candidate_id": "0198c1b2-33f5-7d21-a4b7-8e9d0c1f2a3b", "options": { "base_model": "cherry-mx-1x1-r1", "head_size_mm": 23, "vertical_offset_mm": 0, }, } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/keycap/v1/build", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c9a52-7d18-7e2b-9f01-6e3b98c4d2af" } ``` --- ## GET /openapi/creative-lab/keycap/v1/(prototype|build)/:id -- Get a Keycap task Returns a prototype or build task. The path must match the task's stage. A build task requested through `/prototype/:id` returns `404`, and so does a prototype task requested through `/build/:id`. For the fields, see [The Keycap prototype task object](#the-keycap-prototype-task-object) and [The Keycap build task object](#the-keycap-build-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [prototype task object](#the-keycap-prototype-task-object) or the [build task object](#the-keycap-build-task-object), matching the stage in the path. ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the prototype task's image for third-party intellectual property. Build tasks and teams on the Enterprise plan don't get this error. Create a prototype task from an image you have the rights to use. - `404 - Not Found` No Keycap task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash # Prototype curl https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype/019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef \ -H "Authorization: Bearer ${YOUR_API_KEY}" # Build curl https://api.meshy.ai/openapi/creative-lab/keycap/v1/build/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Prototype const prototypeId = '019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef'; const proto = await axios.get( `https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype/${prototypeId}`, { headers } ); console.log(proto.data); // Build const buildId = '019c9a52-7d18-7e2b-9f01-6e3b98c4d2af'; const build = await axios.get( `https://api.meshy.ai/openapi/creative-lab/keycap/v1/build/${buildId}`, { headers } ); console.log(build.data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Prototype prototype_id = "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef" proto = requests.get( f"https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype/{prototype_id}", headers=headers, ) proto.raise_for_status() print(proto.json()) # Build build_id = "019c9a52-7d18-7e2b-9f01-6e3b98c4d2af" build = requests.get( f"https://api.meshy.ai/openapi/creative-lab/keycap/v1/build/{build_id}", headers=headers, ) build.raise_for_status() print(build.json()) ``` **Prototype Response** ```json { "id": "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef", "type": "creative-lab-keycap-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1753142456000, "started_at": 1753142460000, "finished_at": 1753142516000, "expires_at": 1753401716000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 12, "image_urls": [ "https://assets.meshy.ai/***/design-1.png?Expires=***" ], "candidate_ids": [ "0198c1b2-33f5-7d21-a4b7-8e9d0c1f2a3b" ] } ``` **Build Response** ```json { "id": "019c9a52-7d18-7e2b-9f01-6e3b98c4d2af", "type": "creative-lab-keycap-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1753142600000, "started_at": 1753142610000, "finished_at": 1753143050000, "expires_at": 1753402250000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 50, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/output/model.glb?Expires=***", "obj_zip": "https://assets.meshy.ai/***/tasks/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/output/model-obj.zip?Expires=***" }, "process_image_urls": { "head_design": "https://assets.meshy.ai/***/head-design.png?Expires=***", "composite": "https://assets.meshy.ai/***/composite.png?Expires=***", "base_canvas": "https://assets.meshy.ai/***/base-canvas.png?Expires=***" } } ``` --- ## DELETE /openapi/creative-lab/keycap/v1/(prototype|build)/:id -- Delete a Keycap task Cancels a Keycap task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. The path must match the task's stage. For example, `DELETE` on `/prototype/:id` with a build task's ID returns `404`. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Keycap task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy hit a server error while canceling the task, so the task might or might not be canceled. Get the task to check its `status` before you retry. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype/019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/keycap/v1/(prototype|build)/:id/stream -- Stream a Keycap task Streams a Keycap task's updates as Server-Sent Events (SSE). The path must match the task's stage. If it doesn't, for example a build task's ID at `/prototype/:id/stream`, the stream sends one `error` event with `status_code: 404` and closes. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [prototype](#the-keycap-prototype-task-object) or [build](#the-keycap-build-task-object) task objects. Each event has the full task object, as [Get a Keycap task](#retrieve-a-keycap-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/keycap/v1/build/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/keycap/v1/build/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/keycap/v1/build/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (wrong stage or task not found) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is shortened to the fields that change. event: message data: { "id": "019c9a52-7d18-7e2b-9f01-6e3b98c4d2af", "progress": 0, "status": "PENDING" } event: message data: { "id": "019c9a52-7d18-7e2b-9f01-6e3b98c4d2af", "type": "creative-lab-keycap-build", "status": "SUCCEEDED", "progress": 100, "created_at": 1753142600000, "started_at": 1753142610000, "finished_at": 1753143050000, "expires_at": 1753402250000, "task_error": null, "consumed_credits": 50, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/output/model.glb?Expires=***", "obj_zip": "https://assets.meshy.ai/***/tasks/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/output/model-obj.zip?Expires=***" }, "process_image_urls": { "head_design": "https://assets.meshy.ai/***/head-design.png?Expires=***" } } ``` --- ## GET /openapi/creative-lab/keycap/v1/(prototype|build) -- List Keycap tasks Returns your Keycap tasks of one stage, one page at a time. The path selects the stage. `/prototype` returns only prototype tasks, and `/build` returns only build tasks. ### Path parameters - `stage` · *path* · **required** The stage to list, `prototype` or `build`. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [prototype task objects](#the-keycap-prototype-task-object) or [build task objects](#the-keycap-build-task-object), matching the stage in the path. **cURL** ```bash # List prototype tasks curl https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # List build tasks curl https://api.meshy.ai/openapi/creative-lab/keycap/v1/build?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/keycap/v1/prototype", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response (List Prototype Tasks)** ```json [ { "id": "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef", "type": "creative-lab-keycap-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1753142456000, "started_at": 1753142460000, "finished_at": 1753142516000, "expires_at": 1753401716000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 12, "image_urls": [ "https://assets.meshy.ai/***/design-1.png?Expires=***" ], "candidate_ids": [ "0198c1b2-33f5-7d21-a4b7-8e9d0c1f2a3b" ] } ] ``` --- ## The Keycap prototype task object A prototype task generates one image of the finished keycap from a photo. To turn the design into a 3D keycap, pass the task's ID to the [build endpoint](#create-a-keycap-build-task) as `input_task_id`, with its `candidate_ids` entry as `candidate_id`. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-keycap-prototype`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `image_urls` · *array of strings* Download URLs for the image of the finished keycap. The array has one URL after the task succeeds, and is empty until then. `image_urls[i]` shows the candidate in `candidate_ids[i]`. These URLs are for display. The build endpoint takes an entry from `candidate_ids`, not a URL. They're signed URLs, so fetch them without an `Authorization` header. They stay valid until `expires_at`, and getting the task again returns the same URLs. - `candidate_ids` · *array of strings* IDs of the candidates, in the same order as `image_urls`. To build a candidate, send its ID as `candidate_id` in the build request. Don't rely on the format of these IDs. **Example Keycap Prototype Task Object** ```json { "id": "019c9a4e-2b31-7f6a-8c44-5d2a87b3c1ef", "type": "creative-lab-keycap-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1753142456000, "started_at": 1753142460000, "finished_at": 1753142516000, "expires_at": 1753401716000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 12, "image_urls": [ "https://assets.meshy.ai/***/design-1.png?Expires=***" ], "candidate_ids": [ "0198c1b2-33f5-7d21-a4b7-8e9d0c1f2a3b" ] } ``` --- ## The Keycap build task object A build task generates the textured 3D keycap from a succeeded prototype task and one of its candidates. It generates the 3D model, colors it, seats and cuts it onto the keycap base, and then assembles and exports the keycap. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-keycap-build`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `model_urls` · *object* Download URLs for the 3D model. Meshy exports the GLB file and the OBJ bundle at real-world scale in millimeters, Y-up, with the front of the keycap facing +Z. The model has meshes named `keycap-head` and `keycap-base`. When Meshy falls back to a pattern fill for the base, the model also has a `keycap-base-interior` mesh for the stem cavity. Don't assume the model has exactly two meshes. These are signed URLs, so fetch them without an `Authorization` header. They stay valid until `expires_at`, and getting the task again before then returns the same URLs. An expired URL can't be renewed, so download and store the files before then. - `glb` · *string* Download URL for the textured GLB file, `model.glb`. - `obj_zip` · *string* Download URL for the OBJ bundle, a ZIP file with `model.obj`, `model.mtl`, and the PNG textures that `model.mtl` uses. With a solid-color base, the only texture is `keycap-head.png`. With a patterned base, the ZIP file also has `keycap-base.png`. - `process_image_urls` · *object* Download URLs for images from the build's steps, keyed by kind. Like `model_urls`, they're signed URLs, so fetch them without an `Authorization` header. They stay valid until `expires_at`, and getting the task again returns the same URLs. It can have these keys: * `head_design`: the design image of the chosen candidate, which the build turned into 3D. Always present. * `composite`: the image of the finished keycap for the chosen candidate, which the build painted the base from. Can be missing. * `base_canvas`: the painted keycap base. Can be missing. Meshy may add keys, so ignore a key you don't recognize. **Example Keycap Build Task Object** ```json { "id": "019c9a52-7d18-7e2b-9f01-6e3b98c4d2af", "type": "creative-lab-keycap-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1753142600000, "started_at": 1753142610000, "finished_at": 1753143050000, "expires_at": 1753402250000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 50, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/output/model.glb?Expires=***", "obj_zip": "https://assets.meshy.ai/***/tasks/019c9a52-7d18-7e2b-9f01-6e3b98c4d2af/output/model-obj.zip?Expires=***" }, "process_image_urls": { "head_design": "https://assets.meshy.ai/***/head-design.png?Expires=***", "composite": "https://assets.meshy.ai/***/composite.png?Expires=***", "base_canvas": "https://assets.meshy.ai/***/base-canvas.png?Expires=***" } } ``` --- ## End-to-end example The example runs the whole flow: 1. Create a prototype task from a photo. 2. Get the task until its `status` is `SUCCEEDED`. 3. Pick a candidate from `candidate_ids`. 4. Create a build task with that candidate. 5. Get the build task until its `status` is `SUCCEEDED`. 6. Download the GLB file and the OBJ bundle from `model_urls`. The example picks the first candidate. In your app, show the `image_urls` entries to your users and let them choose. A chosen image's index in `image_urls` is the index of its ID in `candidate_ids`. **cURL** ```bash #!/usr/bin/env bash set -euo pipefail # Requires curl and jq. Point IMAGE_PATH at a local photo, or IMAGE_URL at a public one: # export MESHY_API_KEY=msy_... # export IMAGE_PATH=./portrait.jpg # or: export IMAGE_URL=https://... : "${MESHY_API_KEY:?export MESHY_API_KEY first}" if [[ -z "${IMAGE_PATH:-}" && -z "${IMAGE_URL:-}" ]]; then echo "export IMAGE_PATH (local file) or IMAGE_URL (public url) first" >&2 exit 1 fi BASE="https://api.meshy.ai/openapi/creative-lab/keycap/v1" AUTH="Authorization: Bearer $MESHY_API_KEY" # api METHOD URL [curl args...] -> prints the response body, non-zero on failure. # Note we do not use -f/--fail: it discards the body, and the body is the only # place the reason appears. api() { local method=$1 url=$2 out http_code body shift 2 out=$(curl --silent --show-error --max-time 60 --write-out $'\n%{http_code}' \ -X "$method" "$url" -H "$AUTH" "$@") || return 1 http_code=${out##*$'\n'} body=${out%$'\n'*} if ((http_code >= 400)); then echo "HTTP $http_code for $url: $body" >&2 return 1 fi printf '%s' "$body" } # Each task gets its own 40-minute budget. poll() { local kind=$1 id=$2 delay=5 task_status deadline deadline=$(($(date +%s) + 2400)) while :; do if (($(date +%s) >= deadline)); then echo "gave up waiting for $kind $id" >&2 return 1 fi task_status=$(api GET "$BASE/$kind/$id" | jq -r '.status') echo "$kind: $task_status" case "$task_status" in SUCCEEDED) return 0 ;; FAILED | CANCELED) return 1 ;; esac sleep "$delay" delay=$((delay * 2 > 30 ? 30 : delay * 2)) done } # Build the request body in a file. A base64 data URI must never go on the # command line or into an exported variable - a photo of any real size will # exceed the OS argument limit. BODY=$(mktemp) trap 'rm -f "$BODY"' EXIT if [[ -n "${IMAGE_PATH:-}" ]]; then # Declare the real type: the API accepts JPEG, PNG and WebP. case "$(printf '%s' "${IMAGE_PATH##*.}" | tr 'A-Z' 'a-z')" in png) MIME=image/png ;; webp) MIME=image/webp ;; *) MIME=image/jpeg ;; esac { printf '{"image_url":"data:%s;base64,' "$MIME" base64 <"$IMAGE_PATH" | tr -d '\n' printf '"}' } >"$BODY" else printf '{"image_url":"%s"}' "$IMAGE_URL" >"$BODY" fi # 1. Create the prototype task PROTO_ID=$(api POST "$BASE/prototype" \ -H 'Content-Type: application/json' --data-binary @"$BODY" | jq -r '.result') # 2. Wait for the design render poll prototype "$PROTO_ID" # 3. Pick a candidate (first one here; show image_urls to a user in production) CANDIDATE_ID=$(api GET "$BASE/prototype/$PROTO_ID" | jq -r '.candidate_ids[0]') # 4. Create the build task jq -n --arg p "$PROTO_ID" --arg c "$CANDIDATE_ID" \ '{input_task_id: $p, candidate_id: $c}' >"$BODY" BUILD_ID=$(api POST "$BASE/build" \ -H 'Content-Type: application/json' --data-binary @"$BODY" | jq -r '.result') # 5. Wait for the model (a build usually takes 3-7 minutes) poll build "$BUILD_ID" # 6. Download the artifacts. These are signed URLs: no Authorization header, # and they stay valid for 3 days after the task finishes. TASK=$(api GET "$BASE/build/$BUILD_ID") curl --silent --show-error --fail --max-time 900 \ -o keycap.glb "$(jq -r '.model_urls.glb' <<<"$TASK")" curl --silent --show-error --fail --max-time 900 \ -o keycap-obj.zip "$(jq -r '.model_urls.obj_zip' <<<"$TASK")" echo "Done: keycap.glb + keycap-obj.zip" ``` ```python # Requires the requests package: pip install requests import base64 import os import time import requests BASE = "https://api.meshy.ai/openapi/creative-lab/keycap/v1" REQUEST_TIMEOUT = 60 # per HTTP call TASK_DEADLINE = 2400 # give up on a single task after 40 minutes def env(name: str) -> str: value = os.environ.get(name) if not value: raise SystemExit(f"set {name} before running") return value # Point IMAGE_PATH at a local photo, or IMAGE_URL at a public one: # export MESHY_API_KEY=msy_... # export IMAGE_PATH=./portrait.jpg # or: export IMAGE_URL=https://... HEADERS = {"Authorization": f"Bearer {env('MESHY_API_KEY')}"} def source_image() -> str: path = os.environ.get("IMAGE_PATH") if path: # Encode here, in the process. A base64 data URI passed on a command # line or through an exported variable will exceed the OS argument # limit for a photo of any real size. # Declare the real type: the API accepts JPEG, PNG and WebP. mime = {"png": "image/png", "webp": "image/webp"}.get( os.path.splitext(path)[1].lower().lstrip("."), "image/jpeg") with open(path, "rb") as f: return f"data:{mime};base64," + base64.b64encode(f.read()).decode() if not os.environ.get("IMAGE_URL"): raise SystemExit("set IMAGE_PATH (local file) or IMAGE_URL (public url) first") return os.environ["IMAGE_URL"] def check(resp: requests.Response) -> dict: # raise_for_status()'s message omits the response body, and the body is # where the reason is. if not resp.ok: raise RuntimeError(f"HTTP {resp.status_code} for {resp.url}: {resp.text[:500]}") return resp.json() def poll(stage: str, task_id: str) -> dict: deadline = time.monotonic() + TASK_DEADLINE delay = 5 while True: if time.monotonic() > deadline: raise TimeoutError(f"gave up waiting for {stage} {task_id}") data = check(requests.get(f"{BASE}/{stage}/{task_id}", headers=HEADERS, timeout=REQUEST_TIMEOUT)) print(f"{stage}: {data['status']} ({data['progress']}%)") if data["status"] == "SUCCEEDED": return data if data["status"] in ("FAILED", "CANCELED"): raise RuntimeError( f"{stage} task {task_id} ended as {data['status']}: {data['task_error']}") time.sleep(delay) delay = min(delay * 2, 30) # 1. Create the prototype task prototype_id = check(requests.post( f"{BASE}/prototype", headers=HEADERS, json={"image_url": source_image()}, timeout=REQUEST_TIMEOUT, ))["result"] # 2. Wait for the design render prototype = poll("prototype", prototype_id) # 3. Pick a candidate (first one here; show image_urls to a user in production) candidate_id = prototype["candidate_ids"][0] # 4. Create the build task build_id = check(requests.post( f"{BASE}/build", headers=HEADERS, json={"input_task_id": prototype_id, "candidate_id": candidate_id}, timeout=REQUEST_TIMEOUT, ))["result"] # 5. Wait for the model (a build usually takes 3-7 minutes) build = poll("build", build_id) # 6. Download the artifacts. These are signed URLs: no Authorization header, # and they stay valid for 3 days after the task finishes. for key, filename in (("glb", "keycap.glb"), ("obj_zip", "keycap-obj.zip")): with requests.get(build["model_urls"][key], stream=True, timeout=(60, 900)) as dl: if not dl.ok: raise RuntimeError(f"download {key} failed: HTTP {dl.status_code}") with open(filename, "wb") as f: for chunk in dl.iter_content(chunk_size=1 << 20): f.write(chunk) print(f"Saved {filename}") ``` --- # Creative Lab — Collapsible Fidget API Source: https://docs.meshy.ai/api/creative-lab-fidget-collapsible # Creative Lab Collapsible Fidget API Turn a photo into a print-in-place collapsible fidget toy in one task. The subject's silhouette becomes nested concentric rings that collapse flat and stretch out again. The toy prints in one piece, with no assembly. - `POST /openapi/creative-lab/fidget-collapsible/v1` Unlike the other Creative Lab endpoints, this one has no separate prototype and build stages. There are no candidate images to choose between, so one task turns the photo into a 3D model. The request has no geometry settings either. The web app lets you set the size, layer count, gap width, wall thickness, extrusion depth, and bulge. Every API task uses the same default values for them. --- ## POST /openapi/creative-lab/fidget-collapsible/v1 -- Create a Collapsible Fidget task Generates a collapsible fidget model from a photo. For the task's fields, see [The Collapsible Fidget task object](#the-collapsible-fidget-task-object). Each task costs 6 credits and needs a paid plan. ### Parameters - `image_url` · *string* · **required** The photo to turn into a collapsible fidget, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB. The subject's silhouette becomes the rings, so a subject with one clear, closed outline works best. A busy background, several separate subjects, or very thin shapes can leave too little area for the nested walls. In that case, the task fails. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field, and Meshy doesn't engrave it on the model. A longer name returns `400`. ### Returns The `result` field holds the ID of the new task. [Get the task](#retrieve-a-collapsible-fidget-task) or [stream it](#stream-a-collapsible-fidget-task) until `status` is `SUCCEEDED`. Then download the printable STL file from `model_urls.stl`. To preview the model first, download the GLB file from `model_urls.glb` when it's present. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` is missing. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * The image was flagged as NSFW. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash curl https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1 \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const payload = { image_url: "", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } payload = { "image_url": "", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "018a210d-8ba4-705c-b111-1f1776f7f578" } ``` --- ## GET /openapi/creative-lab/fidget-collapsible/v1/:id -- Get a Collapsible Fidget task Returns a Collapsible Fidget task. Only tasks created with this endpoint are returned. A task from another Creative Lab endpoint, or one created in the web app, returns `404`. For the fields, see [The Collapsible Fidget task object](#the-collapsible-fidget-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [Collapsible Fidget task object](#the-collapsible-fidget-task-object). ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the task's image for third-party intellectual property. Teams on the Enterprise plan don't get this error. Create a task from an image you have the rights to use. - `404 - Not Found` No Collapsible Fidget task with this ID belongs to your account, or the task wasn't created with this endpoint. Check the ID. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash curl https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578'; const { data } = await axios.get( `https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/${taskId}`, { headers } ); console.log(data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" response = requests.get( f"https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/{task_id}", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-fidget-collapsible", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123512000, "expires_at": 1729382712000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" } } ``` --- ## DELETE /openapi/creative-lab/fidget-collapsible/v1/:id -- Delete a Collapsible Fidget task Cancels a Collapsible Fidget task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Collapsible Fidget task with this ID belongs to your account, or the task wasn't created with this endpoint. Check the ID. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/018a210d-8ba4-705c-b111-1f1776f7f578 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '018a210d-8ba4-705c-b111-1f1776f7f578' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "018a210d-8ba4-705c-b111-1f1776f7f578" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/fidget-collapsible/v1/:id/stream -- Stream a Collapsible Fidget task Streams a Collapsible Fidget task's updates as Server-Sent Events (SSE). If the task doesn't exist or wasn't created with this endpoint, the stream sends one `error` event with `status_code: 404` and closes. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [Collapsible Fidget task objects](#the-collapsible-fidget-task-object). Each event has the full task object, as [Get a Collapsible Fidget task](#retrieve-a-collapsible-fidget-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/018a210d-8ba4-705c-b111-1f1776f7f578/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/018a210d-8ba4-705c-b111-1f1776f7f578/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1/018a210d-8ba4-705c-b111-1f1776f7f578/stream', headers=headers, stream=True ) for line in response.iter_lines(): if line: if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) print(data) if data['status'] in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (task not found, or not created through this endpoint) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object; fields not yet populated are null / empty. // The following PENDING frame is shortened to the fields that change. event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "progress": 0, "status": "PENDING" } event: message data: { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-fidget-collapsible", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123512000, "expires_at": 1729382712000, "task_error": null, "consumed_credits": 6, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" } } ``` --- ## GET /openapi/creative-lab/fidget-collapsible/v1 -- List Collapsible Fidget tasks Returns your Collapsible Fidget tasks, one page at a time. Only tasks created with this endpoint are included. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [Collapsible Fidget task objects](#the-collapsible-fidget-task-object). **cURL** ```bash curl https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/fidget-collapsible/v1", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-fidget-collapsible", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123512000, "expires_at": 1729382712000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" } } ] ``` --- ## The Collapsible Fidget task object A Collapsible Fidget task turns a photo into a print-in-place collapsible fidget model. It's a single-stage task, so there's no prototype task to chain from. The response doesn't include the silhouette that Meshy makes along the way. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-fidget-collapsible`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `model_urls` · *object* Download URLs for the 3D model, empty until the task succeeds. A succeeded task always has `stl`, and has `glb` only if Meshy rendered the preview. - `stl` · *string* Download URL for the STL file, which is the file to print. You can open it directly in a slicer. - `glb` · *string* Download URL for a GLB file to preview the model in a 3D viewer. Its colors are for the preview only. The STL file has no color, so the printed fidget takes its color from the filament. If Meshy can't render the preview, `model_urls` has no `glb` key, so check for the key before you read it. A `SUCCEEDED` task always has `stl`. **Example Collapsible Fidget Task Object** ```json { "id": "018a210d-8ba4-705c-b111-1f1776f7f578", "type": "creative-lab-fidget-collapsible", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1729123456000, "started_at": 1729123460000, "finished_at": 1729123512000, "expires_at": 1729382712000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "model_urls": { "glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***", "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" } } ``` --- # Creative Lab — Fidget Pixel API Source: https://docs.meshy.ai/api/creative-lab-fidget-pixel # Creative Lab Fidget Pixel API Turn a photo into a multi-color, 3D-printable pixel-art fidget board in two stages. A prototype task turns the photo into a pixel-art image. A build task turns that image into interlocking pieces in a single 3MF file, and takes the prototype task's ID as `input_task_id`. - `POST /openapi/creative-lab/fidget-pixel/v1/prototype` - `POST /openapi/creative-lab/fidget-pixel/v1/build` Both `POST` endpoints need a paid plan. A request from a free-plan account returns `402`. --- ## POST /openapi/creative-lab/fidget-pixel/v1/prototype -- Create a Fidget Pixel prototype task Generates one pixel-art image from a photo. To build the pieces, pass this task's ID to the [build endpoint](#create-a-fidget-pixel-build-task) as `input_task_id`. For the task's fields, see [The Fidget Pixel prototype task object](#the-fidget-pixel-prototype-task-object). If you don't like the image, create another prototype task. Each task is charged separately. ### Parameters - `image_url` · *string* · **required** The photo to turn into pixel art, as a public URL or a data URI (`data:image/jpeg;base64,`). The image must be a JPG, JPEG, PNG, or WebP file of at most 20 MB. Meshy detects the format from the image data, not from the file extension in the URL. A URL with no extension works, and Meshy follows redirects. - `type` · *string* · **required** What the photo shows, which sets the pixel-art style. The two styles look clearly different. Any other value returns `400`. Available values: * `person`: a person, in a portrait or a full-body photo. Meshy draws a chibi-style pixel sprite. * `other`: any other subject, for example a pet, an object, a mascot, a logo, or a landscape. Meshy draws a bead-art style pixel icon. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. ### Returns The `result` field holds the ID of the new prototype task. [Get the task](#retrieve-a-fidget-pixel-task) or [stream it](#stream-a-fidget-pixel-task) until `status` is `SUCCEEDED`. Then pass the ID to the [build endpoint](#create-a-fidget-pixel-build-task) as `input_task_id`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `image_url` or `type` is missing. * `type` isn't `person` or `other`. * The image isn't a JPG, JPEG, PNG, or WebP file. * The image is too small, over 20 MB, or over the maximum pixel count. * Meshy can't download the image, for example because the URL returns `404` or times out. * The data URI isn't valid base64. * The image was flagged as NSFW. The error message says which problem it found. Fix the request, then send it again. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the image for third-party intellectual property. Send an image you have the rights to use. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 1: pixelize the source photo curl https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "image_url": "", "type": "person" }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 1: pixelize the source photo const payload = { image_url: "", type: "person", }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 1: pixelize the source photo payload = { "image_url": "", "type": "person", } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7" } ``` --- ## POST /openapi/creative-lab/fidget-pixel/v1/build -- Create a Fidget Pixel build task Generates the 3D-printable pieces from a succeeded prototype task. Meshy samples the pixel-art image onto the grid and reduces it to at most `color_count` colors. Each cell of the subject becomes an interlocking piece, and the background isn't printed. The result is a single multi-color 3MF file, ready to print in color. Each piece has a grey body and a top in its pixel's color. For its fields, see [The Fidget Pixel build task object](#the-fidget-pixel-build-task-object). ### Parameters - `input_task_id` · *string* · **required** The ID of the prototype task to build. It must be a task your account created with `POST /openapi/creative-lab/fidget-pixel/v1/prototype`, with the status `SUCCEEDED`. An ID that isn't one of your Fidget Pixel prototype tasks from the API returns `404`, including a prototype made in the web app. - `name` · *string* A name for the task, up to 100 characters. It comes back in the task's `name` field. A longer name returns `400`. #### `options` Settings for the shape and size of the pieces. Every field has a default, so send only the fields you want to change. A `0` uses the field's default. These are the same settings as in the Creative Lab web app. Other shape settings are fixed, and Meshy sets them from `shape` and `piece_size_mm`. - `shape` · *string* · default: `square` The footprint of each piece. Any other value returns `400`. Available values: * `square`: square pieces on a square grid * `hex`: hexagonal pieces on a hexagonal grid, with `piece_size_mm` set to `6` or `8` - `grid_size` · *integer* · default: `32` The number of grid cells along each side of the board, `16` or `32`. Any other value returns `400`. A `32` grid keeps more detail. A `16` grid gives fewer pieces of the same size, so the board is about half as wide. - `piece_size_mm` · *integer* · default: `8` The edge length of each piece in millimeters, `6`, `8`, or `10`. Any other value returns `400`. With `grid_size`, it sets the size of the printed board. For example, a `32` grid of 8 mm pieces is about 26.5 cm per side. `10` doesn't work with `hex` and returns `400`, because the slanted hex face overhangs on most consumer FDM printers. - `color_count` · *integer* · default: `8` The maximum number of colors in the pixel-art palette, from `1` to `8`. A value outside the range returns `400`. To print, you need up to `color_count` plus one filaments, one per color and one for the grey bodies. - `piece_height_mm` · *integer* · default: `15` The height of each piece in millimeters, from `10` to `80`. A value outside the range returns `400`. #### `output` Settings for the result file. - `format` · *string* · default: `3mf` The file format of the result. Any other value returns `400`. Available values: * `3mf`: one multi-color `model.3mf` file, returned in `model_urls.3mf` ### Returns The `result` field holds the ID of the new build task. [Get the task](#retrieve-a-fidget-pixel-task) or [stream it](#stream-a-fidget-pixel-task) until `status` is `SUCCEEDED`. Then download the 3MF file from `model_urls.3mf`. ### Failure modes - `400 - Bad Request` The request can't run. For example: * `input_task_id` is missing or isn't a valid task ID. * The prototype task's status isn't `SUCCEEDED`. If it's still running, wait and retry. If it failed or was canceled, create a new prototype task. * The prototype task succeeded but has no image. Create a new prototype task. * An `options` field is outside its allowed values, for example a `grid_size` other than `16` or `32`. * `piece_size_mm` is `10` and `shape` is `hex`. Hex pieces come in 6 and 8 mm only. * `output.format` isn't `3mf`. The error message says which problem it found. - `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 API key, workspace, or member reached its credit limit. * The account is on the free plan. Check your credits and plan, then retry. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the prototype task's image for third-party intellectual property. Create a prototype task from an image you have the rights to use. - `404 - Not Found` `input_task_id` doesn't match any Fidget Pixel prototype task your account created with the API. A prototype made in the web app also returns `404`. Send the `result` ID from a prototype create response. - `429 - Too Many Requests` One of these limits was reached: * You sent more requests than your rate limit allows. Wait a few seconds, then retry. See [Rate limits](/api/rate-limits). * 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. - `500 - Internal Server Error` Meshy hit a server error, for example because it couldn't run the intellectual property check on the prototype task's image. Meshy doesn't create the task, and refunds any credits it charged. Retry the request. **cURL** ```bash # Stage 2: chain build off a succeeded prototype task curl https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build \ -X POST \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -H 'Content-Type: application/json' \ -d '{ "input_task_id": "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7", "options": { "shape": "square", "grid_size": 32, "piece_size_mm": 8, "color_count": 8, "piece_height_mm": 15 }, "output": { "format": "3mf" } }' ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Stage 2: chain build off a succeeded prototype task const payload = { input_task_id: "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7", options: { shape: "square", grid_size: 32, piece_size_mm: 8, color_count: 8, piece_height_mm: 15, }, output: { format: "3mf" }, }; try { const response = await axios.post( 'https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build', payload, { headers } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Stage 2: chain build off a succeeded prototype task payload = { "input_task_id": "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7", "options": { "shape": "square", "grid_size": 32, "piece_size_mm": 8, "color_count": 8, "piece_height_mm": 15, }, "output": {"format": "3mf"}, } response = requests.post( "https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build", headers=headers, json=payload, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "result": "019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98" } ``` --- ## GET /openapi/creative-lab/fidget-pixel/v1/(prototype|build)/:id -- Get a Fidget Pixel task Returns a prototype or build task. The path must match the task's stage. A build task requested through `/prototype/:id` returns `404`, and so does a prototype task requested through `/build/:id`. For the fields, see [The Fidget Pixel prototype task object](#the-fidget-pixel-prototype-task-object) and [The Fidget Pixel build task object](#the-fidget-pixel-build-task-object). ### Parameters - `id` · *path* The task ID from the create response. ### Returns The [prototype task object](#the-fidget-pixel-prototype-task-object) or the [build task object](#the-fidget-pixel-build-task-object), matching the stage in the path. ### Failure modes - `400 - Bad Request` `id` isn't a valid task ID. Send the `result` ID from the create response. - `403 - Forbidden` Your team has **IP Filtering** turned on, and Meshy flagged the prototype task's image for third-party intellectual property. Build tasks and teams on the Enterprise plan don't get this error. Create a prototype task from an image you have the rights to use. - `404 - Not Found` No Fidget Pixel task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. - `500 - Internal Server Error` Meshy couldn't run the intellectual property check. Retry the request. **cURL** ```bash # Prototype curl https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype/019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # Build curl https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build/019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` }; // Prototype const prototypeId = '019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7'; const proto = await axios.get( `https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype/${prototypeId}`, { headers } ); console.log(proto.data); // Build const buildId = '019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98'; const build = await axios.get( `https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build/${buildId}`, { headers } ); console.log(build.data); ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } # Prototype prototype_id = "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7" proto = requests.get( f"https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype/{prototype_id}", headers=headers, ) proto.raise_for_status() print(proto.json()) # Build build_id = "019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98" build = requests.get( f"https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build/{build_id}", headers=headers, ) build.raise_for_status() print(build.json()) ``` **Prototype Response** ```json { "id": "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7", "type": "creative-lab-fidget-pixel-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1757001000000, "started_at": 1757001005000, "finished_at": 1757001178000, "expires_at": 1757260378000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/pixel-art.jpg?Expires=***" ] } ``` **Build Response** ```json { "id": "019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98", "type": "creative-lab-fidget-pixel-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1757001300000, "started_at": 1757001304000, "finished_at": 1757001309000, "expires_at": 1757260509000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "model_urls": { "3mf": "https://assets.meshy.ai/***/tasks/019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98/output/model.3mf?Expires=***" } } ``` --- ## DELETE /openapi/creative-lab/fidget-pixel/v1/(prototype|build)/:id -- Delete a Fidget Pixel task Cancels a Fidget Pixel task. Canceling a `PENDING` task refunds its credits. An `IN_PROGRESS` task is canceled without a refund, because a worker has already started it. A task with a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`) can't be canceled. The path must match the task's stage. For example, `DELETE` on `/prototype/:id` with a build task's ID returns `404`. ### Path parameters - `id` · *path* The ID of the task to cancel. ### Returns `204 No Content` with an empty body. ### Failure modes - `400 - Bad Request` One of these applies: * `id` isn't a valid task ID. Send the `result` ID from the create response. * The task already has a final status (`SUCCEEDED`, `FAILED`, or `CANCELED`), so it can't be canceled. - `404 - Not Found` No Fidget Pixel task with this ID belongs to your account, or the task's stage doesn't match the path. Check the ID, and use `/prototype` or `/build` to match the task. **cURL** ```bash curl --request DELETE \ --url https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype/019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const taskId = '019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { await axios.delete( `https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype/${taskId}`, { headers } ) } catch (error) { console.error(error) } ``` ```python import requests task_id = "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7" headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.delete( f"https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype/{task_id}", headers=headers, ) response.raise_for_status() ``` **Response** ```json // Returns 204 No Content on success (empty body). ``` --- ## GET /openapi/creative-lab/fidget-pixel/v1/(prototype|build)/:id/stream -- Stream a Fidget Pixel task Streams a Fidget Pixel task's updates as Server-Sent Events (SSE). The path must match the task's stage. If it doesn't, for example a build task's ID at `/prototype/:id/stream`, the stream sends one `error` event with `status_code: 404` and closes. An `id` that isn't a valid task ID does the same with `status_code: 400`. ### Parameters - `id` · *path* The task ID from the create response. ### Returns A stream of [prototype](#the-fidget-pixel-prototype-task-object) or [build](#the-fidget-pixel-build-task-object) task objects. Each event has the full task object, as [Get a Fidget Pixel task](#retrieve-a-fidget-pixel-task) returns it. While the task is `PENDING` or `IN_PROGRESS`, its output fields are still empty (`null`, `[]`, or `{}`), and `finished_at` is `null`. If **IP Filtering** blocks the task's result, the stream sends one `error` event in its place, with the `status_code` that a get request would return. **cURL** ```bash curl -N https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build/019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98/stream \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript const response = await fetch( 'https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build/019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98/stream', { headers: { Authorization: `Bearer ${YOUR_API_KEY}` } } ); const reader = response.body.getReader(); const decoder = new TextDecoder(); let buffer = ''; let event = 'message'; while (true) { const { done, value } = await reader.read(); if (done) break; buffer += decoder.decode(value, { stream: true }); const lines = buffer.split('\n'); buffer = lines.pop(); for (const line of lines) { if (line.startsWith('event:')) { event = line.slice(6).trim(); continue; } if (line.startsWith('data:')) { const data = JSON.parse(line.slice(5)); if (event === 'error') { // {"status_code": 404, "message": "Task not found"} - no `status` key console.error('stream error:', data); reader.cancel(); break; } console.log(data); if (['SUCCEEDED', 'FAILED', 'CANCELED'].includes(data.status)) { reader.cancel(); } } } } ``` ```python import requests import json headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Accept": "text/event-stream" } response = requests.get( 'https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build/019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98/stream', headers=headers, stream=True ) event = 'message' for line in response.iter_lines(): if not line: continue if line.startswith(b'event:'): event = line.decode('utf-8')[6:].strip() continue if line.startswith(b'data:'): data = json.loads(line.decode('utf-8')[5:]) if event == 'error': # {"status_code": 404, "message": "Task not found"} - no `status` key print('stream error:', data) break print(data) if data.get('status') in ['SUCCEEDED', 'FAILED', 'CANCELED']: break response.close() ``` **Response Stream** ```javascript // Error event example (wrong stage or task not found) event: error data: { "status_code": 404, "message": "Task not found" } // Message event examples illustrate task progress. // Every frame is the full task object for the stage; fields not yet populated are null / empty. event: message data: { "id": "019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98", "type": "creative-lab-fidget-pixel-build", "name": "", "status": "PENDING", "progress": 0, "created_at": 1757001300000, "started_at": null, "finished_at": null, "expires_at": 1757260500000, "preceding_tasks": 2, "task_error": null, "consumed_credits": 30, "model_urls": {} } event: message data: { "id": "019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98", "type": "creative-lab-fidget-pixel-build", "status": "SUCCEEDED", "progress": 100, "created_at": 1757001300000, "started_at": 1757001304000, "finished_at": 1757001309000, "expires_at": 1757260509000, "task_error": null, "consumed_credits": 30, "model_urls": { "3mf": "https://assets.meshy.ai/***/tasks/019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98/output/model.3mf?Expires=***" } } ``` --- ## GET /openapi/creative-lab/fidget-pixel/v1/(prototype|build) -- List Fidget Pixel tasks Returns your Fidget Pixel tasks of one stage, one page at a time. The path selects the stage. `/prototype` returns only prototype tasks, and `/build` returns only build tasks. ### Path parameters - `stage` · *path* · **required** The stage to list, `prototype` or `build`. ### Query parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. `0` returns the first page. A value outside `0` to `255` returns `400`. - `page_size` · *integer* · default: `10` Number of tasks per page, up to `100`. A value from `101` to `255` returns 100 tasks, and `0` uses the default. A value outside `0` to `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `-created_at`: newest first * `+created_at`: oldest first ### Returns An array of [prototype task objects](#the-fidget-pixel-prototype-task-object) or [build task objects](#the-fidget-pixel-build-task-object), matching the stage in the path. **cURL** ```bash # List prototype tasks curl https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" # List build tasks curl https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/build?page_size=10 \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios' const headers = { Authorization: `Bearer ${YOUR_API_KEY}` } try { const { data } = await axios.get( 'https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype', { headers, params: { page_size: 10 } } ) console.log(data) } catch (error) { console.error(error) } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1/prototype", headers=headers, params={"page_size": 10}, ) response.raise_for_status() print(response.json()) ``` **Response (List Prototype Tasks)** ```json [ { "id": "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7", "type": "creative-lab-fidget-pixel-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1757001000000, "started_at": 1757001005000, "finished_at": 1757001178000, "expires_at": 1757260378000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/pixel-art.jpg?Expires=***" ] } ] ``` --- ## The Fidget Pixel prototype task object A prototype task turns a photo into a pixel-art image. To turn the image into 3D-printable pieces, pass the task's ID to the [build endpoint](#create-a-fidget-pixel-build-task) as `input_task_id`. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-fidget-pixel-prototype`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `image_urls` · *array of strings* Download URLs for the pixel-art image. The array has one URL after the task succeeds, and is empty until then. The URLs are signed, so fetch them without an `Authorization` header. They stay valid until `expires_at`. Getting the task again before then returns the same URLs, not newly signed ones. An expired URL can't be refreshed, so download and store the files before then. **Example Fidget Pixel Prototype Task Object** ```json { "id": "019c4a1e-2b7d-7d03-8f6a-5c2e91f0a1b7", "type": "creative-lab-fidget-pixel-prototype", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1757001000000, "started_at": 1757001005000, "finished_at": 1757001178000, "expires_at": 1757260378000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 6, "image_urls": [ "https://assets.meshy.ai/***/pixel-art.jpg?Expires=***" ] } ``` --- ## The Fidget Pixel build task object A build task generates the 3D-printable pieces from a succeeded prototype task. Meshy samples the pixel-art image onto the grid and returns the pieces in a single multi-color 3MF file. ### Properties - `id` · *string* The task ID. Don't rely on its format. - `type` · *string* The task type, always `creative-lab-fidget-pixel-build`. - `name` · *string* The `name` you sent when you created the task, or `""` if you didn't send one. - `status` · *string* The task's status. Available values: * `PENDING`: waiting in the queue * `IN_PROGRESS`: generating the result * `SUCCEEDED`: final, with the result * `FAILED`: final, with the reason in `task_error` * `CANCELED`: final, with no result - `progress` · *integer* Percentage of the work done, from `0` to `100`. It's `0` until the task starts and `100` when it succeeds. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `started_at` · *timestamp* Time a worker started the task, in Unix milliseconds. `null` until then. - `finished_at` · *timestamp* Time the task reached a final status, in Unix milliseconds. `null` until then. - `expires_at` · *timestamp* Time the task's result expires, in Unix milliseconds. It's 3 days after `finished_at`, or 3 days after `created_at` until the task finishes. For Enterprise accounts, which keep API results indefinitely, it's about 100 years later. See [Asset retention](/api/asset-retention). - `preceding_tasks` · *integer* The task's position in the queue while it's `PENDING`. `1` means it starts next. `0` after the task leaves the queue, and always `0` in list results. - `task_error` · *object* Why the task failed. `null` unless `status` is `FAILED`. See [Errors](/api/errors#task-errors). - `consumed_credits` · *integer* Number of credits charged for the task, after any refund. A request that returns an error isn't charged. A failed task is `0`, because Meshy refunds it. Canceling refunds a task only while it's `PENDING`. If Meshy can't read the charge, a get or stream response leaves the field out, and a list request returns `500`. In that case, retry the request. - `model_urls` · *object* Download URLs for the result, keyed by file format. The object has one entry, for the `output.format` you sent, and is empty until the task succeeds. The URLs are signed, so fetch them without an `Authorization` header. They stay valid until `expires_at`. Getting the task again before then returns the same URLs, not newly signed ones. An expired URL can't be refreshed, so download and store the files before then. - `3mf` · *string* Download URL for the multi-color 3MF file. Each piece has a grey body and a top in its pixel's color. Present when `output.format` is `3mf`, which is the default. **Example Fidget Pixel Build Task Object** ```json { "id": "019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98", "type": "creative-lab-fidget-pixel-build", "name": "", "status": "SUCCEEDED", "progress": 100, "created_at": 1757001300000, "started_at": 1757001304000, "finished_at": 1757001309000, "expires_at": 1757260509000, "preceding_tasks": 0, "task_error": null, "consumed_credits": 30, "model_urls": { "3mf": "https://assets.meshy.ai/***/tasks/019c4a2f-6e81-7b44-9a1d-0d7f3c5e2b98/output/model.3mf?Expires=***" } } ``` --- ## End-to-end example The following cURL and Python scripts run the whole flow. Each script creates a prototype task from a photo and waits for it to succeed. Then it creates a build task, waits for that task, and downloads the 3MF file from `model_urls.3mf`. The cURL script needs `curl` and `jq`, and the Python script needs the `requests` package. To run a script, follow these steps: 1. Set `MESHY_API_KEY` to your API key. 2. Set `IMAGE_PATH` to the path of a local photo, or `IMAGE_URL` to a public image URL. 3. Optional: To pixelize a subject other than a person, set `PIXEL_TYPE` to `other`. 4. Run the script. A prototype task usually finishes within a few minutes. A build task usually finishes in well under a minute. In your app, show the image from `image_urls` to your user before you create the build task. If they don't like it, create another prototype task instead. This way, you spend build credits only on an image they approve. **cURL** ```bash #!/usr/bin/env bash set -euo pipefail # Requires curl and jq. Point IMAGE_PATH at a local photo, or IMAGE_URL at a public one: # export MESHY_API_KEY=msy_... # export IMAGE_PATH=./portrait.jpg # or: export IMAGE_URL=https://... # export PIXEL_TYPE=person # or: other : "${MESHY_API_KEY:?export MESHY_API_KEY first}" if [[ -z "${IMAGE_PATH:-}" && -z "${IMAGE_URL:-}" ]]; then echo "export IMAGE_PATH (local file) or IMAGE_URL (public url) first" >&2 exit 1 fi PIXEL_TYPE=${PIXEL_TYPE:-person} BASE="https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1" AUTH="Authorization: Bearer $MESHY_API_KEY" # api METHOD URL [curl args...] -> prints the response body, non-zero on failure. # Note we do not use -f/--fail: it discards the body, and the body is the only # place the reason appears. api() { local method=$1 url=$2 out http_code body shift 2 out=$(curl --silent --show-error --max-time 60 --write-out $'\n%{http_code}' \ -X "$method" "$url" -H "$AUTH" "$@") || return 1 http_code=${out##*$'\n'} body=${out%$'\n'*} if ((http_code >= 400)); then echo "HTTP $http_code for $url: $body" >&2 return 1 fi printf '%s' "$body" } # Each task gets its own 40-minute budget. poll() { local kind=$1 id=$2 delay=5 task_status deadline deadline=$(($(date +%s) + 2400)) while :; do if (($(date +%s) >= deadline)); then echo "gave up waiting for $kind $id" >&2 return 1 fi task_status=$(api GET "$BASE/$kind/$id" | jq -r '.status') echo "$kind: $task_status" case "$task_status" in SUCCEEDED) return 0 ;; FAILED | CANCELED) return 1 ;; esac sleep "$delay" delay=$((delay * 2 > 30 ? 30 : delay * 2)) done } # Build the request body in a file. A base64 data URI must never go on the # command line or into an exported variable - a photo of any real size will # exceed the OS argument limit. BODY=$(mktemp) trap 'rm -f "$BODY"' EXIT if [[ -n "${IMAGE_PATH:-}" ]]; then # Declare the real type: the API accepts JPEG, PNG and WebP. case "$(printf '%s' "${IMAGE_PATH##*.}" | tr 'A-Z' 'a-z')" in png) MIME=image/png ;; webp) MIME=image/webp ;; *) MIME=image/jpeg ;; esac { printf '{"type":"%s","image_url":"data:%s;base64,' "$PIXEL_TYPE" "$MIME" base64 <"$IMAGE_PATH" | tr -d '\n' printf '"}' } >"$BODY" else jq -n --arg t "$PIXEL_TYPE" --arg u "$IMAGE_URL" \ '{type: $t, image_url: $u}' >"$BODY" fi # 1. Create the prototype task PROTO_ID=$(api POST "$BASE/prototype" \ -H 'Content-Type: application/json' --data-binary @"$BODY" | jq -r '.result') # 2. Wait for the pixel-art image (show image_urls[0] to a user in production) poll prototype "$PROTO_ID" # 3. Create the build task (defaults: square pieces, 32x32 grid, 8 mm, 8 colors, 15 mm tall) jq -n --arg p "$PROTO_ID" \ '{input_task_id: $p, options: {shape: "square", grid_size: 32, piece_size_mm: 8, color_count: 8, piece_height_mm: 15}, output: {format: "3mf"}}' >"$BODY" BUILD_ID=$(api POST "$BASE/build" \ -H 'Content-Type: application/json' --data-binary @"$BODY" | jq -r '.result') # 4. Wait for the pieces poll build "$BUILD_ID" # 5. Download the 3MF. This is a signed URL: no Authorization header, # and it stays valid for 3 days after the task finishes. TASK=$(api GET "$BASE/build/$BUILD_ID") curl --silent --show-error --fail --max-time 900 \ -o fidget-pixel.3mf "$(jq -r '.model_urls["3mf"]' <<<"$TASK")" echo "Done: fidget-pixel.3mf" ``` ```python # Requires the requests package: pip install requests import base64 import os import time import requests BASE = "https://api.meshy.ai/openapi/creative-lab/fidget-pixel/v1" REQUEST_TIMEOUT = 60 # per HTTP call TASK_DEADLINE = 2400 # give up on a single task after 40 minutes def env(name: str) -> str: value = os.environ.get(name) if not value: raise SystemExit(f"set {name} before running") return value # Point IMAGE_PATH at a local photo, or IMAGE_URL at a public one: # export MESHY_API_KEY=msy_... # export IMAGE_PATH=./portrait.jpg # or: export IMAGE_URL=https://... # export PIXEL_TYPE=person # or: other HEADERS = {"Authorization": f"Bearer {env('MESHY_API_KEY')}"} PIXEL_TYPE = os.environ.get("PIXEL_TYPE", "person") def source_image() -> str: path = os.environ.get("IMAGE_PATH") if path: # Encode here, in the process. A base64 data URI passed on a command # line or through an exported variable will exceed the OS argument # limit for a photo of any real size. # Declare the real type: the API accepts JPEG, PNG and WebP. mime = {"png": "image/png", "webp": "image/webp"}.get( os.path.splitext(path)[1].lower().lstrip("."), "image/jpeg") with open(path, "rb") as f: return f"data:{mime};base64," + base64.b64encode(f.read()).decode() if not os.environ.get("IMAGE_URL"): raise SystemExit("set IMAGE_PATH (local file) or IMAGE_URL (public url) first") return os.environ["IMAGE_URL"] def check(resp: requests.Response) -> dict: # raise_for_status()'s message omits the response body, and the body is # where the reason is. if not resp.ok: raise RuntimeError(f"HTTP {resp.status_code} for {resp.url}: {resp.text[:500]}") return resp.json() def poll(stage: str, task_id: str) -> dict: deadline = time.monotonic() + TASK_DEADLINE delay = 5 while True: if time.monotonic() > deadline: raise TimeoutError(f"gave up waiting for {stage} {task_id}") data = check(requests.get(f"{BASE}/{stage}/{task_id}", headers=HEADERS, timeout=REQUEST_TIMEOUT)) print(f"{stage}: {data['status']} ({data['progress']}%)") if data["status"] == "SUCCEEDED": return data if data["status"] in ("FAILED", "CANCELED"): raise RuntimeError( f"{stage} task {task_id} ended as {data['status']}: {data['task_error']}") time.sleep(delay) delay = min(delay * 2, 30) # 1. Create the prototype task prototype_id = check(requests.post( f"{BASE}/prototype", headers=HEADERS, json={"image_url": source_image(), "type": PIXEL_TYPE}, timeout=REQUEST_TIMEOUT, ))["result"] # 2. Wait for the pixel-art image (show image_urls[0] to a user in production) prototype = poll("prototype", prototype_id) print("pixel-art preview:", prototype["image_urls"][0]) # 3. Create the build task (defaults: square pieces, 32x32 grid, 8 mm, 8 colors, 15 mm tall) build_id = check(requests.post( f"{BASE}/build", headers=HEADERS, json={ "input_task_id": prototype_id, "options": { "shape": "square", "grid_size": 32, "piece_size_mm": 8, "color_count": 8, "piece_height_mm": 15, }, "output": {"format": "3mf"}, }, timeout=REQUEST_TIMEOUT, ))["result"] # 4. Wait for the pieces build = poll("build", build_id) # 5. Download the 3MF. This is a signed URL: no Authorization header, # and it stays valid for 3 days after the task finishes. with requests.get(build["model_urls"]["3mf"], stream=True, timeout=(60, 900)) as dl: if not dl.ok: raise RuntimeError(f"download failed: HTTP {dl.status_code}") with open("fidget-pixel.3mf", "wb") as f: for chunk in dl.iter_content(chunk_size=1 << 20): f.write(chunk) print("Saved fidget-pixel.3mf") ``` --- # Balance API Source: https://docs.meshy.ai/api/balance # Balance API Check how many credits you can spend, and how many of them expire at the next monthly refresh. --- ## GET /openapi/v1/balance -- Get the balance Returns the credit balance of the account that owns the API key. On a team with a shared credit pool, the values are those of the pool. Calling this endpoint is free. ### Returns - `balance` · *integer* Number of credits you can spend. It's usually `monthly_credits` plus `permanent_credits`. It can be lower when a member credit limit or an Enterprise workspace credit limit applies to you. Team owners and admins have no such limit. - `monthly_credits` · *integer* Number of remaining credits that expire at the next monthly refresh, at `monthly_resets_at`. - `permanent_credits` · *integer* Number of credits that don't expire, for example from credit packs you bought and from rewards. - `monthly_resets_at` · *timestamp* Time of the next monthly credit refresh, in Unix milliseconds. At that time, the remaining monthly credits expire, and an active subscription refills them. `null` when no refresh is scheduled. ### Failure modes - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `429 - Too Many Requests` You sent too many requests. Wait the number of seconds in `Retry-After`, then retry. **cURL** ```bash curl https://api.meshy.ai/openapi/v1/balance \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios'; const headers = {Authorization: `Bearer ${YOUR_API_KEY}`}; try { const response = await axios.get('https://api.meshy.ai/openapi/v1/balance', {headers}); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/balance", headers=headers, ) response.raise_for_status() print(response.json()) ``` **Response** ```json { "balance": 1000, "monthly_credits": 600, "permanent_credits": 400, "monthly_resets_at": 1793491200000 } ``` --- # Usage API Source: https://docs.meshy.ai/api/usage # Usage API List your team's finished API tasks and the credits each one used, for billing exports and cost reports. To call this endpoint, use an API key of an active member of a Studio or Enterprise team. Any member can call it, not only owners and admins. With any other API key, the request returns `403`. --- ## GET /openapi/v1/usage/tasks -- List usage records Returns one page of your team's usage records, newest first by default. Without `start_time` and `end_time`, the records cover the last 30 days. Calling this endpoint is free. The records include these tasks: * API tasks that finished as `SUCCEEDED` or `FAILED` * Tasks of every current member of the team, from any of their API keys * Tasks you deleted, and tasks whose files have expired The records leave out these tasks: * Tasks that are still `PENDING` or `IN_PROGRESS`, and `CANCELED` tasks * Tasks of people who have left the team * Creative Lab tasks * Tasks that Meshy's AI agents ran * Work done in the Meshy web app A task appears in the records only after it finishes, in the window of its `created_at`. Meshy charges credits when it creates a task, so a task that's still running is missing from the records. Before you reconcile the records with your credit balance, pull recent windows again, or export after a short delay. If your team has a data retention period, the window starts no earlier than that period allows. ### Parameters - `page_num` · *integer* · default: `1` The page to return, from `1` to `255`. A value above `255` returns `400`. One window holds at most 255 pages, so split a large export into shorter windows. - `page_size` · *integer* · default: `10` Number of records per page, from `1` to `100`. A value from `101` to `255` returns 100 records, and a value above `255` returns `400`. - `sort_by` · *string* · default: `-created_at` The sort order. Available values: * `+created_at`: oldest first * `-created_at`: newest first In a URL, write `+` as `%2B`. Otherwise the `+` is read as a space, and the request returns `400`. - `start_time` · *string* The start of the window, as an RFC 3339 timestamp, for example `2026-08-01T00:00:00Z`. The records include tasks created at or after this time. Leave it out to start the window 30 days before `end_time`. The window can span at most 366 days. A longer window returns `400`, so split a longer export into several windows. - `end_time` · *string* The end of the window, as an RFC 3339 timestamp. The records include tasks created before this time. Leave it out to end the window at the time of your request. - `endpoints` · *string* A comma-separated list of the endpoints to include, by the same names as the `endpoint` field. Leave it out to include every endpoint. An unknown name returns `400`. Available values: * `text-to-3d`: every Text to 3D task, preview and refine * `text-to-3d-preview`: preview tasks only * `text-to-3d-refine`: refine tasks only * `image-to-3d` * `multi-image-to-3d` * `retexture` * `remesh` * `convert` * `resize` * `uv-unwrap` * `rig` * `animate` * `text-to-motion` * `text-to-image` * `image-to-image` * `print-multi-color` * `print-repair` * `print-analyze` * `print-split` * `relief` - `status` · *string* The status to include, `SUCCEEDED` or `FAILED`. Leave it out to include both. Any other value returns `400`. ### Returns Returns an array of [usage records](#the-usage-record-object). The array is empty when no records match. ### Failure modes - `400 - Bad Request` A parameter is invalid, and the error message says which one. Fix the parameter, then send the request again. - `401 - Unauthorized` The API key is missing or invalid. Check the `Authorization` header. - `403 - Forbidden` The API key's account isn't an active member of a Studio or Enterprise team. The message is `This endpoint is available on Studio and Enterprise plans`. Use an API key of a Studio or Enterprise team member. - `429 - Too Many Requests` You sent too many requests. Wait the number of seconds in `Retry-After`, then retry. **cURL** ```bash curl "https://api.meshy.ai/openapi/v1/usage/tasks?page_size=50&start_time=2026-08-01T00:00:00Z&end_time=2026-09-01T00:00:00Z" \ -H "Authorization: Bearer ${YOUR_API_KEY}" ``` ```javascript import axios from 'axios'; const headers = {Authorization: `Bearer ${YOUR_API_KEY}`}; try { const response = await axios.get( 'https://api.meshy.ai/openapi/v1/usage/tasks', { headers, params: { page_size: 50, start_time: '2026-08-01T00:00:00Z', end_time: '2026-09-01T00:00:00Z', }, } ); console.log(response.data); } catch (error) { console.error(error); } ``` ```python import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}" } response = requests.get( "https://api.meshy.ai/openapi/v1/usage/tasks", headers=headers, params={ "page_size": 50, "start_time": "2026-08-01T00:00:00Z", "end_time": "2026-09-01T00:00:00Z", }, ) response.raise_for_status() print(response.json()) ``` **Response** ```json [ { "task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "endpoint": "image-to-3d", "status": "SUCCEEDED", "created_at": 1755787000000, "finished_at": 1755787045000, "consumed_credits": 20, "api_key_name": "production", "api_key_suffix": "a1b2", "metadata": { "user": "alex@example.com", "team": "fab" } }, { "task_id": "018a210d-1c22-7e0f-9d3a-4a5b6c7d8e9f", "endpoint": "text-to-3d-refine", "status": "FAILED", "created_at": 1755786000000, "finished_at": 1755786030000, "consumed_credits": 0, "api_key_name": "production", "api_key_suffix": "a1b2", "metadata": {} } ] ``` --- ## Usage record object - `task_id` · *string* The task ID, the same ID that the creating endpoint returned. To get the task itself, with its output URLs, send the ID to that endpoint's get route, for example `GET /openapi/v1/image-to-3d/{task_id}` for an `image-to-3d` record. - `endpoint` · *string* The endpoint the task ran on, for example `image-to-3d` or `rig`. A Text to 3D task shows its stage, `text-to-3d-preview` or `text-to-3d-refine`. Older records can have names of retired endpoints, which the `endpoints` filter doesn't accept. - `status` · *string* The task's final status, `SUCCEEDED` or `FAILED`. - `created_at` · *timestamp* Time the task was created, in Unix milliseconds. - `finished_at` · *timestamp* Time the task finished, in Unix milliseconds. `null` if the task has no finish time. - `consumed_credits` · *integer* Number of credits the task used, after refunds. `0` for a failed task, because Meshy refunds it, and for a free task such as Analyze Printability. - `api_key_name` · *string* The name of the API key that ran the task. For a task run with an app login, it's the app's name, for example `Meshy CLI`. It's an empty string in some cases, for example: * The task was never charged, such as an Analyze Printability task, which is free. * The API key has been deleted. * The API key was created in the last few minutes. - `api_key_suffix` · *string* The last four characters of that API key, to tell keys with the same name apart. An empty string whenever `api_key_name` is empty, and for app logins such as the Meshy CLI. - `metadata` · *object* The tags sent in the `X-Meshy-Metadata` header when the task was created. `{}` if none. See [Metadata](/api/metadata). **Example usage record object** ```json { "task_id": "018a210d-8ba4-705c-b111-1f1776f7f578", "endpoint": "image-to-3d", "status": "SUCCEEDED", "created_at": 1755787000000, "finished_at": 1755787045000, "consumed_credits": 20, "api_key_name": "production", "api_key_suffix": "a1b2", "metadata": { "user": "alex@example.com", "team": "fab" } } ``` --- # Animation Library Source: https://docs.meshy.ai/api/animation-library # Animation Library reference Browse every preset action you can retarget onto a rigged character, with a preview of each. To apply one, send its `action_id` when you create a task with the [Animation API](/api/animation). To get the same list as JSON, for example to build your own picker, call [`GET /openapi/v1/animations/library`](/api/animation#list-animations). --- ## Available animations To apply several of these animations to one character in one request, send their IDs as [`action_ids`](/api/animation#create-an-animation-task) instead of one `action_id`. Meshy returns them as one file, with one clip per animation. The following table lists each animation with its ID, name, category, subcategory, and preview. > The full list of available animations (with `action_id`, name, category, preview URL) is served as JSON at https://api.meshy.ai/web/public/animations/resources — fetch it directly to retrieve the current catalog. --- ## Usage example To apply an animation to your rigged character, send its `action_id` in your API request: ```javascript const payload = { rig_task_id: "YOUR_RIGGING_TASK_ID", action_id: 92, // Double Combo Attack animation }; // Send this payload to the POST /openapi/v1/animations endpoint ``` To apply several animations at once, send `action_ids` instead. Meshy returns one file with each animation as a separate clip, in the order of the list: ```javascript const payload = { rig_task_id: "YOUR_RIGGING_TASK_ID", action_ids: [10, 25, 92], // ForwardRight Run Fight, Agree Gesture, then Double Combo Attack }; // Send this payload to the POST /openapi/v1/animations endpoint ``` For more information about creating Animation tasks, see [Animation API](/api/animation#create-an-animation-task). --- --- # Webapp & Platform Documentation # Meshy documentation Source: https://docs.meshy.ai # Meshy documentation Learn to create 3D assets from text, images, and chat with Meshy, in the web app, your 3D tools, your printing software, or your own code. --- ## What is Meshy? Meshy is a 3D modeling platform that uses AI to turn text descriptions, 2D images, and chat prompts into production-ready 3D assets. Game developers prototype characters with it, 3D artists explore concepts, makers create custom gifts, and hobbyists build models to 3D print. Meshy covers the whole workflow, from generation to post-processing and export. The web app organizes its tools into six modules: Image, 3D Model, 3D Printing, Animate, Scene, and Video. Meshy 3D Agent adds a chat workflow, where you brainstorm, explore, and create 3D models in one conversation. The [API](/api) offers every generation capability as a REST endpoint, for developers who build at scale. You can test it in the [Developer Platform](/api/developer-platform), and connect AI agents to it with the [MCP server](/api/ai). Image to 3D runs on Meshy 7, a foundation model built to keep the result aligned with your input image. ![The Meshy home page, with 3D models for film production, product design, education, game development, 3D printing, VR/AR, and interior design](https://cdn.meshy.ai/webapp-assets/doc/welcome-to-meshy-1.webp) --- ## Choose your path You can use Meshy in four ways. All four use the same generation models and your Meshy account, and each has its own section in these docs. Generate and export 3D assets in your browser, with nothing to install. Build 3D generation at scale into your own products and pipeline. Use Meshy inside Unity, Blender, Maya, and other 3D tools. Turn a generated 3D model into a print-ready file. --- ## Platform overview The following table compares the generation models. Quality is rated out of 5 stars. | Model | Release | Best for | Speed | Quality | | ------- | ------- | ----------------------------------- | ------- | ------- | | Meshy 7 | 2026 | Most detail, highest precision | Under a minute | ★★★★★ | | Meshy 6 | 2025 | High quality and stable structure | About 1 minute | ★★★★★ | | Smart Topology | 2026 | Game development and real-time rendering | About 10 seconds | ★★★★★ | Meshy exports these file formats: | Format | Use case | Includes textures | | ------ | --------------------------- | ----------------- | | GLB | Web, AR, universal exchange | ✅ Embedded | | FBX | Unity, Unreal, DCC tools | ✅ Separate files | | OBJ | Legacy workflows, DCC tools | ✅ MTL + textures | | STL | 3D printing | ❌ Geometry only | | USDZ | Apple AR Quick Look | ✅ Embedded | | 3MF | 3D printing (color) | ✅ Embedded | --- ## FAQ ### What is Meshy used for? Meshy is an AI 3D model generator that turns text, images, and chat prompts into production-ready 3D assets for games, AR/VR, 3D printing, and design. ### Is Meshy free to use? Yes. The Free plan includes 100 credits per month and needs no credit card, so you can generate models before you upgrade. ### Do I need 3D modeling experience to use Meshy? No. Meshy automates mesh, texture, and rigging generation, and the 3D Agent guides beginners from idea to finished model through chat. ### Does Meshy offer an API? Yes. The Meshy API has REST endpoints for Text to 3D, Image to 3D, texturing, remeshing, and animation. You can test them without code in the API Playground, and connect AI agents with the MCP server. ### What can I create with Meshy? Characters, props, environment objects, vehicles, figurines, and product models, from game assets to 3D-printable miniatures. ### What file formats can I export from Meshy? Meshy exports GLB, FBX, OBJ, STL, USDZ, and 3MF, covering game engines, 3D printing, AR, and DCC tools. --- # 3D Agent Source: https://docs.meshy.ai/webapp/3d-agent # 3D Agent Chat with Meshy 3D Agent to brainstorm ideas, generate visual concepts in batches, and turn the concepts you pick into downloadable 3D models. Start with a photo, a sketch, a description, a story, or a creative direction. Unlike a tool that makes one model from one prompt, 3D Agent keeps the whole creative process in one conversation. It suits makers with a custom idea, such as a pet photo or a child's drawing, and indie game developers who need a set of assets in one style. For a precise model from a clear reference image, use [Image to 3D](/webapp/image-to-3d). For a single model from a well-defined prompt, use [Text to 3D](/webapp/text-to-3d). To generate models from your own code, see the [Meshy API documentation](/api). --- ## Create a model with 3D Agent To create a model in a conversation, follow these steps: 1. In the left sidebar, click **Agent**. 2. In the message box, describe what you want to create. You can start with any of these: - A text description: "I want to create a set of fantasy potion bottles for my RPG game" - A photo: upload a pet photo, a product image, or a sketch - A story or scenario: "My daughter drew a dragon, and I want to turn it into a 3D printed figurine" - A creative direction: "Cyberpunk props with neon accents and weathered metal" 3. Brainstorm with the agent. It suggests creative directions and asks questions to help you refine your concept. You can compare artistic approaches, ask practical questions about 3D creation or printing, and refine your direction over several messages. 4. Ask for visual concepts. The agent generates several concepts in one session. For example: - Ask for a number of concepts: "Show me 6 variations" - Keep a style: "Keep the same art direction as the first batch" - Combine concepts: "I like the shape from concept 2 and the colors from concept 5" 5. Select the concepts you like, and ask the agent to convert them to 3D models. By default, the agent asks you to approve an action before it spends credits. 6. Download the model in the format your game, 3D printer, store, or other workflow needs. --- ## Key capabilities 3D Agent combines these capabilities in one conversation: - Brainstorming for 3D creation: the agent suggests creative directions before you generate anything. This helps most when you know the kind of object you need, such as game props, but not the specific designs. - Batch visual concepts: instead of one result per prompt, you explore several concepts in one conversation. The agent can keep the style consistent across batches, which matters for asset sets that belong to the same world. - Chat-to-3D creation: the agent turns the concepts you select into downloadable 3D models for creative, printing, or production work. - Built-in 3D knowledge: ask questions about 3D creation and 3D printing in the chat. The agent can advise on topics such as wall thickness for printing, polygon budgets for different platforms, or preparing models for specific slicers. - Post-processing in the chat: the agent can retexture, remesh, split, repair, rig, and animate a model, with animations such as walking, running, or custom motions. --- ## Create a custom 3D printing gift Many makers know how to print but not how to model a custom object from scratch. To create a custom printed gift, follow these steps: 1. Start with a pet photo, a child's drawing, a name, a story, or a gift idea. 2. Explore custom 3D concepts with the agent. 3. Select a concept, and generate a 3D model. 4. Download the model as STL or 3MF, and then slice and print it. > **Note:** Before you print, review the geometry, scale, wall thickness, and slicer settings. --- ## Create a style-consistent set of game assets Indie developers often need not just one asset but a set that looks like it belongs to the same world. To create a consistent set, follow these steps: 1. Describe a visual direction, for example "Low-poly medieval fantasy, warm color palette, hand-painted look." 2. Ask the agent for batches of props, characters, or environment concepts. 3. Select your favorites, ask for variations, and check that the style stays consistent. 4. Convert the concepts to 3D, and download them for your engine. --- ## Compare 3D Agent with Text to 3D and Image to 3D The following table compares 3D Agent with the single-step generation tools. | Factor | 3D Agent | Text to 3D | Image to 3D | | --- | --- | --- | --- | | Input | Text, images, sketches, or stories | Text only | Images only | | Multi-step process | Yes, in one continuous conversation | No, a single prompt | No, a single upload | | Batch concept exploration | Yes, several concepts at a time | Up to 10 models per prompt with Meshy 6 | One model per image, or up to 10 images with Batch Images to 3D | | Style consistency | Kept across the conversation | Depends on consistent prompts | Depends on the input images | | Speed for a single model | Slower, because it includes brainstorming | Faster | Faster | | Precision | Good for concepts | Good for well-defined prompts | Best for matching an image | | Built-in Q&A | Yes, ask 3D questions in the chat | No | No | --- ## Troubleshooting The following table lists common problems, their causes, and how to fix them. | Problem | Cause | Fix | | --- | --- | --- | | The agent doesn't understand your request | The description is too vague | Say what you want to create, its style, and how you plan to use it. | | Batch concepts aren't consistent | The style direction isn't clear enough | Give a clear art direction at the start, and name specific styles or moods. | | The 3D model differs from the selected concept | Converting a 2D concept to 3D adds some variation | Use [Image to 3D](/webapp/image-to-3d) with the concept image for a closer match. | --- ## FAQ ### What is Meshy 3D Agent? Meshy 3D Agent is an AI agent for 3D creation. In one conversation, it helps you brainstorm ideas, generate visual concepts in batches, ask 3D creation questions, and turn the concepts you select into 3D models. ### How is Meshy 3D Agent different from a text-to-3D tool? A text-to-3D tool usually generates one result from one prompt. 3D Agent supports a multi-step chat, where you explore directions, refine ideas, generate several concepts, and turn the ones you select into 3D models in one conversation. ### Is Meshy 3D Agent the same as ChatGPT for 3D? 3D Agent brings a conversational AI experience to 3D creation, but it isn't a general chat interface. It's built for 3D work: brainstorming, visual concept generation, 3D creation Q&A, and turning ideas into 3D models. ### Who is Meshy 3D Agent built for? 3D printing makers, indie game developers, 3D artists, designers, and other creators who want to move from an idea to a 3D model faster. ### Can Meshy 3D Agent be used for 3D printing? Yes. 3D Agent helps you create custom 3D concepts that can go into a 3D printing workflow. Before you print, review the geometry, scale, wall thickness, and slicer settings. ### Can Meshy 3D Agent generate 3D assets for games? Yes. 3D Agent helps indie developers and creators explore batches of 3D asset concepts in a consistent creative direction. Depending on the game, you might need to optimize, polish, or adapt the models before you use them in production. ### Can Meshy 3D Agent edit existing 3D models? Yes. Upload a model to the chat, or open a model from your Workspace in 3D Agent. You can then ask the agent to retexture, remesh, split, repair, rig, or animate it. --- ## Next steps - To write better requests for the agent, see [Prompting best practices](/webapp/guides/prompting). - For a game asset workflow that uses the agent, see [Game assets](/webapp/guides/use-cases/game-assets). - For a print-focused workflow that uses the agent, see [3D printing workflow](/webapp/guides/use-cases/3d-printing). --- # Changelog Source: https://docs.meshy.ai/webapp/changelog # Changelog See what changed in the Meshy web app each month: new features, improvements, and fixes. --- ## October 2026 ### 3D model generation - Released Meshy T2.5 for Image to 3D, with sharper detail than Meshy T2. It replaces Meshy T2 as the default Smart Topology model, supports up to 30,000 faces, and is available in Workspace and the 3D Agent. - Added [Meshy N1](https://www.meshy.ai/blog/meshy-n1-texture), a texture model for stylized and low-poly game assets. It generates base color directly on the model and is available on all plans, including Free. ### 3D model post-processing - Added [Meshy Edit](https://www.meshy.ai/blog/meshy-edit). Select one part of a model, describe the change in a sentence, and optionally add a reference image. Only the selected part changes. Meshy Edit works on untextured Meshy 6 and Meshy 7 models. - Auto Split now works on textured models. Each part keeps its original texture, so models no longer need to be split untextured and retextured. - Make Printable now detects thin walls based on your printer type and intended print size, and thickens them so the model prints. ### Teams and management - Teams can now switch workspaces from anywhere in the web app. New generations go to the active workspace, so assets no longer need to be moved into a shared workspace after they're created. ## September 2026 ### 3D model generation - Released [Meshy 7.1](https://www.meshy.ai/blog/meshy-7-1-launch) for Image to 3D, with more geometric detail than Meshy 7. Ultra Mode is replaced by three geometry resolution options: Standard, Ultra 2K and the new Ultra 4K. Ultra 2K and Ultra 4K are available on paid plans, and Ultra 4K works with single-image input. ### 3D model post-processing - OBJ, STL and resized GLB downloads are now significantly faster, and files with non-English names no longer fail to download. - Auto Split now takes your direction. Describe the parts you want to separate, such as a dragon's wings or legs, a toy's head or boots, or a car's wheels, and Meshy splits the model that way. ### 3D Agent - The [3D Agent](https://www.meshy.ai/features/3d-agent) is now available on the Free plan. - The 3D Agent now runs on a more capable foundation model, which improves its performance and its 3D creation. - Added 21 official templates that turn a photo into a 3D model. Upload a photo and generate. Browse the templates in Discover. ### Teams and management - Teams can now manage credit limits for their members in the web app. A limit caps the credits a member spends in the web app and the 3D Agent, separately from API key credit limits. ## August 2026 ### 3D model generation - Released new [Meshy 7](https://www.meshy.ai/blog/meshy-7-image-to-3d-geometry-alignment) model for Image to 3D with Ultra Mode for finer surface detail, and [Meshy 7 Texture](https://www.meshy.ai/features/ai-texture-generator), with sharper surface detail and cleaner PBR materials than Meshy 6. Texturing supports multi-view input from up to four ordered views of the same object. Both are available in Workspace and the 3D Agent. - Added Meshy 6 Lite, a faster, lighter variant of Meshy 6. It replaces Meshy 5 in the model picker without affecting existing Meshy 5 models and is now the fastest option for both model generation and texturing. - [Smart Topology](https://www.meshy.ai/blog/meshy-t2-native-3d-mesh-generation) now generates in approximately 2 seconds, down from around 15. ### 3D model post-processing - Added Semantic Segmentation, which splits models along semantic parts such as head, limbs and torso rather than geometry alone. Auto Mortise-and-Tenon generates interlocking connectors on the resulting parts, so printed pieces assemble without glue. - The online viewer now opens IGES, IGS, IFC, VRM and G-code. File Converter adds 3DS, AMF and VRM as source formats, and FBX as an output format. ### 3D Agent - The 3D Agent now asks before spending credits: approve each action, allow all actions until the task completes, or allowlist specific tools, with a per-turn credit budget. New users start in approval mode. Added a credit usage breakdown panel in settings, and each model's cost now appears at selection. - Added Skills: Meshy-curated presets triggered from the composer, with a showcase on the 3D Agent home. Logged-out visitors can browse trending skills. - Redesigned the 3D Agent home. - Semantic splitting and AI Auto-Repair are now available in the 3D Agent. - Asset cards now carry print and convert actions, remesh is available in the canvas with the same controls as Workspace, and images have their own toolbar. Assets can be downloaded in batches from the gallery and canvas, and any Workspace asset can be opened directly in the 3D Agent. - Model generations in the 3D Agent can now be retried for free. The number of free retries per generation depends on the subscription plan. ### Creative Lab - New category: Pet Keepsake - Chibi Figure now supports pets and multi-person subjects. - Keycap build and colorize are now a single step. Builds save to the asset list, and head pose and size persist between sessions. ## July 2026 ### 3D model generation - Added Smart Topology, a new AI model for Image to 3D that generates low-poly models with native part segmentation and controllable polygon count. - Texture generation now supports [8K resolution](https://www.meshy.ai/blog/8k-texture) for base color maps, with a new multiview diffusion algorithm that captures finer detail on realistic textures and removes lighting more cleanly. - Retired Prompt Helper. Prompt writing help is now handled by the 3D Agent. ### 3D model post-processing - [Auto Split](https://www.meshy.ai/blog/auto-split-3d-printing) is now available for 3D printing. It splits a model into watertight, printable parts in about 40 seconds. Parts can be auto-arranged on the build plate and exported to your slicer in one click. - Added [Text to Motion](https://www.meshy.ai/features/text-to-animation) to generate animations for your rigged character from a text prompt. Results can be saved to your motion library. - Improved Multi-Color Print with AI Optimize, reducing excess colors on complex models for better print results. ### 3D Agent - Added an [Inpaint](https://www.meshy.ai/features/ai-image-generator) tool that repaints brush-selected areas of an image from a text prompt. - Image backgrounds can now be removed in one click. ### Creative Lab - Added two new categories: Plant Pot and Tabletop Terrain. ## June 2026 ### 3D Agent Released [3D Agent](/webapp/3d-agent) (Beta), an AI agent for 3D creation. The Beta covers: - End-to-end creation in one conversation: brainstorming, batch visual concept generation, model generation with 4K textures, and export to DCC tools or slicers. - Web search for reference images, with results directly usable in generation. - A built-in knowledge base that answers your 3D creation questions. - Read-only conversation sharing via link, no login required. ### Creative Lab - Added two new categories: Twist Egg and Golden Boot Keychain. - Creations are now automatically saved to the asset panel and can be resumed for further editing. ### DCC integrations - Added a [ZBrush plugin](/webapp/plugins/zbrush/introduction) that sends models from the Meshy workspace to ZBrush in one click as clean OBJ geometry. --- # Core concepts Source: https://docs.meshy.ai/webapp/concepts # Core concepts Learn the 3D basics behind Meshy, such as meshes, textures, topology, UV mapping, and rigging, and how they fit into one workflow. A mesh is the shape of a 3D model. Textures add color and surface detail. Topology describes how the mesh's faces are arranged, UV mapping defines how textures wrap onto the mesh, and rigging adds a skeleton so the model can move. ![Meshy workspace showing a generated 3D model with its topology details (triangle mesh, face and vertex counts) alongside the printability check and generation settings](https://cdn.meshy.ai/webapp-assets/doc/core-concepts-p1-1.webp) --- ## Glossary quick reference The following table defines the terms you see most often in Meshy. | Term | Definition | | --- | --- | | Mesh | 3D geometry made of vertices, edges, and faces | | Polygon count | The number of faces in a model. Game assets usually stay under 50,000, and film assets can reach millions. | | PBR textures | Physically based rendering maps: albedo, normal, roughness, and metallic | | Topology | The arrangement and flow of faces. Clean topology means even quads that follow the model's structure. | | UV mapping | Unwrapping a 3D surface into 2D space so textures map correctly | | Rigging | Binding a skeleton to a model so it can be animated | | Normal map | An RGB texture that simulates surface bumps without adding geometry | | LOD | Level of detail, meaning versions of a model at different resolutions for different viewing distances | | Watertight mesh | A closed mesh with no holes, which 3D printing requires | | GLB and GLTF | Open 3D file formats, the standard for the web and real-time rendering | | FBX | An Autodesk format, the main exchange format for game engines such as Unity and Unreal | | STL | A geometry-only format, the standard input for 3D printing | | USDZ | Apple's AR format for Quick Look and Reality Composer | For more terms, see the [Glossary](/webapp/glossary). --- ## How the concepts connect in Meshy Each Meshy tool works on one of these concepts: - Generation: Meshy creates a mesh from text, an image, or a chat, and can texture it in the same step. - AI Texturing: Meshy generates new textures for the mesh, including PBR maps. - Remesh: Meshy rebuilds the mesh with a lower or optimized polygon count and keeps its shape. - Unwrap UV: Meshy generates a clean UV layout for custom texture work. - Rigging: Meshy binds a skeleton to the mesh for animation. - Export: you download the mesh, textures, and rig in the format you choose. --- ## FAQ ### What is a mesh in 3D modeling? A mesh is the geometric structure of a 3D model, made of vertices, edges, and faces. Its polygon count affects both quality and performance. ### What are PBR textures? PBR (physically based rendering) textures simulate how real-world light hits a surface. They use albedo, normal, roughness, and metallic maps for realistic materials. ### What is topology and why does it matter? Topology is how the faces of a mesh are arranged. Clean topology makes animation, deformation, and rendering work better. ### What is UV mapping? UV mapping unwraps a 3D surface into 2D space so textures apply without seams or stretching. ### What is rigging in 3D? Rigging adds a skeleton to a model so it can be posed and animated. Meshy auto-rigs humanoid and quadruped models. --- ## Next steps - To look up more 3D terms, see the [Glossary](/webapp/glossary). - To put these concepts into practice, see [Meshy web app documentation](/webapp/getting-started). - To learn how Meshy generates PBR maps, see [AI Texturing](/webapp/guides/3d-model/ai-texturing). --- # Meshy web app documentation Source: https://docs.meshy.ai/webapp/getting-started # Meshy web app documentation Create your first 3D model in the Meshy web app from an image or a text prompt, then download it for your project. This guide is for new Meshy users. To build Meshy into your own code instead, see the API [Quickstart](/api/quick-start). To create through a chat, see [3D Agent](/webapp/3d-agent). --- ## Create your first 3D model To create your first model, follow these steps: 1. Go to [meshy.ai](https://www.meshy.ai/) and sign up with Google or email. New accounts get free credits. 2. In the left sidebar, click **Model**. 3. At the top of the panel, choose how to generate: - **Image to 3D**: upload a clear photo or concept art of your subject. This is the best place to start. - **Batch Images to 3D**: upload up to 10 images and turn each one into a model at once. Batch Images to 3D requires a paid plan. - **Text to 3D**: describe your object in detail, for example "a medieval wooden treasure chest with iron bands and a rusty padlock". 4. Select **High Detail** or **Smart Topology**. 5. In the model list, select an AI model: - **High Detail** offers Meshy 7.1 - Flagship, Meshy 6, and Meshy 6 Lite. Text to 3D offers Meshy 6 and Meshy 6 Lite. - **Smart Topology** offers Meshy T2 and Meshy T1. Text to 3D uses Meshy T1. 6. Optional: Set the options you need, such as **Multi-view**, **Resolution**, **Texture**, or **Image Enhancement**. The panel shows only the options the selected model supports. 7. Click **Generate**, or **Batch Generate** for Batch Images to 3D. The panel shows the time and credit cost before you generate. 8. In the viewer, rotate, zoom, and check the mesh quality, texture detail, and overall accuracy. 9. Optional: Improve the model: - To texture it in a different style or add PBR maps, click **Texture** or **Retexture** in the toolbar. - To change the polygon count, click **Remesh** in the toolbar. Choose a count for your target platform, such as a game engine or a 3D printer. - To animate a humanoid or four-legged model, click **Animate** in the left sidebar, and then click **Rig** to auto-rig it. 10. In the toolbar, click **Download**. 11. In **Format**, select a format, and then click **Download**. Use GLB for web and AR, FBX for game engines, STL for 3D printing, or OBJ for DCC tools. --- ## Settings and tradeoffs The following table shows what the main generation settings trade off. | Setting | Options | Tradeoff | | --- | --- | --- | | AI model | Meshy 7.1 - Flagship, Meshy 6, or Meshy 6 Lite | Meshy 7.1 gives the closest match to the input image. Meshy 6 suits models where a stable structure matters more than fine detail. Meshy 6 Lite is faster and costs 10 credits. | | Model type | High Detail or Smart Topology | High Detail gives a detailed mesh. Smart Topology gives fewer faces and cleaner topology, and Meshy T2 generates in about 2 seconds. | | Image Enhancement | On or off | On: Meshy redraws and cleans up the input image. Off: Meshy uses the image as it is. | --- ## Examples A clean input gives a clean model. A clear front-facing photo of a ceramic mug, generated with Meshy 7.1, High Detail, and **Texture** on, gives a clean mesh with an accurate handle, a smooth surface, and textures. A poor input gives a poor model. A blurry, low-contrast photo with a complex background produces distorted geometry, because the model picks up the background. To fix it, keep **Image Enhancement** on, or use a cleaner input image. --- ## Troubleshooting The following table lists common problems, their causes, and how to fix them. | Problem | Cause | Fix | | --- | --- | --- | | Generation stays at 0% | Meshy's servers are busy | Wait 1 to 2 minutes, and then try again. Check the [Meshy status page](https://status.meshy.ai). | | The model has holes or missing parts | The input image shows only part of the object | With Meshy 7.1, turn on **Multi-view** and add images from other angles. | | Textures look blurry | The input image has a low resolution | Turn on **Image Enhancement**, or use a higher-resolution image. | | The downloaded file is empty | The generation didn't finish | Wait until the generation finishes, and then download the model again. | --- ## FAQ ### How do I create my first 3D model in Meshy? Sign up at meshy.ai, click Model in the left sidebar, and open Image to 3D or Text to 3D. Upload an image or enter a prompt, select a model, and click Generate. ### How long does it take to generate a 3D model? About a minute in most cases. Meshy 7.1 and Meshy 6 take about a minute, and Meshy T2 takes about 2 seconds. Ultra 4K resolution takes longer. ### Should I start with Text to 3D or Image to 3D? Use Image to 3D if you have a reference photo, because it gives the most accurate result. Use Text to 3D when you only have an idea in mind. ### Do I need a credit card to start? No. You get free credits as soon as you sign up with Google or email. ### Where are my generated models saved? Meshy saves every result automatically. Find it in the asset list next to the viewer, or click Assets in the left sidebar. From there you can preview, post-process, and download it. --- ## Next steps - To learn every option for image input, see [Image to 3D](/webapp/image-to-3d). - To write prompts for text input, see [Text to 3D](/webapp/text-to-3d). - To create through a chat, see [3D Agent](/webapp/3d-agent). --- # Glossary Source: https://docs.meshy.ai/webapp/glossary # Glossary Look up the 3D terms used in Meshy, sorted from A to Z, with what each term means and how it applies in Meshy. --- ## A **Albedo map**: The base color texture of a 3D model, without lighting or shadow information. In Meshy, AI Texturing generates albedo maps as part of the PBR texture set. --- ## F **FBX**: A proprietary Autodesk file format, widely used to exchange 3D assets between game engines, such as Unity and Unreal, and DCC tools. Meshy exports FBX with embedded textures and optional rig data. --- ## G **GLB and GLTF**: Open standard 3D file formats. GLB is the binary version, a single file with embedded textures. GLTF is the JSON version, made of several files. Meshy recommends GLB for the web and AR. --- ## L **Low poly**: A 3D modeling style that uses few polygons, popular in games and stylized art. In Text to 3D and Image to 3D, Smart Topology generates optimized low-poly meshes. --- ## M **Mesh**: The geometric structure of a 3D model, made of vertices, edges, and faces. Meshy generates meshes from text, an image, or a chat. **Metallic map**: A PBR texture map that defines which parts of a surface are metallic (white) and which aren't (black). AI Texturing generates it when you turn on **Generate PBR Maps**. --- ## N **Normal map**: A texture that simulates surface detail without adding geometry. It uses RGB values to encode the direction of the surface. Meshy generates normal maps as part of the PBR texture set. --- ## P **PBR (physically based rendering)**: A rendering approach that simulates how light interacts with real surfaces. It uses albedo, normal, roughness, and metallic maps. Meshy's AI Texturing generates complete PBR texture sets. **Polygon count**: The number of faces in a mesh. Lower counts give better performance. Meshy's Remesh tool lets you set a target polygon count. --- ## R **Remesh**: Regenerating a model's mesh topology. In Meshy, Remesh optimizes the polygon count and the topology. **Rigging**: Adding a skeleton to a mesh so it can be animated. Meshy rigs humanoid and quadruped models automatically. **Roughness map**: A PBR texture that defines how smooth a surface is. Black means smooth and glossy, and white means rough and matte. AI Texturing generates it. --- ## S **Smart Topology**: A model type that outputs clean, game-ready geometry with native part segmentation. In Image to 3D, Meshy T2 also lets you set the polygon count from 100 to 15,000. Smart Topology is available in Text to 3D and Image to 3D. **STL**: A file format that stores only geometry, with no color or texture. It's the standard format for 3D printing. Meshy exports STL for FDM and SLA printing. --- ## T **Topology**: The arrangement and flow of polygons on a mesh surface. Clean topology, with even quads that follow the surface contours, is essential for animation and deformation. --- ## U **USD and USDZ**: Universal Scene Description, a format by Pixar. USDZ is the compressed version Apple uses for AR Quick Look. Meshy exports USDZ for Apple AR. **UV mapping**: Projecting a 3D surface onto a 2D plane so textures can be applied. Meshy's Unwrap UV tool generates UV layouts automatically. --- ## W **Watertight mesh**: A closed mesh with no holes or open edges, which 3D printing requires. In Meshy, **Make Printable** in the viewer's **Printability** card makes a mesh watertight. --- ## Next steps - To choose a download format, see [Export and file formats](/webapp/guides/platform/export-formats). - To generate PBR texture sets, see [AI Texturing](/webapp/guides/3d-model/ai-texturing). - To change a model's polygon count or topology, see [Remesh](/webapp/guides/3d-model/remesh). --- # Image to 3D Source: https://docs.meshy.ai/webapp/image-to-3d # Image to 3D Turn concept art, a photo, or a sketch into a 3D model that matches your visual reference. An image gives the AI a clear target, so the result matches your design more closely than a [Text to 3D](/webapp/text-to-3d) prompt. If you don't have an image yet, generate one with [AI image generation](/webapp/guides/image/ai-image-generation), or brainstorm in a chat with [3D Agent](/webapp/3d-agent). --- ## Generate a model from an image To generate a model from an image, follow these steps: 1. In the left sidebar, click **Model**. 2. At the top of the panel, click the **Image to 3D** tab. 3. Select **High Detail** for maximum detail, or **Smart Topology** for an optimized, game-ready mesh. 4. In the model list, select a model. For **High Detail**, **Meshy 7.1 - Flagship** gives the most detail and precision. 5. Under **Image**, click the upload area, or drag and drop or paste an image. Use a PNG, JPG, JPEG, or WEBP file up to 20 MB. A clear subject on a simple background, at 512 × 512 pixels or larger, gives the best result. 6. Optional: Set the generation options. The panel shows only the options the selected model supports: - **Multi-view** (Meshy 7.1): add images of the same object from other angles. Multi-view needs a paid plan, and free accounts get a limited number of free tries. For more information, see [Add views with Multi-view](#multi-view-images-to-3d). - **Resolution** (Meshy 7.1): choose how much geometric detail Meshy generates. For more information, see [Meshy 7.1 and resolution](#meshy-7). - **Poly Count** (Meshy T2): set the target polygon count. - **Split** (Meshy 7.1 and Meshy 6): split the model into parts as part of the generation. You can't turn on **Split** and **Texture** together. For more information, see [Auto Split](/webapp/guides/3d-model/auto-split). - **Texture** (not with Meshy 6 Lite): texture the model as part of the generation. - **Pose**: generate a humanoid character in an **A-Pose**, a **T-Pose**, or a **Custom** pose. Pose needs a paid plan, and free accounts get a limited number of free tries. - **Image Enhancement** (Meshy 7.1 and Meshy 6): let Meshy redraw your image for a cleaner, more complete model. It's on by default and helps most with uneven lighting or a busy background. Details can change, and generation takes longer. 7. Click **Generate**. The panel shows the time and credit cost before you generate. A Meshy 7.1 model takes about a minute. 8. In the viewer, rotate the model and check it from all angles. When the model looks right, you can texture, remesh, or download it from the toolbar. ![Meshy Image to 3D workspace: an uploaded character concept image converted into a full 3D model, with Image Enhancement and pose controls](https://cdn.meshy.ai/webapp-assets/doc/image-to-3d-p0-1.webp) --- ## Smart Topology Smart Topology generates meshes for game development, real-time rendering, and web 3D. It offers two models, as the following table shows. | Model | Credits | Generation time | | --- | --- | --- | | Meshy T2 (default) | 5 | About 2 seconds | | Meshy T1 (legacy) | 20 | About 3 minutes | What you get: - Native part segmentation: the model comes split into clean, accurate parts. You can select, retexture, or animate each part on its own instead of editing one fused mesh. - Fast iteration: Meshy T2 generates a mesh in about 2 seconds, so you can try several versions in one sitting. - Poly-count control: with Meshy T2, set **Poly Count** anywhere from 100 to 15,000 polygons, from light web and mobile assets to more detailed real-time models. Why it matters: - Cleaner topology deforms more predictably, so rigging and animation behave better. - A low, controlled poly count keeps assets light enough to use in your engine without a performance hit. - Separate parts make later edits easier, such as swapping a material or adjusting one component. Choose **High Detail** instead when you want maximum surface detail for renders or showcases and topology isn't a constraint. --- ## Add views with Multi-view With Meshy 7.1, turn on **Multi-view** to add images of the same object from other angles. Multi-view needs a paid plan, and free accounts get a limited number of free tries. Meshy combines all the views into one more complete model. Next to your main image, you can add up to three more views. If you don't have them, Meshy can generate them from your main image. - Angles to use: front, side, back, and three-quarter views. - Consistency: show the same object in every image, under similar lighting. - Benefit: the back and sides come out more accurate, because the AI guesses less. --- ## Set a custom pose Custom Pose sets the exact stance your character is generated in, instead of the pose in your input image. To set a custom pose, follow these steps: 1. Upload a character image. 2. Turn on **Pose**, and then select **Custom**. The **Customize Pose** dialog opens. 3. Start from one of the 6 preset poses, or drag and rotate each joint to adjust the pose. 4. Click **Send to Custom Pose**. If you close the dialog instead, Meshy discards your changes. 5. Click **Generate**. Meshy creates the character in the pose you set. ![Customize Pose editor in Meshy with preset poses and joint-level controls for setting a character's exact stance](https://cdn.meshy.ai/webapp-assets/doc/image-to-3d-p0-2.webp) Use Custom Pose when: - Your project needs a specific pose, such as an action stance or a sitting pose, and your reference image shows a different one. - You want the same character in several poses without uploading a different image for each. - You need a T-pose or A-pose for rigging in Animate, but your concept art shows a dynamic pose. Tips: - For the best results with Animate, which auto-rigs the model and applies animation presets, set the pose to **T-Pose** or **A-Pose**. - Custom Pose applies to humanoid characters. Other subjects keep the pose shown in the input image. --- ## Settings and tradeoffs The following table shows what each setting trades off. | Setting | Options | Tradeoff | | --- | --- | --- | | Model type | High Detail or Smart Topology | High Detail has more detail. Smart Topology is better for real-time rendering. | | Image Enhancement | On or off | On: Meshy redraws the image to improve it. Off: Meshy keeps the original, which is best for high-quality inputs. | | Multi-view | Off, or up to 4 images | More views give a more accurate model but need prepared images. | | Pose | A-Pose, T-Pose, or Custom | A set pose suits character models you plan to rig or display. | | License | CC BY 4.0 or Private | CC BY 4.0 applies on the Free plan. Private requires a paid plan and gives full commercial use. | --- ## Meshy 7.1 and resolution Meshy 7.1 is the Image to 3D model built for close alignment between your input image and the generated model. It handles: - Organic characters with expression, anatomy, and skin folds. - Multi-part objects, where each part keeps its position and neighboring parts stay separate. - Engraved lettering and relief clean enough for CNC and laser engraving. Meshy measures alignment on three things: overall proportion, spatial distribution, and surface details. Alignment applies to both single-image and multi-view input. **Resolution** sets how much geometric detail Meshy 7.1 generates. It affects geometry only, not textures. The Ultra options generate the geometry at higher precision from the start, rather than adding detail to a finished model. The following table compares the options. | Resolution | Best for | Credits | | --- | --- | --- | | **Standard** | The best balance of speed and quality | 20 | | **Ultra 2K** | High-precision 3D printing and high-poly game assets | 25 | | **Ultra 4K** | Intricate assets with fine detail. Generation takes longer, and it works with a single image only. | 25 | Ultra 2K and Ultra 4K are available on paid plans. On paid plans other than Enterprise, **Ultra 2K** is selected by default, so a Meshy 7.1 generation costs 25 credits unless you select **Standard**. If you generate for 3D printing, review the model before you print, because fine detail can print differently from a Standard model. --- ## Examples A clean reference gives an accurate model: - Input: a clear front-view photo of a sneaker on a white background, with Meshy 7.1 and High Detail. - Result: an accurate 3D sneaker with correct proportions, a detailed sole pattern, and clean textures. A cluttered scene confuses the AI: - Input: a photo of a full scene with several objects and a cluttered background. - Result: the AI merges the objects into one distorted mesh. - Fix: crop the image to a single object, remove the background, or use a cleaner reference. --- ## Troubleshooting The following table lists common problems, their causes, and how to fix them. | Problem | Cause | Fix | | --- | --- | --- | | Back details are missing or wrong | A single image has no information about the back | Turn on **Multi-view** and add a back view. | | Proportions are distorted | The photo has strong perspective distortion | Use a photo taken with a telephoto lens or close to an orthographic view. | | The model ignores image details | The image resolution is too low | Turn on **Image Enhancement**, or upload a higher-resolution image. | | Black patches appear on the surface | The image has shadows or dark areas | Use an evenly lit photo, or correct the lighting in a 2D editor first. | --- ## FAQ ### How do I convert a photo into a 3D model? In the left sidebar, click Model, and then upload a clear image in Image to 3D. Select Meshy 7.1, set any options, and click Generate. A model takes about a minute. ### What image works best for Image to 3D? A clear single subject on a simple background, at 512 × 512 pixels or larger. For a busy background, keep Image Enhancement on. ### Is Image to 3D more accurate than Text to 3D? Yes. A visual reference gives the AI a clear target, so Image to 3D matches your design more closely. ### Can I generate a model in a specific pose? Yes. Use Custom Pose to start from one of 6 presets or adjust each joint. Choose a T-pose or A-pose if you plan to rig the model. ### Can I use multiple photos of the same object? Yes. With Meshy 7.1, turn on Multi-view and add up to three more views, such as side, back, and three-quarter views, for a more complete model. --- ## Next steps - To generate without a reference image, see [Text to 3D](/webapp/text-to-3d). - To explore ideas in a chat before you convert concepts to 3D, see [3D Agent](/webapp/3d-agent). - To generate several models from different images at once, see [Batch Images to 3D](/webapp/guides/3d-model/batch-images-to-3d). --- # Pricing and credits Source: https://docs.meshy.ai/webapp/pricing # Pricing and credits Compare Meshy plans and see how many credits each web app action costs, so you can pick the plan that fits how much you create. --- ## Plans Meshy offers Free, Pro, Premium, and Ultra plans for individuals, and Studio and Enterprise plans for teams. Each plan includes monthly credits that you spend across all generation tools. - The Free plan includes 100 credits per month, enough to try Meshy and create a few models. - All paid plans include commercial use. - The Enterprise plan offers a custom credit volume and dedicated support. For plan prices, see the [Meshy pricing page](https://www.meshy.ai/pricing). ![Meshy plan upgrade screen comparing Free, Pro, Premium, and Ultra tiers with monthly credits, concurrent tasks, and queue priority](https://cdn.meshy.ai/webapp-assets/doc/pricing-credits-p1-1.webp) --- ## Credit usage reference The following table shows how many credits common actions cost in the web app. The cost depends on the action and the AI model. | Action | Credits | Notes | | --- | --- | --- | | Text to 3D | 20 with Meshy 6, or 10 with Meshy 6 Lite | Per generation. Meshy 7.1 isn't available in Text to 3D. | | Image to 3D | 20 with Meshy 7.1 or Meshy 6, 25 with Ultra 2K or Ultra 4K, or 10 with Meshy 6 Lite | Per generation. On paid plans other than Enterprise, Meshy 7.1 starts at **Ultra 2K**, so the default cost is 25. | | Smart Topology | 5 with Meshy T2, or 20 with Meshy T1 | Per generation | | **Texture** or **Split** option at generation | 10 each | Added to the generation cost | | AI Texturing | 10, or 15 at 8K | Per model. 8K is available with the Meshy 7 - Flagship texture model. | | Remesh | 0 | Per model | | Rigging | 0 | Per model | | Animate | 0 | Per animation clip. Clips beyond the free set need a paid plan. Text to Motion costs credits. | > **Note:** The web app shows the credit cost of each action before you run it. --- ## Licensing The following table shows the license each plan gives your models. | Plan | License type | Commercial use | Output ownership | | --- | --- | --- | --- | | Free | CC BY 4.0 | Yes, with attribution | You own the output | | Pro, Premium, Ultra, Studio, and Enterprise | Private | Yes, full commercial use | You own the output | --- ## FAQ ### Is Meshy free? Yes. The Free plan includes 100 credits per month, and you don't need a credit card. Paid plans (Pro, Premium, Ultra, Studio, and Enterprise) add more credits and features. ### How many credits does a 3D model cost? A Text to 3D generation costs 20 credits with Meshy 6, or 10 with Meshy 6 Lite. An Image to 3D generation costs 20 credits with Meshy 7.1 or Meshy 6, 25 with Ultra 2K or Ultra 4K, or 10 with Meshy 6 Lite. On paid plans other than Enterprise, Ultra 2K is selected by default. ### When do my Meshy credits reset? Monthly credits reset at 00:00 UTC on the first day of each month. Permanent and purchased credits don't expire. ### Will I be charged credits if a generation fails? No. Meshy doesn't charge credits for failed generations, and it refunds credits for canceled tasks. ### Can I use Meshy models commercially? Yes. All paid plans include commercial-use rights. Models made on the Free plan are licensed under CC BY 4.0. --- ## Next steps - To start with your free credits, see [Meshy web app documentation](/webapp/getting-started). - For API credit costs, see [Pricing](/api/pricing) in the API docs. - For refunds, upgrades, and invoices, see [Billing](https://help.meshy.ai/en/collections/10642990-billing) in the Meshy Help Center. --- # AI Texturing Source: https://docs.meshy.ai/webapp/guides/3d-model/ai-texturing # AI Texturing Generate PBR textures for a 3D model from a text prompt or a reference image, whether Meshy generated the model or you uploaded it. Use AI Texturing to texture an untextured mesh, to replace textures you aren't happy with, to change a model's material style, or to get a complete PBR texture set. To touch up one area of a texture instead, use [Texture Edit](/webapp/guides/texture-edit). To paint textures by hand, export the model with its UVs and work in a tool such as Substance Painter. For color or brightness adjustments only, use your DCC tool. --- ## Before you begin You need a model in your generations. To texture a model you made in another tool, upload it first: 1. In the panel that lists your generations, click **Upload**. 2. Add a `.fbx`, `.obj`, `.stl`, `.gltf`, or `.glb` file up to 100 MB. 3. Click **Continue**. --- ## Texture a model To texture a model, follow these steps: 1. In the panel that lists your generations, click the model. 2. In the viewer toolbar, click **Texture**. If the model already has textures, the button is **Retexture**. 3. In the panel, select **Text Input** to describe the material, or **Image Input** to match a reference image. 4. If the panel shows a model list, select **Meshy 7 - Flagship** for the most detail, **Meshy 6**, or **Meshy 6 Lite** for the fastest result. 5. Describe the material or add the image: - With **Text Input**, describe the material in **Prompt** in up to 800 characters, for example "rusted iron with scratches". - With **Image Input**, add a `.png`, `.jpg`, `.jpeg`, or `.webp` image up to 20 MB. With Meshy 7 - Flagship, you can also turn on **Multi-view** to add images from other angles. Multi-view needs a paid plan. 6. Optional: If the panel shows **Generate PBR Maps**, turn it on to get metallic, roughness, and normal maps in addition to the base color. 7. Optional: If the panel shows **Texture Resolution**, select **2K**, **4K**, or **8K**. 4K and 8K need a paid plan, and 8K is available with Meshy 7 - Flagship only. 8. Optional: With Meshy 6, turn on **Remove Lighting** to remove highlights and shadows from the base color. 9. Click **Texture**. The panel shows the time and credit cost before you start. Texturing costs 10 credits, or 15 credits at 8K. 10. Optional: To check the textures under different lighting, switch the viewer to its PBR preview mode, and then change the HDRI in the environment settings. 11. In the viewer toolbar, click **Download** to export the model with its textures. ![Meshy AI Texturing panel: texture a model from a text or image prompt, with Remove Lighting, PBR maps, and HD Texture options](https://cdn.meshy.ai/webapp-assets/doc/ai-texturing-p0-1-1.png) --- ## Settings and tradeoffs The following table shows what each setting trades off. | Setting | Options | Tradeoff | | --- | --- | --- | | AI model | Meshy 7 - Flagship, Meshy 6, or Meshy 6 Lite | Meshy 7 - Flagship gives the most detail and the sharpest textures, in about 2 to 3 minutes. Meshy 6 takes about a minute. Meshy 6 Lite is the fastest, at about 30 seconds, and always generates at 2K. | | Remove Lighting | On or off | On removes baked highlights and shadows, which suits PBR pipelines. Off keeps the original lighting. Available with Meshy 6 at 2K or 4K. | | Generate PBR Maps | On or off | On adds metallic, roughness, and normal maps to the base color for a complete PBR set. Off gives the base color only. | | Texture Resolution | 2K, 4K, or 8K | 2K generates faster. 4K gives more detail. 8K gives the most detail and costs 15 credits instead of 10. | | Prompt | Free text | A more specific prompt gives better results. Combine several style keywords. | --- ## Examples A specific prompt with the right settings gives a complete texture set: - Input: a low-poly sword mesh with no textures, and the prompt "ancient elvish blade, silver with blue rune engravings, fantasy style" - Settings: Meshy 6 with **Remove Lighting** and **Generate PBR Maps** on, at a resolution that suits your use - Result: a complete PBR texture set with detailed engravings and an accurate metallic look. A one-word prompt on a mesh with poor UVs gives a poor result: - Input: a dense mesh with overlapping UVs, and the prompt "wood" - Result: visible texture seams and distortion. - Fix: run Unwrap UV to generate a clean UV layout, and then texture the model again. --- ## Troubleshooting The following table lists common problems, their causes, and how to fix them. | Problem | Cause | Fix | | --- | --- | --- | | Texture seams are visible | The UV layout is poor | Run [Unwrap UV](/webapp/guides/3d-model/unwrap-uv), and then texture the model again. | | The PBR maps look flat | Baked shadows stay in the texture | Use Meshy 7 - Flagship, which removes baked lighting automatically, or select Meshy 6 and turn on **Remove Lighting**. | | The texture style doesn't match the prompt | The prompt is too short | Add details about the material, era, wear level, and colors. | | Textures load slowly | 4K and 8K texture files are large | If you don't need a high resolution, select **2K**. | | Meshy says the model has too many faces to texture | The model has 8 million faces or more | Reduce the face count with [Remesh](/webapp/guides/3d-model/remesh). Meshy opens the Remesh panel for you. | --- ## FAQ ### How do I add textures to a 3D model in Meshy? Select a model or upload your own, and click Texture in the viewer toolbar. Enter a material prompt or add a reference image, and then click Texture in the panel. ### Can I texture a model I made elsewhere? Yes. Upload a .fbx, .obj, .stl, .gltf, or .glb file up to 100 MB, and texture it like a model that Meshy generated. ### What does Remove Lighting do? It removes baked-in highlights and shadows from the base color texture, so PBR rendering looks correct under any lighting. It's available with Meshy 6. ### What PBR maps does Meshy generate? With Generate PBR Maps turned on, Meshy generates metallic, roughness, and normal maps in addition to the base color. You can generate at 2K or 4K, or at 8K with Meshy 7 - Flagship. ### Why do my textures have seams or distortion? Poor UVs usually cause this. Run Unwrap UV to generate a clean UV layout, and then texture the model again. --- ## Next steps - To generate clean UVs before you texture a model, see [Unwrap UV](/webapp/guides/3d-model/unwrap-uv). - To optimize the mesh before you texture it, see [Remesh](/webapp/guides/3d-model/remesh). - To fix one area of a texture without replacing it, see [Texture Edit](/webapp/guides/texture-edit). --- # Auto Split Source: https://docs.meshy.ai/webapp/guides/3d-model/auto-split # Auto Split Split a 3D model into watertight parts that you print separately and assemble, for oversized models, figures, and multi-color prints. If the model already fits your printer's build volume and prints cleanly in one piece, you don't need to split it. For exact cut positions or custom joints, cut the model by hand in a tool such as Blender or Meshmixer. --- ## Before you begin - Split needs a paid plan. - You need an untextured model that you generated in Meshy with **High Detail** and Meshy 6 or Meshy 7.1. Textured, uploaded, and remeshed models can't be split, and neither can Meshy 6 Lite or Smart Topology models. --- ## Split a model You can split a model when you generate it. In Image to 3D with Meshy 6 or Meshy 7.1, or in Text to 3D with Meshy 6, turn on **Split** before you click **Generate**. **Split** needs **Texture** turned off and adds 10 credits. The toggle has no settings, so to choose how the model splits, split it after generation instead. To split a model after generation, follow these steps: 1. In the left sidebar, click **Print**. 2. In the list of your generations, select an untextured model. 3. Under **Post-Processing**, click **Split**. 4. Select a mode: - **Custom**: The default. Under **Split Plan**, select **By Parts** to split the model into structural parts, or **By Color** to split it by the colors of the reference image. **By Color** is available only for models generated from an image. Meshy suggests a description of the parts, which you can edit to name up to 10 parts. - **Auto**: Meshy splits the model without a description. 5. Optional: Turn on **Connectors** to add a connector at each cut surface. Select **Cube** or **Cylinder**, and adjust **Size** and **Height**. 6. Click **Split**. The panel shows the cost, 10 credits, and the estimated time. **Custom** takes about 1 minute, and **Auto** about 10 seconds, or 20 seconds with **Connectors** on. When the split finishes, the split result shows each part in a different color. --- ## Check the parts To check how the parts fit together, do any of the following: - Drag the slider in the split toolbar to pull the parts apart, and drag it back to bring them together. - Select **Assembled** to see the parts fitted together, or **On Plate** to see them laid out flat on the print plate. - Click **Parts** to list every part with its color and number. To hide or show a part, click the eye icon in its row. - To try a different split, click **Re-split** in the toolbar, and then click **Re-split** in the panel. Meshy splits the original model again and saves the result as another version. Your current parts stay saved, and each re-split costs credits. --- ## Download the parts To download the parts, follow these steps: 1. In the split toolbar, select **Assembled** to export the parts in their fitted positions, or **On Plate** to export them laid out for printing, ready to import into your slicer without repositioning. 2. In the viewer toolbar, click **Download**. 3. In **Download Settings**, under **Format**, select a format: - 3MF: Keeps each part separate with its own filament color, up to 16 colors. - GLB or OBJ: Keeps each part and its color. - STL: Exports one mesh, without separate parts or colors. 4. Click **Download**. To open the parts in a slicer such as Bambu Studio or OrcaSlicer instead, in the **Print** panel, under **Send to Printer**, select your slicer. **Send to Printer** needs a Pro plan or higher. --- ## Example