Creative Lab — 盲盒 Q 版手辦 API

透過兩個階段,將一張來源照片轉變成大頭盲盒收藏 Q 版手辦 3D 模型:prototype(原型) 階段會根據你輸入的照片產生風格化的概念圖,接著 build(建置) 階段會將該概念圖轉換為帶貼圖的 3D 模型。 這兩個階段透過 input_task_id 關聯在一起。

  • POST /openapi/creative-lab/vinyl-figure/v1/prototype
  • POST /openapi/creative-lab/vinyl-figure/v1/build

POST/openapi/creative-lab/vinyl-figure/v1/prototype

建立一個 Vinyl Figure 原型任務

根據來源照片產生一張 vinyl-figure 風格的概念圖像。回傳的任務 ID 就是你在呼叫 build endpoint 時作為 input_task_id 傳入的值。回應結構請參考 The Vinyl Figure Prototype Task Object

參數

  • Name
    image_url
    Type
    string
    必選
    Description

    供 Meshy 風格化為大頭 vinyl figure 的來源照片。目前支援 .jpg.jpeg.png.webp 格式。

    提供圖像的方式有兩種:

    • 公開可存取的 URL:可從公開網際網路存取的 URL。
    • Data URI:圖像的 base64 編碼 data URI。data URI 範例:data:image/jpeg;base64,<your base64-encoded image data>
  • Name
    name
    Type
    string
    Description

    用於顯示的選填任務名稱。最多 100 個字元。

  • Name
    remove_background
    Type
    boolean
    預設值 false
    Description

    設為 true 時,原型圖像會以移除背景的透明 RGBA PNG 格式回傳,方便你將主體合成到任意背景上。

回傳值

回應的 result 屬性包含新建立的 vinyl figure 原型任務的任務 id。輪詢 Get a Task endpoint 或訂閱 stream,直到任務達到 SUCCEEDED 狀態,然後將該 ID 作為 input_task_id 傳給 build endpoint

失敗模式

  • Name
    400 - Bad Request
    Description

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

    • 缺少參數image_url 為必填項目。
    • 圖像格式無效:提供的 image_url 不是受支援的格式(.jpg.jpeg.png.webp)。
    • 圖像尺寸超出範圍:圖像過小、超過最大檔案大小,或超過最大像素數。
    • URL 無法連通:無法下載 image_url(404 或 timeout)。
    • Data URI 無效:base64 字串格式有誤。
    • 內容被標記:輸入圖像被 NSFW 或智慧財產權 moderation 標記。
  • Name
    401 - Unauthorized
    Description

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

  • Name
    402 - Payment Required
    Description

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

  • Name
    429 - Too Many Requests
    Description

    你已超出速率限制。

Request

POST
/openapi/creative-lab/vinyl-figure/v1/prototype
# Stage 1: generate a vinyl-figure-style concept image
curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "image_url": "<your publicly accessible image url or base64-encoded data URI>"
  }'

Response

{
  "result": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de"
}
Prototype example
Start with a source photo, then generate the prototype image used by the build stage.
Source photo used as the Creative Lab Vinyl Figure input
Prototype input
Big-head vinyl figure prototype image generated from the source photo
Prototype output

POST/openapi/creative-lab/vinyl-figure/v1/build

建立 Vinyl Figure 建置任務

從一個成功的原型任務生成最終的帶貼圖 3D vinyl figure。建置過程運行與 影象生成 3D 相同的圖像到 3D 流水線,因此回應物件格式和輸出 URL 列表完全一致。回應結構請參閱 Vinyl Figure 建置任務物件

參數

  • Name
    input_task_id
    Type
    string
    必選
    Description

    透過同一 OpenAPI 端點建立的原型任務的任務 ID。該原型任務必須是使用相同的 API 金鑰建立的,必須已達到 SUCCEEDED 狀態,並且必須已生成恰好一張候選圖像。

    透過 webapp 建立的原型任務不被接受——建置端點僅接受由 POST /openapi/creative-lab/vinyl-figure/v1/prototype 生成的原型任務,其他來源一律回傳 404 拒絕。

  • Name
    name
    Type
    string
    Description

    可選的任務名稱,用於展示。最多 100 個字元。

