hi3d-cli
v0.1.25
Published
CLI tool and AI Agent skill for Hi3D API (hitem3d.ai): generate 3D models (GLB, OBJ, STL, FBX, USDZ, 3MF) from images, reliefs, model splitting, and multicolor
Maintainers
Readme
_ _ _ _____ ___ ____ _ ___
| || (_)___ / | _ \ / ___| | |_ _|
| || | | |_ \ | | | || | | | | |
| || | |___) || |_| || |___| |___ | |
|_||_|_|____/ |____/ \____|_____|___|Hi3D CLI (hi3d)
Generate 3D models from text or image in one command — CLI for HI3D (GLB/OBJ/STL/FBX/USDZ) for Humans & AI Agents.
A lightweight Node.js CLI tool and AI Agent Skill for generating 3D models (GLB, OBJ, STL, FBX, USDZ, 3MF, EXR, PNG, BMP) via the Hi3D API (https://api.hitem3d.ai).
Supports single & multi-view image-to-3D, 3D relief generation, model splitting, and multicolor 3D mesh creation.
Zero runtime dependencies — requires only Node.js >= 18.
🚀 Quick Start & Setup
The executable command is hi3d:
npx -y hi3d-cli setupThe interactive setup wizard guides you through:
- Hi3D API Keys — Access Key (
ak_...) & Secret Key (sk_...) from https://platform.hi3d.ai/console/apiKey, saved to~/.hi3d/config.json. - AI Agent Skill — offers installation of
hi3d-generateskill vianpx -y skills add MIt9/hi3d-skills/hi3d-generate.
🔑 Setting API Credentials
Get your API credentials from the Hi3D Console.
Set credentials via CLI or Environment Variables:
# Option 1: Interactive Wizard
hi3d setup
# Option 2: Config command
hi3d config --set-access-key ak_... --set-secret-key sk_...
# Option 3: Environment Variables
export HI3D_ACCESS_KEY=ak_...
export HI3D_SECRET_KEY=sk_...Verify account balance:
hi3d balance📐 Models, Resolutions & Capabilities
Generation Categories:
• image-to-3d — Single or Multi-view Image to 3D
- Modes: Geometry-only (
1), Texture staged (2), All-in-One (3) - Export Formats:
obj,glb,stl,fbx,usdz,3mf
•relief— Image to 3D Relief (/open-api/v1/depth/create-task) - Models:
pro(2K),base(1K) - Export Formats:
exr,png,stl,glb,3mf,bmp - Parameters:
--height-relief(0.1..50.0),--rmbg(0/1),--degree-rmbg(0.00..1.00),--shape-base(0:square, 1:circle),--thickness-base(0.1..20.0 mm),--width(20..600 mm),--sculpmode(0:emboss, 1:engrave)
•split— 3D Model Split (/open-api/v1/split/create-task) - Models:
character(with--parta..f,--jointnone/ball/dovetail/pin,--mergeyes/no),general(with--levellow/medium/high) - Export Formats:
obj,glb,stl,fbx,usdz,3mf
•multicolor— 3D Model Multicolor (/open-api/v1/muilticolor/create-task) - Models:
multicolor(with--number-color1..8 or 0 max) - Export Formats:
obj,glb,fbx,3mf
Model Versions & Resolutions:
• General Models:
hi3dv3.0:2048quality,2048master(PBR support)hitem3dv2.1:1536fast,1536pro(PBR support)hitem3dv2.0:1536,1536pro(PBR support)hitem3dv1.5:512,1024,1536,1536pro
• Portrait Models:scene-portraitv2.1:1536profast,1536pro(PBR support)scene-portraitv2.0:1536proscene-portraitv1.5:1536
• Depth Map / Relief Models:pro: Higher quality model (2K)base: Standard quality model (1K)
• Split Models:character,general
• Multicolor Models:multicolor
💻 Usage & Examples
1. Single Image to 3D
hi3d run image-to-3d \
--image ./chair.png \
--model hi3dv3.0 \
--format obj \
--resolution 2048quality \
--wait \
--download ./output2. Multi-View Image to 3D
hi3d run image-to-3d \
--multi-images ./front.jpg,./left.jpg \
--multi-images-bit 1010 \
--format stl \
--wait \
--download ./models3. Image to 3D Relief
hi3d run relief \
--image ./portrait.png \
--model pro \
--height-relief 2.5 \
--format stl \
--wait \
--download ./reliefs4. 3D Model Split & Multicolor
# Character Split
hi3d run split \
--mesh ./character.glb \
--model character \
--part a \
--joint ball \
--format fbx \
--wait \
--download ./parts
# Multicolor Mesh Generation
hi3d run multicolor \
--mesh ./model.glb \
--number-color 4 \
--format 3mf \
--wait \
--download ./multicolor5. Query Task Status & Download
hi3d status <task_id> --download ./models6. Safe Retries & Idempotency (paid generations)
Network drops after the API accepts a task but before the CLI saves task_id can cause duplicate paid generations on retry.
hi3d prevents this locally:
- 10-minute recovery — identical request (same image content +
model/format/resolutionetc.) within 10m reuses the previoustask_id:♻️ Recovered previous task <id> submitted Xs ago … Use --force to submit a new task anyway.ItqueryTasks the cached ID first; if that task is still pending/success it is reused. - 5-minute pending lock — if the previous identical request failed before
task_idwas received (network timeout), the next identical request is blocked:⚠️ Previous submission … failed before task_id was received … Use --force to override.This covers the ambiguous window where the job may have succeeded server-side. --force— bypass both guards and force a new submission:hi3d run image-to-3d --image ./chair.png --wait --forceX-Idempotency-Key— everysubmitsendsX-Idempotency-Key: sha256(params+imageHash)(first 32 hex chars) for server-side deduplication if the API honors it; no effect otherwise.- API errors (e.g.
balance is not enoughcode=30010000) clear the pending marker immediately, so retry without--forceis allowed — only network-level failures keep the lock. - Dry-run shows the would-be behavior:
--dry-runprints_idempotencyKeyand hints(dry-run) Would recover task …/Would block due to pending …
Cache: ~/.hi3d/task-cache.json (TTL 24h, last 50 entries, chmod 600). Delete it to clear history.
# Normal retry is safe — reuses previous task
hi3d run image-to-3d --image ./chair.png --wait
# → ♻️ Recovered previous task abc123 submitted 23s ago …
# Force duplicate (you accept double charge)
hi3d run image-to-3d --image ./chair.png --wait --force
# Dry-run shows key without spending credits
hi3d run image-to-3d --image ./chair.png --model hitem3dv1.5 --resolution 512 --dry-run --json
# → { ..., "_idempotencyKey": "a08013ac..." }🤖 AI Agent Skill Integration
Install the hi3d-generate skill into your AI Agent environment (Antigravity, Cursor, Claude, etc.):
npx -y skills add MIt9/hi3d-skills/hi3d-generate