Setup
On first use, ensure the NEURAL4D_API_TOKEN environment variable is set.
All API requests must include the header: Authorization: Bearer <YOUR_TOKEN>.
When to Use
Use this skill when generating 3D models from text prompts or images using DreamTech's Neural4D engine. This is particularly suited for creating assets where precise format conversions (like .stl, .obj, .fbx) and physical dimensions are required for manufacturing workflows.
Core Rules & Cost Guardrails
1. Point Consumption Awareness
Always track API point costs before executing bulk runs:
- - Text to 3D: 20 points per operation.
- Image to 3D: 20 points per operation.
- Chibi-style Generation: 30 points per operation.
- Format Conversion: 10 points per operation.
- You can query the remaining balance at
/api/queryPointsInfo.
2. Asynchronous Polling Contract
Model generation is asynchronous. You must poll for completion:
- - Query
/api/retrieveModel using the uuid. - Check
codeStatus:
-
0: Generation complete.
-
1: Generating (Wait and poll again).
-
-3: Generation failed.
Workflow Pipelines
Pipeline A: Text to 3D
- 1. Request:
POST https://alb.neural4d.com:3000/api/generateModelWithText.
- Payload:
{"prompt": "...", "modelCount": 4, "disablePbr": 0}.
- 2. Retrieve: Extract
uuids from the response. - Poll: Call
/api/retrieveModel with the uuid until codeStatus is 0. - Download: Extract
modelUrl and download the .glb asset.
Pipeline B: Image to 3D (Strict 3-Step Process)
- 1. Matting: Submit the image (JPG/PNG, <10MB, 256x256 to 6048x8064) via
multipart/form-data to /api/mattingImage. Extract the requestId. - Get Matting Result: Send the
requestId to /api/getMattedResult. Extract a preferred fileKey from the response. - Generate: Send the
fileKey to /api/generateModelWithImage to start generation and receive uuids. - Poll: Use
/api/retrieveModel to poll status and get the modelUrl.
Pipeline C: Format Conversion for Manufacturing
For physical prototyping, default exports must be converted from
.glb.
- 1. Request:
POST https://alb.neural4d.com:3000/api/convertToFormat. - Payload: Provide the
uuid, desired modelType (e.g., stl, fbx, obj), and modelSize in millimeters (must be > 1). - Poll Status: Check
statusType:
-
0: Complete, use
modelUrl to download.
-
1: Converting (Wait and retry).
-
-1: Failed or bad parameters.
External Endpoints Reference
All requests route through the base URL: https://alb.neural4d.com:3000/api.
| Action | Endpoint | Auth | Purpose |
|---|
| Text to 3D | INLINECODE46 | Bearer Token | Generate from text prompt |
| Retrieve |
/retrieveModel | Bearer Token | Poll status and get model URL |
| Matting |
/mattingImage | Bearer Token | Pre-process image |
| Matting Result |
/getMattedResult | Bearer Token | Retrieve file keys for image generation |
| Image to 3D |
/generateModelWithImage | Bearer Token | Generate from matted fileKey |
| Convert Format |
/convertToFormat | Bearer Token | Convert to stl/fbx/obj with physical size |
| Job Progress |
/queryJobProgress | Bearer Token | Check percentage progress |
设置
首次使用时,请确保已设置 NEURAL4DAPITOKEN 环境变量。
所有 API 请求必须包含请求头:Authorization: Bearer 。
使用场景
当需要通过 DreamTech 的 Neural4D 引擎从文本提示或图像生成 3D 模型时,请使用此技能。该技能特别适用于创建需要精确格式转换(如 .stl、.obj、.fbx)和物理尺寸的制造工作流资产。
核心规则与成本控制
1. 积分消耗须知
在执行批量操作前,请始终跟踪 API 积分成本:
- - 文本转 3D: 每次操作 20 积分。
- 图像转 3D: 每次操作 20 积分。
- Q 版风格生成: 每次操作 30 积分。
- 格式转换: 每次操作 10 积分。
- 可通过 /api/queryPointsInfo 查询剩余积分。
2. 异步轮询协议
模型生成为异步操作。您必须轮询以获取完成状态:
- - 使用 uuid 查询 /api/retrieveModel。
- 检查 codeStatus:
- 0:生成完成。
- 1:生成中(等待并再次轮询)。
- -3:生成失败。
工作流管道
管道 A:文本转 3D
- 1. 请求: POST https://alb.neural4d.com:3000/api/generateModelWithText。
- 请求体:{prompt: ..., modelCount: 4, disablePbr: 0}。
- 2. 获取: 从响应中提取 uuids。
- 轮询: 使用 uuid 调用 /api/retrieveModel,直到 codeStatus 为 0。
- 下载: 提取 modelUrl 并下载 .glb 资产。
管道 B:图像转 3D(严格三步流程)
- 1. 抠图: 通过 multipart/form-data 将图像(JPG/PNG,<10MB,256x256 至 6048x8064)提交至 /api/mattingImage。提取 requestId。
- 获取抠图结果: 将 requestId 发送至 /api/getMattedResult。从响应中提取首选 fileKey。
- 生成: 将 fileKey 发送至 /api/generateModelWithImage 以开始生成并接收 uuids。
- 轮询: 使用 /api/retrieveModel 轮询状态并获取 modelUrl。
管道 C:制造用格式转换
对于物理原型制作,默认导出的 .glb 文件需要进行格式转换。
- 1. 请求: POST https://alb.neural4d.com:3000/api/convertToFormat。
- 请求体: 提供 uuid、所需的 modelType(例如 stl、fbx、obj)以及以毫米为单位的 modelSize(必须大于 1)。
- 轮询状态: 检查 statusType:
- 0:完成,使用 modelUrl 下载。
- 1:转换中(等待并重试)。
- -1:失败或参数错误。
外部端点参考
所有请求均通过基础 URL:https://alb.neural4d.com:3000/api。
| 操作 | 端点 | 认证 | 用途 |
|---|
| 文本转 3D | /generateModelWithText | Bearer Token | 从文本提示生成 |
| 获取模型 |
/retrieveModel | Bearer Token | 轮询状态并获取模型 URL |
| 抠图 | /mattingImage | Bearer Token | 预处理图像 |
| 抠图结果 | /getMattedResult | Bearer Token | 获取图像生成的 fileKey |
| 图像转 3D | /generateModelWithImage | Bearer Token | 从抠图后的 fileKey 生成 |
| 格式转换 | /convertToFormat | Bearer Token | 转换为带物理尺寸的 stl/fbx/obj |
| 任务进度 | /queryJobProgress | Bearer Token | 检查百分比进度 |