回傳值

回應中的 result 屬性包含新建立的 vinyl figure 建置任務的 id。輪詢 取得任務 端點或訂閱 串流介面,直到任務達到 SUCCEEDED 狀態,然後從 model_urls.glb 下載帶貼圖的 GLB(如果你的下游流水線更傾向於使用 OBJ,也可以從 model_urls.objmodel_urls.mtl 下載 OBJ + MTL 組合)。

失敗模式

  • Name
    400 - Bad Request
    Description

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

    • 缺少參數input_task_id 是必需的。
    • 無效 UUIDinput_task_id 不是有效的 UUID。
    • 父任務未成功:引用的原型任務尚未達到 SUCCEEDED 狀態。
    • 沒有候選圖像:原型任務已成功,但未生成候選圖像。
  • Name
    401 - Unauthorized
    Description

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

  • Name
    402 - Payment Required
    Description

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

  • Name
    404 - Not Found
    Description

    引用的原型任務不存在、屬於其他使用者,或是透過 webapp 建立的(只有 API 模式下建立的原型任務才能連結到建置任務)。

  • Name
    429 - Too Many Requests
    Description

    你已超出速率限制。

Request

POST
/openapi/creative-lab/vinyl-figure/v1/build
# Stage 2: chain build off a succeeded prototype task
curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "input_task_id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de"
  }'

Response

{
  "result": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef"
}

GET/openapi/creative-lab/vinyl-figure/v1/(prototype|build)/:id

獲取盲盒手辦任務

根據有效的任務 id 獲取一個原型或構建任務。URL 路徑 必須與任務所處的階段相符——透過 /prototype/:id 獲取構建任務會回傳 404,反之亦然。

有關回應結構,請參閱盲盒手辦原型任務物件盲盒手辦構建任務物件

參數

  • Name
    id
    Type
    path
    Description

    要獲取的盲盒手辦任務的唯一識別碼。

回傳值

回應包含盲盒手辦任務物件。其結構取決於 所請求的具體階段。

Request

GET
/openapi/creative-lab/vinyl-figure/v1/prototype/019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de
# Prototype
curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype/019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

# Build
curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Prototype Response

{
  "id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de",
  "type": "creative-lab-vinyl-figure-prototype",
  "name": "",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1752969600000,
  "started_at": 1752969604000,
  "finished_at": 1752969630000,
  "expires_at": 1753228830000,
  "preceding_tasks": 0,
  "task_error": null,
  "consumed_credits": 6,
  "image_urls": [
    "https://assets.meshy.ai/***/concept.png?Expires=***"
  ]
}

Build Response

{
  "id": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef",
  "type": "creative-lab-vinyl-figure-build",
  "name": "",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1752969700000,
  "started_at": 1752969710000,
  "finished_at": 1752969735000,
  "expires_at": 1753228935000,
  "preceding_tasks": 0,
  "task_error": null,
  "consumed_credits": 30,
  "prompt": "",
  "negative_prompt": "",
  "texture_prompt": "",
  "texture_image_url": "",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.glb?Expires=***",
    "obj": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.obj?Expires=***",
    "mtl": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.mtl?Expires=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/preview.png?Expires=***",
  "texture_urls": [
    {
      "base_color": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/texture_0.png?Expires=***"
    }
  ]
}

DELETE/openapi/creative-lab/vinyl-figure/v1/(prototype|build)/:id

刪除一個 Vinyl Figure 任務

取消一個 vinyl figure 任務。如果任務仍處於 PENDING 狀態,建立時消耗的積分將被退還。已處於 IN_PROGRESS 狀態的任務會被取消,但不會退款(因為工作程序可能已經在消耗資源)。已經到達終止狀態 (SUCCEEDEDFAILEDCANCELED)的任務無法被取消。

