Tencent Hunyuan AI 3D Generation (OpenAI-compatible API) - Text-to-3D and image-to-3D generation.
This skill uses OpenAI-compatible API, different from traditional Tencent Cloud API:
- Uses API Key authentication (not SecretId/SecretKey)
- OpenAI-style interface
- Professional version only (no rapid version)
- 🎨 Text-to-3D: Generate 3D models from text descriptions
- 🖼️ Image-to-3D: Generate 3D models from images
- 🎯 Multi-version: Support model versions 3.0 and 3.1
Required: Enable service in Tencent Cloud console first:
- Visit Tencent Hunyuan 3D Console
- Click "Enable Now" or "Apply"
- Read and agree to service agreement
- Wait for service activation (usually instant)
Common Issues:
- If "Insufficient Resources" shows, service is initializing, wait 5-10 minutes
- If cannot enable, may need real-name verification or contact support
- Visit Hunyuan 3D API Key Management
- Click "Create API Key"
- Enter name (e.g., hunyuan-3d-key)
- Copy the generated API Key (format:
sk-xxxxx)
Alternative: If above link doesn't work, use Hunyuan API Key page
Windows PowerShell:
# Temporary (current session)
$env:HUNYUAN_3D_API_KEY = "sk-xxxxx"
# Permanent (recommended)
[Environment]::SetEnvironmentVariable("HUNYUAN_3D_API_KEY", "sk-xxxxx", "User")Linux/Mac:
# Temporary
export HUNYUAN_3D_API_KEY="sk-xxxxx"
# Permanent (add to ~/.bashrc or ~/.zshrc)
echo 'export HUNYUAN_3D_API_KEY="sk-xxxxx"' >> ~/.bashrc
source ~/.bashrc# Check environment variable
Write-Host "API Key: $($env:HUNYUAN_3D_API_KEY.Substring(0,15))..."
# Test generation
python scripts/generate.py --mode text --prompt "a cute dog"If "Insufficient Resources" error: Service is initializing, wait 5-10 minutes and retry
# Text-to-3D
python scripts/generate.py --mode text --prompt "a cute pig"
# Image-to-3D
python scripts/generate.py --mode image --image-url "https://example.com/pig.jpg"
# Use version 3.1
python scripts/generate.py --mode text --prompt "dog" --model 3.1| Parameter | Description | Example |
|---|---|---|
--mode |
Generation mode | text (text-to-3D), image (image-to-3D) |
--prompt |
Text description (text-to-3D) | "a cute pig" |
--image-url |
Image URL (image-to-3D) | "https://example.com/pig.jpg" |
--model |
Model version | 3.0 (default), 3.1 |
--output |
Output directory | ./models |
| Version | Features |
|---|---|
| 3.0 | Default, full features |
| 3.1 | New version, but LowPoly and Sketch parameters not available |
Text-to-3D:
- Text description: max 1024 UTF-8 characters
- Chinese prompts supported
Image-to-3D:
- Format: jpg, png, jpeg, webp
- Size: ≤8MB
- Resolution: 128px ~ 5000px (single side)
Generated 3D models are saved to {output}/{date}/{job_id}/:
model.glb- 3D model file (GLB format)model.obj- 3D model file (OBJ format, in ZIP)preview.png- Preview imageinfo.json- Task information
Output Formats:
- Both GLB and OBJ formats returned
- Includes texture maps
- With preview image
- Base URL:
https://api.ai3d.cloud.tencent.com - Submit Task:
POST /v1/ai3d/submit - Query Task:
POST /v1/ai3d/query - Authentication: API Key (Header:
Authorization: sk-xxxxx)
Error: ResourceUnavailable.NotExist
Solution:
- Visit https://console.cloud.tencent.com/ai3d
- Enable Hunyuan 3D service
- Wait a few minutes for activation
- Retry
Error: ResourceInsufficient
Solution:
- Service just enabled, wait 5-10 minutes and retry
- Or contact Tencent Cloud support
Error: Unauthorized or authentication failed
Solution:
- Ensure using correct API Key (not SecretId/SecretKey)
- API Key format should be
sk-xxxxx - Create at https://console.cloud.tencent.com/ai3d/api-key
OpenAI-compatible API returns:
{
"Response": {
"JobId": "xxx",
"Status": "DONE",
"ResultFile3Ds": [...]
}
}Note: Status field is Status not StatusCode, success value is DONE not SUCCESS
- Async API: Divided into submit task and query task steps
- Task Validity: 24 hours
- Concurrent Limit: Default 3 concurrent
- Professional Only: OpenAI-compatible API doesn't support rapid version
- Generation Time: 3D generation takes longer (1-5 minutes), please be patient
# Generate pig 3D model
python scripts/generate.py --mode text --prompt "a cute pig, pink, cartoon style"
# Image-to-3D
python scripts/generate.py --mode image --image-url "https://example.com/pig-photo.jpg"
# Use version 3.1
python scripts/generate.py --mode text --prompt "dog" --model 3.1MIT License