Skip to content

3D 资产生成 API(Meshy)

Meshy 系列用于文本/图片 → 3D 资产(网格草稿、纹理等)。
本页描述本站 /v1/3d 兼容层(已挂载)。

现状

说明
路径POST /v1/3dGET /v1/3d/{task_id}
协议异步任务;无 Webhook,请轮询
图片仅 Base64 / data URI不支持 http(s) URL
纹理只能作用于已完成的 draft 任务
渠道需后台配置 Meshy 渠道 type=61 并填入官方 Key 后启用

模型 ID

模型用途
meshy-5.3 / meshy-6文本/图生 3D(完整流程入口)
meshy-5.3-draft / meshy-6-draft草稿网格(快)
meshy-5.3-texture / meshy-6-texture对 draft 上纹理

鉴权

http
Authorization: Bearer sk-你的APIKey
Content-Type: application/json

Base:https://api.ashpetals.com

1. 创建草稿 / 文本生成

POST https://api.ashpetals.com/v1/3d

参数

参数类型必填说明
modelstringmeshy-6-draft
promptstring文本时是描述
image / image_base64string图生时是 data:image/...;base64,... 或纯 base64
draft_task_idstringtexture 时是已完成 draft 的任务 ID(也可用 source_task_id / preview_task_id
topologystring拓扑偏好
target_polycountint目标面数
enable_pbrboolPBR
seedint种子
texture_promptstring纹理描述(texture 模型)

示例:文本 draft

bash
curl https://api.ashpetals.com/v1/3d \
  -H "Authorization: Bearer sk-你的APIKey" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meshy-6-draft",
    "prompt": "low-poly cute fox, clean topology, game ready"
  }'

示例:图生(仅 Base64)

bash
curl https://api.ashpetals.com/v1/3d \
  -H "Authorization: Bearer sk-你的APIKey" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"meshy-6-draft\",
    \"image\": \"data:image/png;base64,${IMG_B64}\"
  }"

创建响应

json
{
  "id": "task_xxxxxxxx",
  "object": "3d",
  "model": "meshy-6-draft",
  "status": "queued",
  "progress": 0,
  "created_at": 1780000000
}

2. 查询任务(轮询)

GET https://api.ashpetals.com/v1/3d/{task_id}
status含义
queued排队
in_progress生成中
completed完成
failed失败

没有默认 HTTP 回调。建议每 3–8 秒轮询,超时按业务自定(常见 5–15 分钟)。

完成态常见字段:

json
{
  "id": "task_xxxxxxxx",
  "status": "completed",
  "result": {
    "model_urls": { "glb": "https://…" },
    "thumbnail_url": "https://…"
  }
}

3. 纹理(仅 draft)

bash
curl https://api.ashpetals.com/v1/3d \
  -H "Authorization: Bearer sk-你的APIKey" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meshy-6-texture",
    "draft_task_id": "task_xxxxxxxx",
    "prompt": "stylized wood texture, soft AO"
  }'

失败条件:

  • 未传 draft_task_id
  • draft 未 completed
  • 图片传了 https://… URL

4. 推荐流程

1) POST draft(text 或 base64 image)
2) GET 轮询 → completed
3) POST texture(draft_task_id)
4) GET 轮询 → completed → 取 glb/fbx

计费

按次计费,draft 与 texture 通常分别计次;以 模型广场 为准。

相关

AshPetals API — 单主站 · OpenAI 兼容