lowpoly 將於 2026年10月30日 下線。 請在這些日期前切換模型,以免請求出錯。

Auto Split API

將一個 3D 模型拆分為可分別列印的多個部件——可以自動拆分、按你指定的部件拆分,或按顏色區域拆分——並可選擇添加連接件;拆分產生的薄弱區域會始終被加固,以確保每個部件都能列印得堅固耐用。


POST/openapi/v1/print/split

Create an Auto Split Task

此 endpoint 建立一個新的 Auto Split 任務。該任務會將先前某個任務生成的模型切割為可分別列印的部件,並返回切分後的模型,每個部件在檔案中都是獨立的物件。

任務在背景執行。關於通常所需的時間,請參閱處理時間。

參數

  • Name
    input_task_id
    Type
    string
    必選
    Description

    待拆分模型所屬的已成功任務的 ID。支援的任務類型:Image to 3D、Multi-Image to 3D、Text to 3D(預覽版)、Remesh、Convert 以及 Resize。該任務的狀態必須為 SUCCEEDED,且其模型必須由 Meshy 6 或 Meshy 7 生成(ai_model 為 meshy-6、meshy-7、meshy-7.1 或 latest)。不支援 low-poly 和 Smart Topology(meshy-t2、meshy-t2.5)模型。可接受帶 texture 的模型,但其 texture 不會帶入結果中。

  • Name
    mode
    Type
    string
    預設值 auto
    Description

    模型被劃分為多個部件的方式。

    可用取值:

    • auto:由 Meshy 決定切割方式,prompt 將被忽略。
    • by_parts:沿你在 prompt 中指定的結構部件(例如頭部、手臂和軀幹)進行切割。
    • by_color:沿你在 prompt 中指定的顏色區域進行切割。需要輸入是由上傳圖片生成的(Image to 3D 或 Multi-Image to 3D);其他輸入會被以 400 拒絕。顏色區域邊界來自來源圖片,而非輸入模型的 texture。對於 Multi-Image to 3D,Auto Split 使用第一張來源圖片。
僅當 mode = by_parts or by_color
  • Name
    prompt
    Type
    string
    必選
    Description

    描述要拆分成的部件,可使用任意語言。Meshy 會從中讀取 1 到 10 個部件名稱,因此請命名各個部件,而不是描述整個模型,例如 split into the figure and the base,或 head, torso, left arm, right arm, legs。只命名一個部件也是可以的:所有未命名的部分會合併成剩餘的一個部件,所以 the head 會將模型拆分為頭部和其餘部分,與 Web App 中的行為一致。最多 600 個字元。如果描述要求完全不拆分,或命名了超過 10 個部件,該請求將被以 400 拒絕,且不會產生任何費用。如果 Meshy 無法從描述中讀取到任何部件名稱,它會改為按照所選 mode,沿模型參考圖片中識別出的部件進行拆分:該任務仍會執行並計費,並攜帶 prompt_ignored: true。如果模型沒有參考圖片,或 Meshy 在其中識別到的部件少於兩個,該請求將被以 400 拒絕,且不會產生任何費用。

  • Name
    target_formats
    Type
    array
    預設值 ["glb"]
    Description

    匯出拆分後模型所用的格式。支援 scene 物件的格式(glb、obj、fbx、usdz、blend、3mf)會將每個部件作為獨立物件儲存;stl 沒有獨立物件的概念,因此會將所有部件按 layout 排布後熔合為一個實體(如需在 slicer 中分別選取各部件,請使用 3mf)。glb 始終會生成並在 model_urls 中返回;如需其他格式,請在此列出。

    可用取值:glb、obj、fbx、stl、usdz、blend、3mf。

  • Name
    layout
    Type
    string
    預設值 assembled
    Description

    各部件在每種輸出格式以及 thumbnail 中的排布方式。

    可用取值:

    • assembled:各部件保持在來源模型中的原始位置。
    • on_plate:各部件被平鋪並攤開在列印平台上,可直接用於切片——與 Web App 中的 On Plate 檢視排布方式相同。

    在這兩種 layout 下,切割後遺留的塌陷薄片或點狀碎片在匯出前都會被移除,因此你得到的每個部件都是可列印的。支援 scene 物件的格式中每個部件對應一個物件;stl 會將它們熔合為單一實體。

  • Name
    connectors
    Type
    boolean
    預設值 false
    Description

    在每個切割處新增榫卯連接件,使列印出的部件可以拼合在一起。

