Image to 3D API
影象生成 3D API 是一項功能,可讓您將 Meshy 的影象生成 3D 能力整合到您自己的應用程式中。在本節中,您將找到開始使用此 API 所需的全部資訊。
Create an Image to 3D Task
此 endpoint 允許您建立一個新的 Image to 3D 任務。請參閱 The Image to 3D Task Object 以瞭解 Image to 3D 任務物件包含哪些屬性。
該任務在背景執行。有關通常所需時間,請參閱 Processing Times。
參數
input_task_id 或 image_url 中只需提供一個,為必填項。如果兩者都提供,則以 input_task_id 為準。
- Name
- input_task_id
- Type
- string
- 必選
- Description
一個已完成的影像生成任務的 ID,該任務的輸出將用作輸入影像。此任務必須是以下任務之一:文字生成影像或影像生成影像。此外,它必須是透過 API 執行的,狀態為
SUCCEEDED,並且只生成一張影像。
- Name
- image_url
- Type
- string
- 必選
- Description
提供一張影像供 Meshy 用於模型建立。我們目前支援
.jpg、.jpeg、.png和.webp格式。最大檔案大小:20 MB。
有兩種方式提供影像:
- 可公開存取的 URL:可從公共網際網路存取的 URL。
- Data URI:影像的 base64 編碼資料 URI。資料 URI 範例:
data:image/jpeg;base64,<your base64-encoded image data>。
- Name
- model_type
- Type
- string
- 預設值 standard
- Description
指定 3D 網格生成的類型。
可用值:
standard:常規高細節 3D 網格生成。smart-topology:透過ai_model(meshy-t2)選擇 Smart Topology 模型。lowpoly(已 deprecated,將於 2026 年 10 月 30 日 停用):生成針對更簡潔多邊形最佳化的 low-poly 網格。我們建議改用 Meshy T2:搭配meshy-t2使用smart-topology。
選擇
smart-topology時,should_remesh、save_pre_remeshed_model和decimation_mode將被忽略,並且僅接受topology: triangle。lowpoly將於 2026 年 10 月 30 日 停用。在該日期之後,使用model_type: "lowpoly"的請求將返回錯誤。我們建議改用 Meshy T2(model_type: "smart-topology"搭配ai_model: "meshy-t2")。選擇lowpoly時,ai_model、topology、target_polycount、should_remesh和save_pre_remeshed_model將被忽略。
- Name
- ai_model
- Type
- string
- 預設值 latest
- Description
要使用的模型 ID。可用值取決於
model_type。標準生成(
model_type: standard):meshy-6-lite、meshy-6、meshy-7.1、latest(Meshy 7.1)meshy-7(已 deprecated):請改用meshy-7.1。
Smart Topology 生成(
model_type: smart-topology):meshy-t2(預設):Smart Topology 模型 —— 更簡潔的 topology、原生分離的部件、三角形輸出,以及可透過target_polycount設定的面數。
- Name
- geometry_resolution
- Type
- string
- 預設值 standard
- Description
geometry 生成階段。
2k以 2048³ 執行 Ultra 階段;4k以 4096³ 執行, 以獲得最精細的表面細節。可用值:
standard、2k、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。將其設定為
false將跳過 texture 階段,生成不帶 texture 的 mesh。
should_texture = true- Name
- enable_pbr
- Type
- boolean
- 預設值 false
- Description
除基礎顏色外,還生成 PBR 貼圖(金屬度、粗糙度、法線)。當
ai_model為meshy-6時還會包含發光貼圖,但texture_resolution: 8k時除外。meshy-6-lite、meshy-7.1、meshy-t2和latest不會生成發光貼圖。
- Name
- texture_resolution
- Type
- string
- 預設值 2k
- Description
基礎顏色 texture 的解析度。可選
2k(2048×2048)、4k(4096×4096)或8k(8192×8192)。解析度越高,捕捉到的表面細節越多。4k和8k不適用於ai_model為meshy-6-lite的情況。在8k時,不會生成發光貼圖。
- Name
- hd_texture
- Type
- boolean
- ⚠ 已棄用
- 預設值 false
- Description
請改用
texture_resolution—— 等同於texture_resolution: "4k"。當兩者都設定時,以texture_resolution為準。
- Name
- texture_prompt
- Type
- string
- Description
提供一個文字 prompt 來指導紋理化過程。最多 800 個字元。
- Name
- texture_image_url
- Type
- string
- Description
提供一張 2D 影像來指導紋理化過程。我們目前支援
.jpg、.jpeg、.png和.webp格式。最大檔案大小:20 MB。
有兩種方式提供影像:
- 可公開存取的 URL:可從公共網際網路存取的 URL
- Data URI:影像的 base64 編碼資料 URI。資料 URI 範例:
data:image/jpeg;base64,<your base64-encoded image data>
如果原始 asset 與上傳影像之間存在較大的 geometry 差異,影像紋理化可能無法達到最佳效果。
texture_image_url或texture_prompt只能使用其中一個來指導紋理化過程。如果兩個 參數 都提供,則預設使用texture_prompt對模型進行紋理化。無論透過文字還是影像進行紋理化,每個任務都將花費 10 credits。
- Name
- should_remesh
- Type
- boolean
- 預設值 false (Meshy 6 and Meshy 7 models), true (others)
- Description
控制是否啟用 remesh 階段。為獲得最高品質的模型,我們建議將
should_remesh設定為false。
should_remesh = true- Name
- topology
- Type
- string
- 預設值 triangle
- Description
指定生成模型的 topology。
可用值:
quad:生成以四邊形為主的 mesh。triangle:生成經過 decimation 的三角形 mesh。
Smart Topology 的輸出僅為三角形。將
quad與ai_model: meshy-t2一起請求將返回錯誤。
- Name
- decimation_mode
- Type
- integer
- Description
透過設定 polycount 等級來啟用自適應 decimation。設定後,
target_polycount將被忽略。可用值:
1:自適應 —— 超高 polycount。2:自適應 —— 高 polycount。3:自適應 —— 中等 polycount。4:自適應 —— 低 polycount。
- Name
- save_pre_remeshed_model
- Type
- boolean
- 預設值 false
- Description
設定為
true時,Meshy 還會在 remesh 階段完成之前儲存一個額外的 GLB 檔案。
- Name
- target_polycount
- Type
- integer
- Description
輸出中目標多邊形(面)數量。實際數量可能因 geometry 而與目標值有所偏差。
target_polycount在兩種獨立情況下生效:- Remesh —— 在
standard模型上設定should_remesh: true。mesh 將被重新網格化(decimation)至約該數量。範圍為 100 到 300,000,預設為 30,000。如果設定了decimation_mode,則以其為準,target_polycount將被忽略。 - Smart Topology —— 設定
model_type: smart-topology和ai_model: meshy-t2。模型將直接以該面數生成;不會執行 remesh,也不需要should_remesh。範圍為 100 到 15,000,預設為 4,000。
- Remesh —— 在
- Name
- symmetry_mode
- Type
- string
- ⚠ 已棄用
- 預設值 auto
- Description
已 deprecated。此 參數 不再影響輸出。
symmetry_mode欄位控制模型生成過程中的 symmetry 行為。有效值為:
off:停用 symmetry。auto:根據輸入 geometry 自動判定並套用 symmetry。on:在生成過程中強制使用 symmetry。
- Name
- pose_mode
- Type
- string
- 預設值 ""
- Description
指定生成模型的姿勢模式。
可用值:
a-pose:以 A 字形姿勢生成模型。t-pose:以 T 字形姿勢生成模型。""(空字串):不套用特定姿勢。
- 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可保留輸入影像的確切外觀,不進行任何風格處理。僅在
ai_model為meshy-6、meshy-7.1或latest時支援。與meshy-6-lite或model_type: smart-topology一起設定將返回錯誤。
- Name
- remove_lighting
- Type
- boolean
- 預設值 true
- Description
從基礎顏色 texture 中去除高光和陰影,生成更乾淨的結果,在自訂光照設定下效果更佳。
僅在
ai_model為meshy-6時生效。meshy-7.1和latest接受該 參數 但會忽略它。與meshy-6-lite或model_type: smart-topology一起設定將返回錯誤。
- Name
- moderation
- Type
- boolean
- 預設值 false
- Description
設定為
true時,將自動對輸入內容進行潛在有害內容的篩查。如果偵測到有害內容,任務將不會進入生成階段。將對來自
image_url、texture_image_url和texture_prompt輸入的內容進行篩查。
- Name
- target_formats
- Type
- string[]
- Description
指定輸出中應包含哪些 3D 檔案格式。只會生成並返回所請求的格式,這可以縮短任務完成時間。省略時,將包含所有支援的格式。
可用值:
glb、obj、fbx、stl、usdz、3mf省略時,將生成除
3mf之外的所有格式。只有明確指定時才會包含3mf。
- Name
- auto_size
- Type
- boolean
- 預設值 false
- Description
設定為
true時,服務會使用 AI 視覺自動估算物體的真實世界高度,並相應地調整模型大小。除非明確設定origin_at,否則 origin 將預設為bottom。
- Name
- alpha_thumbnail
- Type
- boolean
- 預設值 false
- Description
設定為
true時,任務會額外渲染一個透明背景(RGBA)版本的預覽圖,並在 GET 回應中以alpha_thumbnail_url返回。現有的thumbnail_url欄位保持不變。
- Name
- multi_view_thumbnails
- Type
- boolean
- 預設值 false
- Description
設定為
true時,任務會額外渲染四個基本方向的縮圖(正面、右側、背面、左側),並在 GET 回應中以thumbnail_urls返回。現有的thumbnail_url欄位保持不變,仍指向正面視圖,因此不影響現有客戶端。大約會增加 3 秒的任務延遲。
auto_size = true- Name
- origin_at
- Type
- string
- 預設值 bottom
- Description
啟用
auto_size時 origin 的位置。可用值:
bottom、center。
返回值
回應中的 result 屬性包含新建立的 Image to 3D 任務的任務 id。
失敗模式
- Name
400 - Bad Request- Description
請求無法被接受。常見原因:
- 缺少 參數:必須提供
image_url或input_task_id其中之一。 - 無效的輸入任務:
input_task_id必須引用一個狀態為SUCCEEDED且只生成一張影像的文字生成影像或影像生成影像任務。 - 無效的影像格式:提供的
image_url格式不受支援(.jpg、.jpeg、.png、.webp)。 - URL 無法存取:無法下載
image_url(404 或 timeout)。 - 影像過大:
image_url或texture_image_url影像超過 20 MB。 - 無效的 Data URI:base64 字串格式有誤。
- 無效的 參數 組合:
enable_pbr僅在should_texture為 true 時支援。 - low poly 不支援該模型:
ai_model: "meshy-6-lite"不支援model_type: "lowpoly"。 - Ultra 不支援該模型:
geometry_resolution需要meshy-7.1或latest。 - 影像選項不支援該模型:在
ai_model: "meshy-6-lite"或model_type: "smart-topology"下設定了image_enhancement或remove_lighting。
- 缺少 參數:必須提供
- Name
401 - Unauthorized- Description
身份驗證失敗。請檢查您的 API key。
- Name
402 - Payment Required- Description
credits 不足,無法執行此任務。
- Name
429 - Too Many Requests- Description
您已超出速率限制。
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"]
}'
Response
{
"result": "018a210d-8ba4-705c-b111-1f1776f7f578"
}
取得影象生成 3D 任務
此 endpoint 允許你透過有效的任務 id 取得一個影象生成 3D 任務。
請參閱 影象生成 3D 任務物件 以了解影象生成 3D 任務物件包含哪些屬性。
參數
- Name
- id
- Type
- path
- Description
要取得的影象生成 3D 任務的唯一識別碼。
回傳值
回應中包含影象生成 3D 任務物件。詳情請參閱 影象生成 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": {
"message": ""
},
"consumed_credits": 30
}
刪除 Image to 3D 任務
此 endpoint 將永久刪除一個 Image to 3D 任務,包括所有相關的模型和資料。此操作不可逆。
路徑參數
- Name
- id
- Type
- path
- Description
要刪除的 Image to 3D 任務的 ID。
任務狀態
仍處於 PENDING 狀態的任務將被刪除,並且建立時消耗的 credits 將被退還。
已處於 IN_PROGRESS 狀態的任務無法刪除:該請求會被拒絕並返回 409 Conflict,任務會繼續執行。worker 已經開始處理的任務所消耗的 credits 是不可退還的,因此在任務執行過程中將其刪除會讓你同時損失 credits 和結果。請等待任務進入
SUCCEEDED、FAILED 或 CANCELED 狀態後再刪除。
處於終止狀態(SUCCEEDED、FAILED 或 CANCELED)的任務將被刪除,且不會退還 credits。
返回值
成功時返回 200 OK;當任務處於 IN_PROGRESS 狀態時返回
409 Conflict。
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 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."
}
取得 Image to 3D 任務列表
此 端點 允許您取得 Image to 3D 任務列表。
參數
可選屬性
- Name
- page_num
- Type
- integer
- Description
用於分頁的頁碼。起始值及預設值為
1。
- Name
- page_size
- Type
- integer
- Description
每頁數量限制。預設值為
10筆。最大允許值為100筆。
- Name
- sort_by
- Type
- string
- Description
用於排序的欄位。可用值:
+created_at:依建立時間升冪排序。-created_at:依建立時間降冪排序。
回傳
回傳一個分頁的 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": {
"message": ""
},
"consumed_credits": 30
}
]
流式取得 Image to 3D 任務
此 endpoint 透過 Server-Sent Events(SSE)為 Image to 3D 任務串流傳輸即時更新。
參數
- Name
- id
- Type
- path
- Description
要進行串流傳輸的 Image to 3D 任務的唯一識別碼。
回傳值
以 Server-Sent Events 的形式回傳 Image to 3D 任務物件 的串流。
對於 PENDING 或 IN_PROGRESS 狀態的任務,回應串流中只會包含必要的 progress 和 status 欄位。
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.
// For PENDING or IN_PROGRESS tasks, the response stream will not include all fields.
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": {
"message": ""
},
"consumed_credits": 30
}
The Image to 3D Task Object
Image to 3D 任務物件是 Meshy 用於追蹤從圖片輸入生成 3D 模型的工作單元。 該物件具有以下屬性:
Properties
- Name
- id
- Type
- string
- Description
任務的唯一識別碼。雖然我們在實作細節上使用 k-sortable UUID 作為任務 id,但你不應對 id 的格式做任何假設。
- Name
- type
- Type
- string
- Description
Image to 3D 任務的類型。該值為
image-to-3d。
- Name
- model_urls
- Type
- object
- Description
指向 Meshy 生成的帶紋理 3D 模型檔案的可下載 URL。如果某種格式未被生成,則該格式對應的屬性將被省略,而不是回傳空字串。
- Name
glb- Type
- string
- Description
指向 GLB 檔案的可下載 URL。
- Name
fbx- Type
- string
- Description
指向 FBX 檔案的可下載 URL。
- Name
obj- Type
- string
- Description
指向 OBJ 檔案的可下載 URL。
- Name
usdz- Type
- string
- Description
指向 USDZ 檔案的可下載 URL。
- Name
mtl- Type
- string
- Description
指向 MTL 檔案的可下載 URL,當存在 texture 時會隨 OBJ 匯出一同回傳。
- Name
stl- Type
- string
- Description
指向 STL 檔案的可下載 URL。
- Name
3mf- Type
- string
- Description
指向 3MF 檔案的可下載 URL。僅在透過
target_formats請求了3mf時才會出現。
- Name
pre_remeshed_glb- Type
- string
- Description
指向 remesh 之前的原始 GLB 輸出檔案的可下載 URL。
僅當任務建立時同時設定了
should_remesh: true和save_pre_remeshed_model: true時才可用。
- Name
- thumbnail_url
- Type
- string
- Description
指向模型檔案縮圖的可下載 URL。存在時等同於
thumbnail_urls.front,保留該欄位是為了向後相容。
- Name
- alpha_thumbnail_url
- Type
- string
- Description
指向
thumbnail_url的透明背景(RGBA)版本的可下載 URL。僅當任務建立時設定了alpha_thumbnail: true且透明預覽圖成功渲染時才會出現;否則該欄位將被省略。
- Name
- thumbnail_urls
- Type
- object
- Description
生成的 3D 模型在四個基本方位視角下的縮圖可下載 URL。每個值都是一個 512×512 PNG 圖片的簽名 URL,使用與
thumbnail_url相同的材質和光照渲染。適用於在批次處理流程中從多個角度預覽模型,而無需下載 GLB 檔案。僅當任務建立時設定了
multi_view_thumbnails: true且任務已達到SUCCEEDED狀態時才會出現。較舊的任務以及未啟用該選項建立的任務不會包含此欄位。- 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
用於指導貼圖過程的文字 prompt。
- Name
- texture_image_url
- Type
- string
- Description
指向用於指導貼圖過程的 texture 圖片的可下載 URL。
- Name
- ultra_mode
- Type
- boolean
- ⚠ 已棄用
- Description
已 deprecated;請改為讀取
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
任務開始時的時間戳,以毫秒為單位。如果任務尚未開始,該屬性值為
0。時間戳表示自 1970 年 1 月 1 日 UTC 以來經過的毫秒數,遵循 RFC 3339
標準。 例如,2023 年 9 月 1 日星期五 GMT 時間 12:00:00 PM 表示為1693569600000。這適用於 Meshy API 中的所有時間戳。
- Name
- created_at
- Type
- timestamp
- Description
任務建立時的時間戳,以毫秒為單位。
- Name
- expires_at
- Type
- timestamp
- Description
任務結果過期時的時間戳,以毫秒為單位。
- Name
- finished_at
- Type
- timestamp
- Description
任務完成時的時間戳,以毫秒為單位。如果任務尚未完成,該屬性值為
0。
- Name
- status
- Type
- string
- Description
任務的狀態。可能的值為
PENDING、IN_PROGRESS、SUCCEEDED、FAILED、CANCELED之一。
- Name
- texture_urls
- Type
- array
- Description
由該任務生成的 texture URL 物件陣列。通常該陣列僅包含一個 texture URL 物件。每個 texture URL 具有以下屬性:
- Name
base_color- Type
- string
- Description
指向基礎顏色貼圖圖片的可下載 URL。
- Name
metallic- Type
- string
- Description
指向金屬度貼圖圖片的可下載 URL。
如果任務建立時設定了
enable_pbr: false,則該屬性將被省略。
- Name
normal- Type
- string
- Description
指向法線貼圖圖片的可下載 URL。
如果任務建立時設定了
enable_pbr: false,則該屬性將被省略。
- Name
roughness- Type
- string
- Description
指向粗糙度貼圖圖片的可下載 URL。
如果任務建立時設定了
enable_pbr: false,則該屬性將被省略。
- Name
emission- Type
- string
- Description
指向自發光貼圖圖片的可下載 URL。
如果任務建立時設定了
enable_pbr: false,或ai_model為meshy-6-lite、meshy-7.1、meshy-t2或latest,則該屬性將被省略。
- Name
- preceding_tasks
- Type
- integer
- Description
排在前面的任務數量。
此欄位的值僅在任務狀態為
PENDING時才有意義。
- Name
- task_error
- Type
- object
- Description
失敗任務的錯誤詳情。完整的
task_error物件參考請見 錯誤。
- Name
- consumed_credits
- Type
- integer
- Description
該任務消耗的積分數量。當任務狀態為
PENDING、IN_PROGRESS或SUCCEEDED時會出現該欄位。對於FAILED的任務回傳0(失敗時積分會被退還)。
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": {
"message": ""
},
"consumed_credits": 30
}