影象生成 3D API
將圖像轉換為 3D 模型,可選擇是否帶貼圖,並可選擇所需的格式。傳送圖像,或使用文字生成影像或影像生成影像任務的輸出結果。
Create an Image to 3D task
建立一個 Image to 3D 任務。該任務會在背景執行。關於任務通常需要多長時間,請參閱處理時間。
Request
# Simple request with required params
curl https://api.meshy.ai/openapi/v1/image-to-3d \
-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>"
}'
# With Ultra 4K geometry, remesh, PBR, and A-pose
curl https://api.meshy.ai/openapi/v1/image-to-3d \
-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>",
"ai_model": "meshy-7.1",
"geometry_resolution": "4k",
"enable_pbr": true,
"should_remesh": true,
"target_polycount": 100000,
"should_texture": true,
"pose_mode": "a-pose",
"target_formats": ["glb"]
}'
# Textured with Meshy N1 from the input image
curl https://api.meshy.ai/openapi/v1/image-to-3d \
-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>",
"ai_model": "meshy-7.1",
"texture_model": "meshy-n1"
}'
Response
{
"result": "018a210d-8ba4-705c-b111-1f1776f7f578"
}
參數
- Name
- input_task_id
- Type
- string
- 必選
- Description
除非發送
image_url,否則必填。你想要用作輸入的 Text to Image 或 Image to Image 任務的 ID,該圖片將被使用。該任務必須是你透過 API 建立的、狀態為SUCCEEDED,且恰好產生了一張圖片的任務。
- Name
- image_url
- Type
- string
- 必選
- Description
除非發送
input_task_id,否則必填。要轉換為 3D 模型的圖片,可以是公開可存取的 URL,也可以是 base64 編碼的 data URI,例如data:image/jpeg;base64,<your base64-encoded image data>。如果兩者都發送,Meshy 會使用input_task_id。圖片必須是 JPG、JPEG、PNG 或 WebP 檔案,大小不超過 20 MB,每邊至少 32 像素,且總像素不超過 178,956,970(寬 × 高)。
- Name
- model_type
- Type
- string
- 預設值 standard
- Description
要產生的 3D mesh 類型。
可用值:
standard:高細節 meshsmart-topology:來自 Smart Topology 模型的 mesh,你可以透過ai_model(meshy-t2或meshy-t2.5)來選擇
使用
smart-topology時,Meshy 會忽略should_remesh、save_pre_remeshed_model和decimation_mode,並且只接受topology: triangle。
- Name
- ai_model
- Type
- string
- 預設值 latest
- Description
用於產生 3D 模型的 AI 模型。可用的值取決於
model_type。標準模型(
model_type: standard):latest:Meshy 7.1meshy-7.1meshy-6meshy-6-litemeshy-7(已棄用):請改用meshy-7.1。該模型將於 2026 年 12 月 31 日下線。
Smart Topology 模型(
model_type: smart-topology)產生三角形網格,面數可透過target_polycount設定:meshy-t2:更乾淨的 topology 以及原生分離的部件meshy-t2.5(預設):為遊戲 asset 提供更銳利的細節
請參閱模型,了解哪種模型適合你的專案,例如遊戲角色或 3D 列印模型。
- Name
- geometry_resolution
- Type
- string
- 預設值 standard
- Description
geometry 生成的處理階段。
可用值:
standard2k:以 2048³ 執行 Ultra 階段4k:以 4096³ 執行 Ultra 階段,以獲得最精細的表面細節
2k需要meshy-7.1、latest或已棄用的meshy-7。4k需要meshy-7.1或latest。
- Name
- ultra_mode
- Type
- boolean
- ⚠ 已棄用
- 預設值 false
- Description
請改用
geometry_resolution。ultra_mode: true與geometry_resolution: "2k"等效。
- Name
- should_texture
- Type
- boolean
- 預設值 true
- Description
是否產生 texture。
true會回傳帶 texture 的模型,false則跳過貼圖過程,回傳不帶 texture 的 mesh。
should_texture = true- Name
- texture_model
- Type
- string
- 預設值 depends on ai_model
- Description
在同一任務中為 3D 模型貼圖的 AI 模型。留空則使用與你所選
ai_model對應的預設 texture 模型。此設定不會改變 積分 消耗。可用值:
meshy-7:Meshy 7,帶有 PBR 貼圖,texture 最高可達 8Kmeshy-n1:Meshy N1,僅根據參考圖產生 2K 基礎色 texturemeshy-6-lite:Meshy 6 Lite,以最低成本產生 2K texturemeshy-6:Meshy 6,僅在ai_model: meshy-6時作為預設模型
每個
ai_model都接受meshy-7、meshy-n1和meshy-6-lite。如果請求的選項所選 texture 模型不支援,會回傳400。使用meshy-n1時,如果產生的模型超過 7,999,999 個三角面,任務會失敗,Meshy 會退還 積分。設定should_texture: false時,Meshy 會忽略texture_model,但未知的值仍會回傳400。請參閱模型,了解各個 texture 模型的功能以及如何選擇。
- Name
- enable_pbr
- Type
- boolean
- 預設值 false
- Description
除了基礎色之外,是否還產生 PBR 貼圖(金屬度、粗糙度和法線)。
true需要should_texture: true,若should_texture: false則回傳400。使用texture_model: meshy-n1時,設定true會回傳400。Meshy 6 texture 模型還會產生 emission 貼圖,但在
texture_resolution: 8k時除外。
- Name
- texture_resolution
- Type
- string
- 預設值 2k
- Description
基礎色 texture 的尺寸。更大的 texture 能捕捉更多表面細節。
可用值:
2k:2048×20484k:4096×40968k:8192×8192
4k和8k需要 Meshy 7 或 Meshy 6 texture 模型,其他模型使用這兩個值會回傳400。在8k下,Meshy 不會產生 emission 貼圖。
- Name
- hd_texture
- Type
- boolean
- ⚠ 已棄用
- 預設值 false
- Description
請改用
texture_resolution。hd_texture: true與texture_resolution: "4k"等效。如果兩者都發送,Meshy 會使用texture_resolution。
- Name
- texture_prompt
- Type
- string
- Description
用於指導 texture 產生的文字,最多 800 個字元。超出長度會回傳
400。使用texture_model: meshy-n1時,發送該參數會回傳400。
- Name
- texture_image_url
- Type
- string
- Description
用於指導 texture 的圖片,可以是公開可存取的 URL,也可以是 base64 編碼的 data URI,例如
data:image/jpeg;base64,<your base64-encoded image data>。圖片必須是 JPG、JPEG、PNG 或 WebP 檔案,大小不超過 20 MB,每邊至少 32 像素,且總像素不超過 178,956,970(寬 × 高)。Meshy 只會使用
texture_prompt和texture_image_url中的一個來指導 texture。如果兩者都發送,Meshy 會使用texture_prompt。關於貼圖的 積分 消耗,請參閱 Pricing。使用
texture_model: meshy-n1時,Meshy 會將該圖片作為正面視圖進行貼圖;如果留空,則使用輸入圖片。當圖片的形狀與 3D 模型的 geometry 差異較大時,基於圖片的貼圖效果可能不理想。
- Name
- should_remesh
- Type
- boolean
- 預設值 true (meshy-6-lite), false (other models)
- Description
是否執行 remesh 階段。若要獲得最高品質的 3D 模型,請將其設為
false。
should_remesh = true- Name
- topology
- Type
- string
- 預設值 triangle
- Description
重新生成 mesh 後的面類型。
可用值:
quad:以四邊形為主的 meshtriangle:經過精簡的三角形 mesh
Smart Topology 的輸出僅支援三角形,因此在
meshy-t2或meshy-t2.5下使用quad會回傳400。使用texture_model: meshy-n1時,如果模型進行了 remesh(meshy-6-lite預設會這樣做),quad會回傳400。
- Name
- decimation_mode
- Type
- integer
- Description
按等級自適應設定面數。當你設定了此項時,Meshy 會忽略
target_polycount。可用值:
1:ultra(極致)2:high(高)3:medium(中)4:low(低)
- Name
- save_pre_remeshed_model
- Type
- boolean
- 預設值 false
- Description
是否同時儲存 remesh 階段之前的模型的 GLB 檔案。Meshy 會在
model_urls.pre_remeshed_glb中回傳該檔案。
- Name
- target_polycount
- Type
- integer
- Description
目標面數。實際結果可能與目標值有所差異,具體取決於模型的 geometry。
此參數適用於兩種不同的情況:
- Remesh:當在
standard模型上should_remesh為true時,Meshy 會將 mesh 精簡至大約該數值。如果你設定了decimation_mode,Meshy 會使用它,並忽略target_polycount。 - Smart Topology:當
model_type為smart-topology,且ai_model為meshy-t2或meshy-t2.5時,Meshy 會以此面數產生模型。此時不會執行 remesh,你也不需要設定should_remesh。
取值範圍和預設值取決於具體情況:
情況 範圍 預設值 Remesh 100至30000030000meshy-t2100至150004000meshy-t2.5100至3000015000超出範圍的值會回傳
400。對於低多邊形遊戲 asset,建議使用 Smart Topology 模型,而不是對標準模型進行 remesh。請參閱模型。
- Remesh:當在
- Name
- symmetry_mode
- Type
- string
- ⚠ 已棄用
- 預設值 auto
- Description
請將此項留空,因為它不會影響輸出。此參數原本用於控制產生過程中的 symmetry:
off:無 symmetryauto:根據輸入 geometry 選擇 symmetryon:強制 symmetry
- Name
- pose_mode
- Type
- string
- Description
角色模型的姿態,
a-pose或t-pose。若要產生無姿態的模型,請不要設定pose_mode和is_a_t_pose。
- Name
- is_a_t_pose
- Type
- boolean
- ⚠ 已棄用
- 預設值 false
- Description
請改用
pose_mode。是否以 A 字形或 T 字形姿態產生模型。
- Name
- surface_mode
- Type
- string
- ⚠ 已棄用
- Description
請改用
ai_model。此參數不會影響輸出,因為它所選擇的模型生成方式已經下線。可接受的值為
organic和hard。其他任何值都會回傳400。
- Name
- image_enhancement
- Type
- boolean
- 預設值 true
- Description
是否在生成前對輸入圖片進行優化。
false會保留輸入圖片的原始外觀,不進行任何風格處理。此選項僅適用於
meshy-6、meshy-7.1或latest。使用meshy-6-lite或model_type: smart-topology時,會回傳400。
- Name
- remove_lighting
- Type
- boolean
- 預設值 true
- Description
是否從基礎色 texture 中去除高光和陰影。處理後的結果更乾淨,在你自己的燈光環境下效果更好。
此選項僅在使用 Meshy 6 texture 模型時生效,若所選 texture 模型不支援此項,設定為
true會回傳400。使用model_type: smart-topology,或使用ai_model: meshy-6-lite及其預設 texture 模型時,發送此參數會回傳400。
- Name
- moderation
- Type
- boolean
- 預設值 false
- Description
是否在生成前對以下輸入內容進行有害內容篩查:
image_urltexture_image_urltexture_prompt
如果 Meshy 偵測到有害內容,請求將回傳
400,且 Meshy 不會建立任務。
- Name
- target_formats
- Type
- string[]
- Description
要產生的檔案格式。Meshy 只會產生並回傳你所列出的格式,這可以縮短任務耗時。如果留空,Meshy 會產生除
3mf之外的所有格式;只有當你明確列出3mf時,才會產生該格式。可用值:
glbobjfbxstlusdz3mf
- Name
- auto_size
- Type
- boolean
- 預設值 false
- Description
是否使用 AI 視覺估算物體的真實世界高度,並據此調整模型尺寸。除非你設定了
origin_at,否則 Meshy 會將 origin 放置在底部。
- Name
- alpha_thumbnail
- Type
- boolean
- 預設值 false
- Description
是否同時渲染一張帶透明背景(RGBA)的預覽圖,在取得任務時會在
alpha_thumbnail_url中回傳。thumbnail_url不會改變。
- Name
- multi_view_thumbnails
- Type
- boolean
- 預設值 false
- Description
是否同時渲染前、右、後、左四個視角的預覽圖,在取得任務時會在
thumbnail_urls中回傳。thumbnail_url不會改變,仍然顯示正面視圖。此選項會使任務額外增加約 5 秒。
auto_size = true- Name
- origin_at
- Type
- string
- 預設值 bottom
- Description
模型 origin 的放置位置,
bottom或center。
回傳值
回應中的 result 欄位保存了新建 Image to 3D 任務的 ID。
失敗情形
- Name
400 - Bad Request- Description
請求無法執行。錯誤訊息會說明具體發現了哪個問題。例如:
- 缺少參數:既未發送
image_url,也未發送input_task_id。 - 輸入任務無效:
input_task_id不是一個狀態為SUCCEEDED、且恰好產生了一張圖片的 Text to Image 或 Image to Image 任務。 - 圖片格式無效:
image_url指向的圖片不是 JPG、JPEG、PNG 或 WebP 檔案。 - URL 無法存取:Meshy 無法下載
image_url指向的圖片,因為該 URL 回傳404或逾時。 - 圖片過大:
image_url或texture_image_url指向的圖片超過 20 MB。 - 圖片尺寸無效:
image_url或texture_image_url指向的圖片有一邊小於 32 像素,或總像素超過 178,956,970(寬 × 高)。 - data URI 無效:base64 字串格式有誤。
- 參數組合無效:
enable_pbr為true,但should_texture為false。 - 不支援 Ultra 的模型:
geometry_resolution為2k或4k,但所選ai_model無法執行此功能。 - 不支援該圖片選項的模型:以下情況之一:
- 在
ai_model: "meshy-6-lite"或model_type: "smart-topology"下發送了image_enhancement。 - 在
model_type: "smart-topology"下,或在ai_model: "meshy-6-lite"及其預設 texture 模型下,發送了remove_lighting。
- 在
- texture 模型無效:
texture_model不是可用值之一。 - texture 模型不可用:
texture_model為meshy-6,但ai_model不是meshy-6。請發送meshy-7、meshy-n1或meshy-6-lite,或將其留空。 - texture 模型不支援該選項:請求中要求該 texture 模型執行其不支援的選項,例如在
meshy-n1下設定enable_pbr: true,或在meshy-6-lite下使用4ktexture。請參閱模型。
請修正請求後重新發送。參閱 Errors。
- 缺少參數:既未發送
- Name
401 - Unauthorized- Description
API 金鑰缺失或無效。請檢查
Authorization請求標頭。
- Name
402 - Payment Required- Description
例如:
- 積分不足:帳戶沒有足夠的 積分 來執行此任務,或帳戶已達到 積分 上限。請檢查你的 積分 餘額,然後重試。
- 免費方案:建立任務需要付費方案。請在訂閱設定中升級你的方案,然後重試。
- Name
403 - Forbidden- Description
內容審核攔截了該 prompt 或某張輸入圖片。請修改輸入內容後重試。
- Name
404 - Not Found- Description
input_task_id與你的任何任務都不符合。請檢查任務 ID,然後重新發送請求。
- Name
429 - Too Many Requests- Description
你已超出速率限制。請稍候後重試。參閱速率限制。
取得 Image to 3D 任務
根據 ID 返回一個 Image to 3D 任務。
Request
curl https://api.meshy.ai/openapi/v1/image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***",
"fbx": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***",
"obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***",
"usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***",
"stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***",
"pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
"thumbnail_urls": {
"front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***",
"right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***",
"back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***",
"left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***"
},
"texture_prompt": "",
"progress": 100,
"started_at": 1692771667037,
"created_at": 1692771650657,
"expires_at": 1692771679037,
"finished_at": 1692771669037,
"status": "SUCCEEDED",
"texture_urls": [
{
"base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
"metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX",
"normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX",
"roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX",
"emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX"
}
],
"preceding_tasks": 0,
"task_error": null,
"consumed_credits": 30
}
刪除影象生成 3D 任務
永久刪除一個影象生成 3D 任務,包括它的模型和資料。刪除操作無法復原。
Request
curl --request DELETE \
--url https://api.meshy.ai/openapi/v1/image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \
-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 keeps 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."
}
路徑參數
- Name
- id
- Type
- path
- Description
要刪除的任務的 ID。
任務狀態
刪除一個處於 PENDING 狀態的任務,會退還建立該任務時所消耗的積分。
IN_PROGRESS 狀態的任務無法被刪除。請求會回傳 409 Conflict,
任務會繼續執行。Meshy 不會為已經開始的任務退款,
因此刪除它會讓你同時損失積分和結果。請等待它
進入 SUCCEEDED、FAILED 或 CANCELED 狀態後再刪除。
刪除處於最終狀態(SUCCEEDED、FAILED 或 CANCELED)的任務
不會退還其積分。
回傳值
任務刪除成功時回傳 200 OK;當任務處於
IN_PROGRESS 狀態時回傳 409 Conflict。
列出 Image to 3D 任務
返回您的 Image to 3D 任務列表。
Request
curl https://api.meshy.ai/openapi/v1/image-to-3d?page_size=10 \
-H "Authorization: Bearer ${YOUR_API_KEY}"
Response
[
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***",
"fbx": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***",
"obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***",
"usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***",
"pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
"thumbnail_urls": {
"front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***",
"right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***",
"back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***",
"left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***"
},
"texture_prompt": "",
"progress": 100,
"started_at": 1692771667037,
"created_at": 1692771650657,
"expires_at": 1692771679037,
"finished_at": 1692771669037,
"status": "SUCCEEDED",
"texture_urls": [
{
"base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
"metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX",
"normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX",
"roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX",
"emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX"
}
],
"preceding_tasks": 0,
"task_error": null,
"consumed_credits": 30
}
]
參數
- Name
- page_num
- Type
- integer
- 預設值 1
- Description
要返回的頁碼,最大為
255。更大的值將返回400。
- Name
- page_size
- Type
- integer
- 預設值 10
- Description
每頁的任務數量,最大為
100。
- Name
- sort_by
- Type
- string
- Description
排序方式。
可用值:
+created_at:最早優先-created_at:最新優先
返回值
分頁的 Image to 3D 任務物件列表。
流式取得 Image to 3D 任務
以伺服器發送事件(SSE)的形式,串流回傳 Image to 3D 任務的更新。
Request
curl -N https://api.meshy.ai/openapi/v1/image-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/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.
// These examples are shortened. Each event holds the full task object.
event: message
data: {
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"progress": 0,
"status": "PENDING"
}
event: message
data: {
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***",
"fbx": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***",
"obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***",
"usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***",
"stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***",
"pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
"thumbnail_urls": {
"front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***",
"right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***",
"back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***",
"left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***"
},
"texture_prompt": "",
"progress": 100,
"started_at": 1692771667037,
"created_at": 1692771650657,
"expires_at": 1692771679037,
"finished_at": 1692771669037,
"status": "SUCCEEDED",
"texture_urls": [
{
"base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
"metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX",
"normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX",
"roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX",
"emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX"
}
],
"preceding_tasks": 0,
"task_error": null,
"consumed_credits": 30
}
參數
- Name
- id
- Type
- path
- Description
建立回應中回傳的任務 ID。
回傳值
以伺服器發送事件的形式回傳的 Image to 3D 任務物件 串流。
每個事件都包含完整的任務物件,其結構與 Get 端點回傳的內容相同。當任務處於 PENDING 或 IN_PROGRESS 狀態時,其結果欄位尚無值。
Image to 3D 任務物件
一個 Image to 3D 任務物件描述了一次從影像生成 3D 模型的任務。它保存了任務的狀態、進度,以及任務成功後的模型檔案。
屬性
Example Image to 3D Task Object
{
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "image-to-3d",
"model_urls": {
"glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***",
"fbx": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***",
"obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***",
"usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***",
"stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***",
"pre_remeshed_glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/pre_remeshed_model.glb?Expires=***"
},
"thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
"thumbnail_urls": {
"front": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_front.png?Expires=***",
"right": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_right.png?Expires=***",
"back": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_back.png?Expires=***",
"left": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview_left.png?Expires=***"
},
"texture_prompt": "",
"texture_image_url": "",
"progress": 100,
"started_at": 1692771667037,
"created_at": 1692771650657,
"expires_at": 1692771679037,
"finished_at": 1692771669037,
"status": "SUCCEEDED",
"texture_urls": [
{
"base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***",
"metallic": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX",
"normal": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX",
"roughness": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX",
"emission": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX"
}
],
"preceding_tasks": 0,
"task_error": null,
"consumed_credits": 30
}
- Name
- id
- Type
- string
- Description
任務 ID。請將其視為一個不透明字串,不要依賴其格式。
- Name
- type
- Type
- string
- Description
任務類型,始終為
image-to-3d。
- Name
- model_urls
- Type
- object
- Description
生成的 3D 模型的下載連結,每種檔案格式對應一個。任務未生成的格式不會有對應的鍵,而不是空字串。
- Name
glb- Type
- string
- Description
GLB 檔案。
- Name
fbx- Type
- string
- Description
FBX 檔案。
- Name
obj- Type
- string
- Description
OBJ 檔案。
- Name
usdz- Type
- string
- Description
USDZ 檔案。
- Name
mtl- Type
- string
- Description
MTL 檔案,當模型帶有 texture 時會隨 OBJ 檔案一起返回。
- Name
stl- Type
- string
- Description
STL 檔案。
- Name
3mf- Type
- string
- Description
3MF 檔案。僅當
target_formats包含3mf時才會出現。
- Name
pre_remeshed_glb- Type
- string
- Description
Remesh 之前的 GLB 檔案。僅當你在建立任務時同時設定了
should_remesh: true和save_pre_remeshed_model: true時才會出現。
- Name
- thumbnail_url
- Type
- string
- Description
3D 模型預覽圖的下載連結。當存在
thumbnail_urls時,它與thumbnail_urls.front是同一張圖片。Meshy 保留此欄位是為了向後相容。
- Name
- alpha_thumbnail_url
- Type
- string
- Description
thumbnail_url的透明背景版本(RGBA)的下載連結。僅當你在建立任務時設定了alpha_thumbnail: true且 Meshy 渲染出了透明預覽圖時才會出現。
- Name
- thumbnail_urls
- Type
- object
- Description
從四個方向查看 3D 模型的預覽圖下載連結。每個值都是一個指向 512×512 PNG 圖片的簽名 URL,使用與
thumbnail_url相同的材質和光照渲染。你可以用它們從多個角度預覽模型,例如在批次處理流程中使用,而無需下載 GLB。僅當你在建立任務時設定了
multi_view_thumbnails: true且任務狀態已達到SUCCEEDED時才會出現。未設定multi_view_thumbnails: true建立的任務不包含此欄位。- Name
- front
- Type
- string
- Description
正面視圖,在垂直軸上角度為 0°。它與
thumbnail_url相同。
- Name
- right
- Type
- string
- Description
右側視圖,角度為 90°。
- Name
- back
- Type
- string
- Description
背面視圖,角度為 180°。
- Name
- left
- Type
- string
- Description
左側視圖,角度為 270°。
- Name
- texture_prompt
- Type
- string
- Description
用於指導 texture 生成的文字 prompt。
- Name
- texture_image_url
- Type
- string
- Description
用於指導 texture 生成的圖片的下載連結。
- Name
- ultra_mode
- Type
- boolean
- ⚠ 已棄用
- Description
請改用
geometry_resolution。
- Name
- geometry_resolution
- Type
- string
- Description
任務執行的 Ultra 檔位,
2k或4k。standard任務不包含此欄位。
- Name
- progress
- Type
- integer
- Description
任務完成的百分比。任務開始前為
0,成功後為100。
- Name
- started_at
- Type
- timestamp
- Description
任務開始的時間,單位為 Unix 毫秒。任務開始前為
0。
- Name
- created_at
- Type
- timestamp
- Description
任務建立的時間,單位為 Unix 毫秒。
- Name
- expires_at
- Type
- timestamp
- Description
任務結果過期的時間,單位為 Unix 毫秒。
- Name
- finished_at
- Type
- timestamp
- Description
任務結束的時間,單位為 Unix 毫秒。任務結束前為
0。
- Name
- status
- Type
- string
- Description
任務狀態,取值為
PENDING、IN_PROGRESS、SUCCEEDED、FAILED或CANCELED之一。
- Name
- texture_urls
- Type
- array
- Description
任務生成的 texture 貼圖,是一個物件陣列。它通常只包含一個物件,具有以下欄位:
- Name
base_color- Type
- string
- Description
基礎顏色貼圖的下載連結。
- Name
metallic- Type
- string
- Description
金屬度貼圖的下載連結。當你在建立任務時設定了
enable_pbr: false,此欄位不會出現。
- Name
normal- Type
- string
- Description
法線貼圖的下載連結。當你在建立任務時設定了
enable_pbr: false,此欄位不會出現。
- Name
roughness- Type
- string
- Description
粗糙度貼圖的下載連結。當你在建立任務時設定了
enable_pbr: false,此欄位不會出現。
- Name
emission- Type
- string
- Description
自發光貼圖的下載連結。只有當你在建立任務時同時滿足以下所有條件時,Meshy 才會包含此欄位:
ai_model: meshy-6,並使用其預設的 texture 模型enable_pbr: truetexture_resolution為2k或4k
- Name
- preceding_tasks
- Type
- integer
- Description
佇列中排在此任務之前的任務數量。該值僅在任務處於
PENDING狀態時才有意義。
- Name
- task_error
- Type
- object
- Description
任務失敗時的錯誤詳情。除非狀態為
FAILED,否則為null。參見 錯誤。
- Name
- consumed_credits
- Type
- integer
- Description
任務消耗的積分數量。當狀態為
PENDING、IN_PROGRESS或SUCCEEDED時會出現。對於FAILED的任務,該值為0,因為 Meshy 會在任務失敗時退還積分。