僅當 connectors = true
  • Name
    connector_type
    Type
    string
    預設值 cube
    Description

    每個切割面上連接件的形狀。

    可用取值:cube、cylinder。

  • Name
    connector_size
    Type
    number
    預設值 0.5
    Description

    連接件相對於切割面的大小。

    有效範圍:0.1 到 0.8。

  • Name
    connector_height
    Type
    number
    預設值 0.1
    Description

    連接件從切割面延伸出的距離,相對於切割面的比例。

    有效範圍:0.1 到 0.8。

返回值

回應中的 result 屬性包含新建立的 Auto Split 任務的 id。

失敗模式

  • Name
    400 - Bad Request
    Description

    請求不可接受。常見原因:

    • 缺少 prompt:當 mode 為 by_parts 或 by_color 時,prompt 為必填項目。
    • prompt 描述不拆分,或部件過多:by_parts / by_color 接受 1 到 10 個已命名部件。要求保持模型為單一整體,或命名了超過 10 個部件的描述將被拒絕,且不會產生任何費用。
    • 不支援的輸入任務:input_task_id 必須指向一個由 Meshy 6 或 Meshy 7 生成的、支援類型的已成功任務。
    • 沒有參考圖片:by_color 需要輸入是由上傳圖片生成的。
    • 連接件參數超出範圍:connector_size 或 connector_height 超出 0.1 到 0.8 的範圍。
  • Name
    401 - Unauthorized
    Description

    身份驗證失敗。請檢查你的 API 金鑰。

  • Name
    402 - Payment Required
    Description

    積分不足,無法執行此任務。

  • Name
    404 - Not Found
    Description

    input_task_id 不存在,或不屬於你的帳戶。

  • Name
    429 - Too Many Requests
    Description

    你已超出速率限制。by_parts 和 by_color 請求還共享每個帳戶每分鐘 12 次請求的 prompt 解析限額。

  • Name
    503 - Service Unavailable
    Description

    基於 prompt 的拆分功能(by_parts 和 by_color)暫時無法使用。請稍後重試,或使用不受影響的 mode: "auto"。此時不會產生任何費用。

Request

POST
/openapi/v1/print/split
# Simple request: let Meshy choose the cuts
curl https://api.meshy.ai/openapi/v1/print/split \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578"
  }'

# Advanced request: name the parts, add connectors, export glb and obj
curl https://api.meshy.ai/openapi/v1/print/split \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "mode": "by_parts",
    "prompt": "split into the figure and the base",
    "target_formats": ["glb", "obj"],
    "layout": "on_plate",
    "connectors": true,
    "connector_type": "cylinder",
    "connector_size": 0.4
  }'

Response

{
  "result": "0193bfc5-ee4f-73f8-8525-44b398884ce9"
}

GET/openapi/v1/print/split/:id

取得 Auto Split 任務

此端點會根據 ID 取得一個 Auto Split 任務。

參數

  • Name
    id
    Type
    path
    Description

    要取得的 Auto Split 任務的 ID。

回傳值

Auto Split 任務物件。

Request

GET
/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f
curl https://api.meshy.ai/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "print-split",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
    "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
  "part_count": 4,
  "progress": 100,
  "status": "SUCCEEDED",
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000082000,
  "task_error": null,
  "consumed_credits": 10
}

DELETE/openapi/v1/print/split/:id

刪除一個 Auto Split 任務

此 endpoint 將永久刪除一個 Auto Split 任務,包括所有相關的模型和資料。此操作無法復原。

路徑參數

  • Name
    id
    Type
    path
    Description

    要刪除的 Auto Split 任務的 ID。

任務狀態

仍處於 PENDING 狀態的任務會被刪除,且建立時消耗的積分會被退還。