URL 路徑必須與任務所處的階段相匹配 —— 對 /prototype/:buildId 執行 DELETE 將返回 404

路徑參數

  • Name
    id
    Type
    path
    Description

    要取消的 vinyl figure 任務的唯一識別碼。

返回值

成功時返回 204 No Content,回應內容為空。

失敗情況

  • Name
    400 - Bad Request
    Description

    該任務已處於終止狀態,無法取消。

  • Name
    404 - Not Found
    Description

    該任務不存在、屬於其他使用者,或其所處階段與 URL 路徑不匹配。

Request

DELETE
/openapi/creative-lab/vinyl-figure/v1/prototype/019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de
curl --request DELETE \
  --url https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype/019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

// Returns 204 No Content on success (empty body).

GET/openapi/creative-lab/vinyl-figure/v1/(prototype|build)/:id/stream

流式取得手辦玩偶任務

透過 Server-Sent Events(SSE)以串流方式取得手辦玩偶任務的即時更新。URL 路徑必須與任務所處的階段相符——在 /prototype/:buildId/stream 上開啟串流會發出一則 status_code: 404event: error 資料包,並隨即關閉該串流。

參數

  • Name
    id
    Type
    path
    Description

    要進行串流取得的手辦玩偶任務的唯一識別碼。

回傳

以 Server-Sent Events 的形式回傳一個由 手辦玩偶原型手辦玩偶成品 任務物件組成的串流。 對於 PENDINGIN_PROGRESS 狀態的任務,回應串流中將只包含必要的 progressstatus 欄位。

Request

GET
/openapi/creative-lab/vinyl-figure/v1/build/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/stream
curl -N https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/stream \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response Stream

// Error event example (wrong stage or task not found)
event: error
data: {
  "status_code": 404,
  "message": "Task not found"
}

// Message event examples illustrate task progress.
// For PENDING or IN_PROGRESS tasks, the response stream will not include all fields.
event: message
data: {
  "id": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef",
  "type": "creative-lab-vinyl-figure-build",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1752969700000,
  "started_at": 1752969710000,
  "finished_at": 1752969735000,
  "expires_at": 1753228935000,
  "task_error": null,
  "consumed_credits": 30,
  "prompt": "",
  "negative_prompt": "",
  "texture_prompt": "",
  "texture_image_url": "",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.glb?Expires=***",
    "obj": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.obj?Expires=***",
    "mtl": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.mtl?Expires=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/preview.png?Expires=***",
  "texture_urls": [
    {
      "base_color": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/texture_0.png?Expires=***"
    }
  ]
}

GET/openapi/creative-lab/vinyl-figure/v1/(prototype|build)

列出 Vinyl Figure 任務

取得單一階段中你的 vinyl figure 任務的分頁清單。 URL 路徑決定階段——/prototype 回傳原型(prototype)任務; /build 回傳構建(build)任務。另一階段的任務不會包含在任一回應中。

路徑參數

  • Name
    stage
    Type
    path
    必選
    Description

    prototypebuild 之一。此集合僅回傳階段與 URL 相符的任務——請求 /prototype 永遠不會回傳 build 任務,反之亦然。

查詢參數

  • Name
    page_num
    Type
    integer
    預設值 1
    Description

    用於分頁的頁碼。

  • Name
    page_size
    Type
    integer
    預設值 10
    Description

    每頁數量上限。最大允許值為 50 項。

  • Name
    sort_by
    Type
    string
    預設值 -created_at
    Description

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

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

回傳值

回傳對應階段任務物件的分頁清單——列出 /prototype 時回傳 vinyl figure 原型任務物件, 列出 /build 時回傳 vinyl figure 構建任務物件

Request

GET
/openapi/creative-lab/vinyl-figure/v1/prototype
# List prototype tasks
curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/prototype?page_size=10 \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

