Meshy 3D — Generation + Printing
Directly communicate with the Meshy AI API to generate and print 3D assets. Covers the complete lifecycle: API key setup, task creation, exponential backoff polling, downloading, multi-step pipelines, and 3D print preparation with slicer integration.
SECURITY MANIFEST
Environment variables accessed:
- — API authentication token sent in HTTP header only. Never logged, never written to any file except in the current working directory when explicitly requested by the user.
External network endpoints:
- — Meshy AI API (task creation, status polling, model/image downloads)
File system access:
- Read: / in the current working directory only (API key lookup)
- Write: in the current working directory only (API key storage, only on user request)
- Write: in the current working directory (downloaded model files, metadata)
- Read: files explicitly provided by the user (e.g., local images passed for image-to-3D conversion), accessed only at the exact path the user specifies
- No access to home directories, shell profiles, or any path outside the above
Data leaving this machine:
- API requests to include the in the Authorization header and user-provided text prompts or image URLs. No other local data is transmitted. Downloaded model files are saved locally only.
All paths below are relative to this skill's own directory (the directory containing this SKILL.md). Resolve them before running.
| Resource | When to use |
|---|
| Bundled CLI for every Meshy API call (create / poll / download / record / …) |
| Detect installed slicers; open a model file in a slicer |
| Fix OBJ coordinate system, scale, and origin for slicers |
| reference.md | Full API reference: every parameter, response schema, error code |
| references/setup.md | API key setup — read when Step 0 finds no key |
| references/pipelines.md | Generation recipes: exact payloads + script calls per endpoint |
| references/printing.md | Print pipeline walkthroughs: slicer detection, analyze/repair, white model, multicolor, Creative Lab |
| references/troubleshooting.md | Error recovery trees and task failure messages |
IMPORTANT: First-Use Session Notice
When this skill is first activated in a session, inform the user:
All generated files will be saved to
in the current working directory. Each project gets its own folder (
{YYYYMMDD_HHmmss}_{prompt}_{id}/
) with model files, textures, thumbnails, and metadata. History is tracked in
meshy_output/history.json
.
This only needs to be said once per session.
IMPORTANT: File Organization
All downloaded files MUST go into a structured
directory in the current working directory.
Do NOT scatter files randomly.
- Each project:
meshy_output/{YYYYMMDD_HHmmss}_{prompt_slug}_{task_id_prefix}/
- Chained tasks (preview → refine → rig) reuse the same
- Track tasks in per project, and global
- Auto-download thumbnails alongside models
The bundled CLI implements this:
,
, and
subcommands.
IMPORTANT: Shell Command Rules
Use only standard POSIX tools. Do NOT use
,
,
,
/
.
IMPORTANT: Run Long Tasks Properly
Meshy generation takes 1–5 minutes. Run each
as a single Bash call and let it finish — the bundled CLI prints unbuffered progress in real time. Tasks sitting at 99% for 30–120s is normal finalization — do NOT interrupt. Pass a larger
for heavy tasks instead of retrying.
IMPORTANT: Never Rebuild Bundled Scripts
is the single source of truth for
/
/
/
/
/
.
Never retype, paraphrase, or "reconstruct" these helpers from memory — not even partially. Compose CLI calls in bash, or write a small Python script that does
sys.path.insert(0, "<this skill's scripts dir>")
and
from meshy_task import ...
.
Step 0: API Key Detection (ALWAYS RUN FIRST)
Only the current session environment and / in the current working directory are checked. Never scan home directories or shell profile files.
bash
python3 scripts/meshy_task.py check-env
Decision After Detection
- → Proceed to Step 1.
- → Go to Step 0a.
- → Run .
Step 0a: API Key Setup (Only If No Key Found)
Follow
references/setup.md: create a key at
https://www.meshy.ai/settings/api (Pro plan required), verify it against
, and optionally persist it to
in the current project (auto-added to
).
Step 1: Confirm Plan With User Before Spending Credits
CRITICAL: Before creating any task, present the user with a cost summary and wait for confirmation:
I'll generate a 3D model of "<prompt>" using the following plan:
1. Preview (mesh generation) — 20 credits
2. Refine (texturing with PBR) — 10 credits
3. Download as .glb
Total cost: 30 credits
Current balance: <N> credits
Shall I proceed?
For multi-step pipelines (text-to-3d → rig → animate), show the FULL pipeline cost upfront.
Note: Rigging automatically includes walking + running animations at no extra cost. Only add
(3 credits) for custom animations beyond those.
Intent → API Mapping
| User wants to... | API | Endpoint | Credits |
|---|
| 3D model from text | Text to 3D | POST /openapi/v2/text-to-3d
| 5–20 (preview) + 10 (refine) |
| 3D model from one image | Image to 3D | POST /openapi/v1/image-to-3d
| 5–30 |
| 3D model from multiple images | Multi-Image to 3D | POST /openapi/v1/multi-image-to-3d
| 5–30 |
| New textures on existing model | Retexture | POST /openapi/v1/retexture
| 10 |
| Change mesh format/topology | Remesh | | 5 |
| Convert a model to other formats (no remesh) | Convert | | 1 |
| Rescale a model to real-world size | Resize | | 1 |
| Generate fresh UVs (GLB, ≤40k faces) before external texturing | UV Unwrap | POST /openapi/v1/uv-unwrap
| 5 |
| Add skeleton to character (textured humanoid only) | Auto-Rigging | | 5 |
| Animate a rigged character | Animation | POST /openapi/v1/animations
| 3 |
| Browse animations to pick an | Animation Library (public, no API key) | GET https://api.meshy.ai/web/public/animations/resources
| 0 |
| 2D image from text (recommended pre-step before image-to-3d) | Text to Image | POST /openapi/v1/text-to-image
| 3 / 6 / 9 / 9 |
| Optimize/edit a 2D image (recommended pre-step before image-to-3d) | Image to Image | POST /openapi/v1/image-to-image
| 3 / 6 / 9 / 12 |
| Photo → styled physical product (figure/lamp/keychain/fridge-magnet) | Creative Lab | POST /openapi/creative-lab/{product}/v1/prototype
then | 6 + 30 |
| Check FDM printability | Analyze Printability | POST /openapi/v1/print/analyze
| 0 (free) |
| Repair non-manifold/degenerate-face/hole topology | Repair Printability | POST /openapi/v1/print/repair
| 10 |
| Multi-color 3D print | Multi-Color Print | POST /openapi/v1/print/multi-color
| 10 (+ generation) |
| 3D print a model (white) | → See 3D Printing Workflow section | — | 20 |
| Check credit balance | Balance | | 0 |
Step 2: Execute the Workflow
All generation endpoints return
, NOT the model — you MUST poll.
NEVER read
from the POST response.
Every workflow is a sequence of calls to the bundled CLI
— do not write your own API code:
| Subcommand | Purpose |
|---|
| Step 0 environment report |
| Current credit balance |
create --endpoint E (--payload JSON | --payload-file F)
| Create a task; prints the new task ID |
poll --endpoint E --task-id ID [--timeout 300] [--project-dir D]
| Poll to completion; saves the task JSON into the project dir |
get --endpoint E --task-id ID [--save F]
| One-shot status / progress / face_count check |
download (--url U | --task-json F [--format FMT]) --output PATH
| Stream-download a model file |
project-dir --task-id ID [--prompt P]
| Create + print the project folder path |
record --project-dir D --task-id ID --task-type T --stage S [--files "a,b"]
| Update + |
thumbnail --project-dir D (--url U | --task-json F)
| Save the project thumbnail |
check-faces --endpoint E --task-id ID [--max-faces 300000]
| Pre-rigging polycount gate |
Follow the matching recipe in
references/pipelines.md:
Text to 3D (preview → refine),
Image to 3D,
Multi-Image to 3D,
Retexture,
Remesh,
Convert / Resize / UV Unwrap,
Auto-Rigging + Animation (textured humanoid + t-pose + face-count gate; look
up in the public catalog),
Text/Image to Image.
2D Optimization Pre-Step (strongly recommended): prefer the image-to-3d route over direct text-to-3d — for a text-only request, first make a design image via
/openapi/v1/text-to-image
(
; characters:
generate_multi_view: true
+
), then 3D-ify. For low-quality reference images, clean up first via
/openapi/v1/image-to-image
. 3–9 extra credits typically buy a noticeable quality bump. Skip when the user provides a clean studio shot, and always skip for Creative Lab products (they stylize internally).
3D Printing Workflow
IMPORTANT: When the user's request involves 3D printing, use this section for the ENTIRE workflow — including model generation. Do NOT run the generation workflows above and then come here. This section controls
and other print-specific parameters from the start.
Trigger when the user mentions: print, 3d print, slicer, slice, bambu, orca, prusa, cura, multicolor, multi-color, 3mf, figurine, miniature, statue, physical model, desk toy, phone stand.
Decision: White Model vs Multicolor
- Detect installed slicers first:
python3 scripts/slicers.py detect
- Ask the user: "White model (single-color) or multicolor?"
- If multicolor: check for multicolor-capable slicer (OrcaSlicer, Bambu Studio, Creality Print, Elegoo Slicer, Anycubic Slicer Next), ask max_colors (1-16, default 4) and max_depth (3-6, default 4), confirm cost: 40 credits (+10 if repair is needed)
- (Recommended) After generation, run a printability analysis (
POST /openapi/v1/print/analyze
, FREE). Run POST /openapi/v1/print/repair
(10 credits) only if status = error.
Then follow the full walkthroughs in references/printing.md:
- White Model Pipeline (20 credits): generate untextured () → download OBJ → (Y-up→Z-up, scale to mm, center, bottom at Z=0) → open in slicer
- Multicolor Pipeline (40 credits): generate + texture (refine/retexture REQUIRED) → multi-color API → download 3MF → open in multicolor slicer. The multi-color API outputs 3MF directly — no coordinate conversion, no needed at generation.
- Creative Lab (36 credits): photo → (6) → (30) → textured GLB, ready to print; multicolor via .
- Print-quality checklist (wall thickness, overhangs, base stability, …) is in references/printing.md.
Key rules: always detect slicer first and report; always run the FREE analyze for production/functional prints; repair only on
(or
when quality matters); repair does NOT preserve textures (repair → re-texture → multicolor); if OBJ is unavailable, download GLB and import manually; after opening in a slicer, remind the user to check print settings (layer height, infill, supports).
Step 3: Report Results
After task succeeds:
- Downloaded file paths and sizes
- Task IDs (for follow-up: refine, rig, retexture)
- Available formats (list keys)
- Credits consumed + current balance (task JSON has ; run )
- Suggested next steps:
- Preview done → "Want to refine (add textures)?"
- Model done → "Want to rig this character?"
- Rigged → "Want to apply a custom animation?"
- Any textured model → "Want to 3D print this? Multicolor printing is available!"
- Any model → "Want to 3D print this?"
Error Recovery
On any failure, follow
references/troubleshooting.md: HTTP status handling (401/402/422/429/5xx), retry policy, and known task
messages. The bundled CLI auto-reports the current balance on 402 and exits non-zero with the server's error message on failure.
Known Behaviors & Constraints
- 99% stall: Normal finalization (30–120s). Do NOT interrupt.
- Asset retention: Files deleted after 3 days (non-Enterprise). Download immediately.
- PBR maps: Must set explicitly.
- Refine: Works with , , or — pick the same family as your preview for consistency. 10 credits regardless of model. ( is retired → 400.)
- Deprecated params: no longer affects output; is ignored by Meshy-6; use instead of the old flag; use (//) instead of ; on image-to-3d use
model_type: "smart-topology"
(with ) instead of the deprecated . Smart Topology is image-to-3d only — Text to 3D and Multi-Image to 3D don't have it.
- Rigging needs textures: rig the textured task (text-to-3d refine, or image-to-3d with ) — untextured meshes are unsupported, so a mesh-only preview fails. Also: bipedal humanoid only, ≤300k faces via , and a model must face +Z.
- Inspect before downloading: pass
multi_view_thumbnails: true
on image-to-3d / multi-image-to-3d and read (front/right/back/left, 512×512 PNG) instead of pulling a 50–200 MB GLB just to check the result. ~3s extra latency.
- Never hardcode : fetch
GET https://api.meshy.ai/web/public/animations/resources
(public, no key, to narrow) and match the user's intent against / . IDs are not — the catalog includes , , .
- : Every task GET response includes — read it to report the real credits spent rather than estimating. A task reports (credits are refunded), so a transient failure can be retried without re-approving the spend.
- Rigging: Humanoid bipedal only, polycount ≤ 300,000 (enforced by ).
- Printing formats: White model → OBJ with . Multicolor → 3MF from Multi-Color Print API. Always detect slicer first.
- Download format: Ask the user which format they need before downloading. GLB (viewing), OBJ (printing), 3MF (multicolor), FBX (games), USDZ (AR). Do NOT download all formats.
- 3MF for multicolor: Multi-Color Print API outputs 3MF directly — no need to request 3MF from generate/refine. For non-print use cases needing 3MF, pass in .
- Timestamps: All API timestamps are Unix epoch milliseconds.
Execution Checklist
Additional Resources
For the complete API endpoint reference including all parameters, response schemas, and error codes, read reference.md.