已處於 IN_PROGRESS 狀態的任務無法被刪除:請求將被拒絕並回傳 409 Conflict,任務會繼續執行。worker 已經開始處理的任務所消耗的積分不可退還,因此在執行過程中刪除該任務會同時損失積分和結果。請等待任務到達 SUCCEEDED、FAILED 或 CANCELED 狀態後再刪除。

處於終止狀態(SUCCEEDED、FAILED 或 CANCELED)的任務會被刪除,且不會退還積分。

回傳值

成功時回傳 200 OK,當任務處於 IN_PROGRESS 狀態時回傳 409 Conflict。

Request

DELETE
/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f
curl --request DELETE \
  --url https://api.meshy.ai/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

// 200 OK on success, with an empty body.
//
// 409 Conflict when the task is IN_PROGRESS — the task is left running:
{
  "message": "Task is IN_PROGRESS and cannot be deleted. Credits for a task the worker has already started are not refundable; wait for it to reach SUCCEEDED, FAILED or CANCELED, then delete it."
}

GET/openapi/v1/print/split

取得 Auto Split 任務列表

此端點允許你取得 Auto Split 任務列表。

參數

可選屬性

  • Name
    page_num
    Type
    integer
    Description

    用於分頁的頁碼。從 1 開始,預設值為 1。

  • Name
    page_size
    Type
    integer
    Description

    每頁數量上限。預設為 10 項。最大允許值為 100 項;超出的值將被限制為 100。

  • Name
    sort_by
    Type
    string
    Description

    用於排序的欄位。可用值:

    • +created_at:依建立時間升冪排序。
    • -created_at:依建立時間降冪排序。

回傳值

回傳 The Auto Split Task Objects 的分頁列表。

Request

GET
/openapi/v1/print/split
curl https://api.meshy.ai/openapi/v1/print/split?page_size=10 \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response

[
  {
    "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
    "type": "print-split",
    "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***"
    },
    "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
    "part_count": 4,
    "progress": 100,
    "status": "SUCCEEDED",
    "preceding_tasks": 0,
    "created_at": 1699999999000,
    "started_at": 1700000000000,
    "finished_at": 1700000082000,
    "task_error": null,
    "consumed_credits": 10
  }
]

GET/openapi/v1/print/split/:id/stream

流式取得 Auto Split 任務

此端點使用 Server-Sent Events(SSE)以串流方式回傳 Auto Split 任務的即時更新。

參數

  • Name
    id
    Type
    path
    Description

    要串流取得的 Auto Split 任務的唯一識別碼。

回傳

以 Server-Sent Events 的形式回傳 Auto Split 任務物件 的資料流。

每個 message 事件都帶有與取得 Auto Split 任務回傳的完整任務物件相同的資料,包括 consumed_credits、時間戳記以及 prompt_ignored;當任務處於 PENDING 或 IN_PROGRESS 狀態時,各影格之間會變動的欄位是 progress、status、started_at 和 preceding_tasks,而一旦任務進入 SUCCEEDED 狀態,則會出現 model_urls、thumbnail_url 和 part_count。error 事件只帶有 status_code 和 message,因此在讀取 status 之前應先依事件名稱進行分流處理。

Request

GET
/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream
curl -N https://api.meshy.ai/openapi/v1/print/split/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response Stream

// Error event example
event: error
data: {
  "status_code": 404,
  "message": "Task not found"
}

// Message event examples illustrate task progress (other task fields omitted here for brevity;
// each frame is the full task object).
event: message
data: {
  "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f",
  "type": "print-split",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/model.glb?Expires=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/preview.png?Expires=***",
  "part_count": 4,
  "progress": 100,
  "status": "SUCCEEDED",
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000082000,
  "task_error": null,
  "consumed_credits": 10
}

Auto Split 任務物件