# List build tasks
curl https://api.meshy.ai/openapi/creative-lab/vinyl-figure/v1/build?page_size=10 \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response (List Prototype Tasks)

[
  {
    "id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de",
    "type": "creative-lab-vinyl-figure-prototype",
    "name": "",
    "status": "SUCCEEDED",
    "progress": 100,
    "created_at": 1752969600000,
    "started_at": 1752969604000,
    "finished_at": 1752969630000,
    "expires_at": 1753228830000,
    "preceding_tasks": 0,
    "task_error": null,
    "consumed_credits": 6,
    "image_urls": [
      "https://assets.meshy.ai/***/concept.png?Expires=***"
    ]
  }
]

The Vinyl Figure Prototype Task Object

Vinyl Figure Prototype Task 物件是 Meshy 用於追蹤根據來源照片生成乙烯基手辦風格**概念圖(concept image)**這一工作單元的任務物件。此階段的輸出會透過 input_task_id 連結到建構階段

屬性

  • Name
    id
    Type
    string
    Description

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

  • Name
    type
    Type
    string
    Description

    任務的類型。其值為 creative-lab-vinyl-figure-prototype

  • Name
    name
    Type
    string
    Description

    建立任務時提供的任務名稱。如果未提供名稱,則為空字串。

  • Name
    status
    Type
    string
    Description

    任務的狀態。可能的值為 PENDINGIN_PROGRESSSUCCEEDEDFAILEDCANCELED 中的一種。

  • Name
    progress
    Type
    integer
    Description

    任務的 progress。如果任務尚未開始,此屬性為 0。任務成功完成後,此值將變為 100

  • Name
    created_at
    Type
    timestamp
    Description

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

  • Name
    started_at
    Type
    timestamp
    Description

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

  • Name
    finished_at
    Type
    timestamp
    Description

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

  • Name
    expires_at
    Type
    timestamp
    Description

    任務結果過期時的時間戳,以毫秒為單位。

  • Name
    preceding_tasks
    Type
    integer
    Description

    排在前面的任務數量。

  • Name
    task_error
    Type
    object
    Description

    失敗任務的錯誤詳情。有關完整的 task_error 物件說明,請參見 錯誤

  • Name
    consumed_credits
    Type
    integer
    Description

    此任務消耗的 consumed_credits 數量。當任務狀態為 PENDINGIN_PROGRESSSUCCEEDED 時會出現該欄位。對於 FAILED 任務則回傳 0(失敗時會退還積分)。

  • Name
    image_urls
    Type
    array of strings
    Description

    此原型任務生成的概念圖候選圖片的可下載 URL。目前 API 始終僅回傳一個候選圖片;該欄位設計為陣列,以便未來版本可以在不產生破壞性變更的情況下提供多個候選圖片。

Example Vinyl Figure Prototype Task Object

{
  "id": "019c8a2e-4b7d-7c3a-8d21-3f2987a1c4de",
  "type": "creative-lab-vinyl-figure-prototype",
  "name": "",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1752969600000,
  "started_at": 1752969604000,
  "finished_at": 1752969630000,
  "expires_at": 1753228830000,
  "preceding_tasks": 0,
  "task_error": null,
  "consumed_credits": 6,
  "image_urls": [
    "https://assets.meshy.ai/***/concept.png?Expires=***"
  ]
}

Q 版手辦模型構建任務物件

Q 版手辦模型構建任務物件是 Meshy 追蹤的一個工作單元,用於從成功的原型任務生成帶貼圖的 3D Q 版手辦模型。它運行的是與 Image to 3D 相同的圖生 3D 流水線,因此輸出欄位與該 endpoint 的任務物件保持一致。

屬性

  • Name
    id
    Type
    string
    Description

    任務的唯一識別碼。

  • Name
    type
    Type
    string
    Description

    任務的類型。取值為 creative-lab-vinyl-figure-build

  • Name
    name
    Type
    string
    Description

    建立任務時提供的任務名稱。如果未提供名稱,則為空字串。

  • Name
    status
    Type
    string
    Description

    任務的狀態。可能的值為 PENDINGIN_PROGRESSSUCCEEDEDFAILEDCANCELED 之一。

  • Name
    progress
    Type
    integer
    Description

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

  • Name
    created_at
    Type
    timestamp
    Description

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

  • Name
    started_at
    Type
    timestamp
    Description

    任務開始時的時間戳,單位為毫秒。

  • Name
    finished_at
    Type
    timestamp
    Description

    任務完成時的時間戳,單位為毫秒。

  • Name
    expires_at
    Type
    timestamp
    Description

    任務結果過期時的時間戳,單位為毫秒。

  • Name
    preceding_tasks
    Type
    integer
    Description

    排在此任務之前的任務數量。僅當狀態為 PENDING 時有意義。

  • Name
    task_error
    Type
    object
    Description

    失敗任務的錯誤詳情。有關完整的 task_error 物件參考,請參見 錯誤

  • Name
    consumed_credits
    Type
    integer
    Description

    此任務消耗的積分數量。對於 FAILED 任務,返回 0(失敗時會退還積分)。

  • Name
    prompt
    Type
    string
    Description

    Q 版手辦模型構建任務中始終為空。之所以保留此欄位,是為了與 Image to 3D 所使用的共用 V2ImageTo3DTaskResponse 結構保持跨 endpoint 相容。

  • Name
    negative_prompt
    Type
    string
    Description

    Q 版手辦模型構建任務中始終為空。保留此欄位是為了跨 endpoint 相容。

  • Name
    texture_prompt
    Type
    string
    Description

    Q 版手辦模型構建任務中始終為空。保留此欄位是為了跨 endpoint 相容。

  • Name
    texture_image_url
    Type
    string
    Description

    Q 版手辦模型構建任務中始終為空。保留此欄位是為了跨 endpoint 相容。

  • Name
    model_urls
    Type
    object
    Description

    生成的 3D 模型的可下載 URL。Q 版手辦模型構建任務會輸出一個帶貼圖的 GLB,以及供偏好 Wavefront OBJ 的流水線使用的 OBJ + MTL 檔案對。該欄位結構與 Image to 3D 的 model_urls 物件一致,因此未來新增格式時不會造成破壞性變更。

    • Name
      glb
      Type
      string
      Description

      帶貼圖的 GLB 檔案的可下載 URL。

    • Name
      obj
      Type
      string
      Description

      Wavefront OBJ 檔案(幾何體 + UV)的可下載 URL。

    • Name
      mtl
      Type
      string
      Description

      OBJ 配套的 MTL 材質檔案的可下載 URL。請與 obj 以及 texture_urls[0].base_color 中的條目配合使用。

  • Name
    thumbnail_url
    Type
    string
    Description

    模型檔案縮圖的可下載 URL。

  • Name
    texture_urls
    Type
    array
    Description

    此任務生成的貼圖 URL 物件陣列。目前僅包含一個帶有基礎色貼圖(base color map)的物件。

    • Name
      base_color
      Type
      string
      Description

      基礎色貼圖圖像的可下載 URL。

Example Vinyl Figure Build Task Object

{
  "id": "019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef",
  "type": "creative-lab-vinyl-figure-build",
  "name": "",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1752969700000,
  "started_at": 1752969710000,
  "finished_at": 1752969735000,
  "expires_at": 1753228935000,
  "preceding_tasks": 0,
  "task_error": null,
  "consumed_credits": 30,
  "prompt": "",
  "negative_prompt": "",
  "texture_prompt": "",
  "texture_image_url": "",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.glb?Expires=***",
    "obj": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.obj?Expires=***",
    "mtl": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/model.mtl?Expires=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/preview.png?Expires=***",
  "texture_urls": [
    {
      "base_color": "https://assets.meshy.ai/***/tasks/019c8a31-6e2f-7b4d-9a55-4c3098b2d5ef/output/texture_0.png?Expires=***"
    }
  ]
}