Auto Split 任務只攜帶以下屬性。其他任務物件包含的生成提示欄位(name、object_prompt、texture_prompt 等)、單一的 model_url 以及 texture_urls,在拆分任務中永遠不會被填入,也不會被回傳。隨著任務執行而逐步填入的屬性(thumbnail_url、model_urls、各個時間戳)始終存在,在取得值之前為空,因此 PENDING 和 SUCCEEDED 之間的鍵集合不會改變。

  • Name
    id
    Type
    string
    Description

    任務的唯一識別碼。雖然我們在實作細節上使用 k-sortable UUID 作為任務 id,但你不應對 id 的格式做任何假設。

  • Name
    type
    Type
    string
    Description

    任務的類型。此值為 print-split。

  • Name
    model_urls
    Type
    object
    Description

    拆分後模型的可下載 URL,每種請求的格式各對應一個。支援場景物件的格式會將每個部件保留為單獨的物件;stl 會將它們融合為單一實體。如果未請求某個格式,則不會回傳該格式對應的屬性。

    • Name
      glb
      Type
      string
      Description

      GLB 格式的拆分模型的可下載 URL。

    • Name
      obj
      Type
      string
      Description

      OBJ 格式的拆分模型的可下載 URL。

    • Name
      fbx
      Type
      string
      Description

      FBX 格式的拆分模型的可下載 URL。

    • Name
      stl
      Type
      string
      Description

      STL 格式的拆分模型的可下載 URL。所有部件都會融合為單一實體;如需可單獨選擇的部件,請使用 3mf。

    • Name
      usdz
      Type
      string
      Description

      USDZ 格式的拆分模型的可下載 URL。

    • Name
      blend
      Type
      string
      Description

      Blender 格式的拆分模型的可下載 URL。

    • Name
      3mf
      Type
      string
      Description

      3MF 格式的拆分模型的可下載 URL。

  • Name
    thumbnail_url
    Type
    string
    Description

    拆分模型的渲染預覽圖的可下載 URL,依照請求的 layout,每個部件以不同顏色顯示。

  • Name
    prompt_ignored
    Type
    boolean
    Description

    當 by_parts 或 by_color 請求的 prompt 未指明任何部件名稱時為 true,此時 Meshy 會自動拆分模型——結果中的部件名稱來自 Meshy,而非你提供的內容。從 PENDING 階段起即存在。對於 auto 任務以及提示被遵循的情況,此欄位會被省略。

  • Name
    part_count
    Type
    integer
    Description

    拆分產生的可列印部件數量。支援場景物件的格式每個部件對應一個物件;stl 會將它們融合為單一實體,但計數仍回報部件數量。分割過程中無法產生可列印部件的崩解碎片,會在匯出前從檔案中移除,不計入計數。

  • Name
    progress
    Type
    integer
    Description

    任務的進度。如果任務尚未開始,此屬性為 0。一旦任務成功,此值將變為 100。

  • Name
    status
    Type
    string
    Description

    任務的狀態。可能的取值為 PENDING、IN_PROGRESS、SUCCEEDED、FAILED、CANCELED 之一。

  • Name
    preceding_tasks
    Type
    integer
    Description

    前置任務的數量。

  • Name
    created_at
    Type
    timestamp
    Description

    任務建立時間的時間戳,單位為毫秒。

  • Name
    started_at
    Type
    timestamp
    Description

    任務開始時間的時間戳,單位為毫秒。如果任務尚未開始,此屬性為 0。

  • Name
    finished_at
    Type
    timestamp
    Description

    任務完成時間的時間戳,單位為毫秒。如果任務尚未完成,此屬性為 0。

  • Name
    task_error
    Type
    object
    Description

    失敗任務的錯誤詳情。完整的 task_error 物件參考請參閱 Errors。如果模型提供方的安全檢查拒絕了輸入模型,任務將以 task_error.type 為 invalid_input、code 為 provider_content_refused 而失敗。參閱 Errors。

  • Name
    consumed_credits
    Type
    integer
    Description

    此任務消耗的積分數量。始終存在:任務一旦被接受即為 10,FAILED 任務則為 0,因為失敗時費用會被退還。在任務仍處於 PENDING 狀態時刪除它,同樣會退還費用。

The Auto Split Task Object

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "print-split",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
    "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
  "part_count": 4,
  "progress": 100,
  "status": "SUCCEEDED",
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000082000,
  "task_error": null,
  "consumed_credits": 10
}