Multi-Color Print API

I-convert ang mga 3D model sa multi-color 3MF format para sa 3D printing, na may nako-configure na color palette na hanggang 16 na kulay.


POST/openapi/v1/print/multi-color

Gumawa ng Multi-Color 3D Print Task

Ang endpoint na ito ay lumilikha ng bagong multi-color 3D print task. Ang task ay nagko-convert ng isang 3D model sa isang multi-color 3MF file na angkop para sa 3D printing.

Mga Parameter

  • Name
    model_url
    Type
    string
    Kinakailangan
    Description

    Pampublikong naa-access na URL o Data URI ng isang 3D model. Sa kasalukuyan, sinusuportahan namin ang mga format na .glb at .fbx.

  • Name
    max_colors
    Type
    integer
    default 4
    Description

    Pinakamataas na bilang ng mga kulay sa output palette.

    Valid na saklaw: 1 hanggang 16.

  • Name
    style
    Type
    string
    default realistic
    Description

    Visual na istilo ng kulay ng nalikhang 3MF file.

    Mga magagamit na halaga:

    • realistic: Kinukuha ang mga kulay direkta mula sa texture ng modelo para sa pinong, photo-realistic na detalye. Nagbubunga ng mas malaking file.
    • cartoon: Pinapantay ang mga kulay sa malinis, pantay na mga rehiyon para sa isang estilong hitsura. Nagbubunga ng mas maliit na file.

Mga Ibinabalik

Ang result na property ng tugon ay naglalaman ng id ng bagong nalikhang 3D print task.

Mga Paraan ng Pagkabigo

  • Name
    400 - Bad Request
    Description

    Ang kahilingan ay hindi katanggap-tanggap. Karaniwang mga sanhi:

    • Nawawalang parameter: Dapat ibigay ang alinman sa model_url o input_task_id.
    • Hindi wastong format ng modelo: Ang model_url ay tumutukoy sa isang file na may hindi suportadong extension (tanging .glb at .fbx lamang ang sinusuportahan).
    • Hindi maabot na URL: Ang model_url ay hindi ma-download.
    • Hindi wastong input task: Ang input_task_id ay dapat tumukoy sa isang matagumpay na task.
    • Hindi wastong max_colors: Ang halaga ay dapat nasa pagitan ng 1 at 16.
    • Hindi wastong style: Ang halaga ay dapat realistic o cartoon.
  • Name
    401 - Unauthorized
    Description

    Nabigo ang authentication. Pakisuri ang iyong API key.

  • Name
    402 - Payment Required
    Description

    Hindi sapat ang credits para isagawa ang task na ito.

  • Name
    429 - Too Many Requests
    Description

    Naabot mo na ang iyong rate limit.

Request

POST
/openapi/v1/print/multi-color
# Convert a 3D model to multi-color 3MF for printing
curl https://api.meshy.ai/openapi/v1/print/multi-color \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "max_colors": 8
  }'

Response

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

GET/openapi/v1/print/multi-color/:id

Kunin ang Multi-Color 3D Print Task

Ang endpoint na ito ay kumukuha ng multi-color 3D print task gamit ang ID nito.

Mga Parameter

  • Name
    id
    Type
    path
    Description

    Ang ID ng 3D print task na kukunin.

Mga Ibinabalik

Ang 3D Print Task object.

Request

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

Response

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "print-multi-color",
  "model_urls": {
      "3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***"
},
  "progress": 100,
  "status": "SUCCEEDED",
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": null,
"consumed_credits": 10
}

DELETE/openapi/v1/print/multi-color/:id

Tanggalin ang Multi-Color 3D Print Task

Ang endpoint na ito ay permanenteng nagtatanggal ng isang multi-color 3D print task, kasama ang lahat ng kaugnay na modelo at datos. Ang aksyong ito ay hindi na mababawi.

Mga Parameter ng Path

  • Name
    id
    Type
    path
    Description

    Ang ID ng multi-color 3D print task na tatanggalin.

Mga Ibinabalik

Nagbabalik ng 200 OK kapag matagumpay.

Request

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

Response

// Returns 200 Ok on success.

GET/openapi/v1/print/multi-color

Listahan ng Multi-Color 3D Print Tasks

Ang endpoint na ito ay nagbibigay-daan sa iyo na makuha ang listahan ng mga multi-color 3D print tasks.

Mga Parameter

Opsyonal na mga katangian

  • Name
    page_num
    Type
    integer
    Description

    Numero ng pahina para sa pagination. Nagsisimula at default sa 1.

  • Name
    page_size
    Type
    integer
    Description

    Limitasyon ng laki ng pahina. Default sa 10 na item. Ang maximum na pinapayagan ay 50 na item.

  • Name
    sort_by
    Type
    string
    Description

    Field na gagamitin para sa pag-aayos. Mga magagamit na halaga:

    • +created_at: Ayusin ayon sa oras ng paglikha sa pataas na pagkakasunod-sunod.
    • -created_at: Ayusin ayon sa oras ng paglikha sa pababang pagkakasunod-sunod.

Mga Ibinabalik

Nagbabalik ng isang paginated na listahan ng The 3D Print Task Objects.

Request

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

Response

[
  {
    "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
    "type": "print-multi-color",
    "model_urls": {
      "3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***"
    },
    "progress": 100,
    "status": "SUCCEEDED",
    "preceding_tasks": 0,
    "created_at": 1699999999000,
    "started_at": 1700000000000,
    "finished_at": 1700000001000,
    "task_error": null,
  "consumed_credits": 10
  }
]

GET/openapi/v1/print/multi-color/:id/stream

I-stream ang Multi-Color 3D Print Task

Ang endpoint na ito ay nag-i-stream ng real-time na updates para sa isang multi-color 3D print task gamit ang Server-Sent Events (SSE).

Mga Parameter

  • Name
    id
    Type
    path
    Description

    Natatanging identifier para sa multi-color 3D print task na i-stream.

Mga Ibinabalik

Nagbabalik ng stream ng The 3D Print Task Objects bilang Server-Sent Events.

Para sa mga PENDING o IN_PROGRESS na tasks, ang response stream ay maglalaman lamang ng kinakailangang progress at status fields.

Request

GET
/openapi/v1/print/multi-color/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream
curl -N https://api.meshy.ai/openapi/v1/print/multi-color/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.
// For PENDING or IN_PROGRESS tasks, the response stream will not include all fields.
event: message
data: {
  "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "a43b5c6d-7e8f-901a-234b-567c890d1e2f",
  "type": "print-multi-color",
  "model_urls": {
    "3mf": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/model.3mf?Expires=***"
  },
  "progress": 100,
  "status": "SUCCEEDED",
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": null,
"consumed_credits": 10
}

Ang 3D Print Task Object

  • Name
    id
    Type
    string
    Description

    Natatanging pagkakakilanlan para sa gawain. Habang gumagamit kami ng k-sortable UUID para sa mga task id bilang detalye ng implementasyon, hindi ka dapat gumawa ng anumang mga pagpapalagay tungkol sa format ng id.

  • Name
    type
    Type
    string
    Description

    Uri ng 3D Print task. Ang halaga ay print-multi-color.

  • Name
    model_urls
    Type
    object
    Description

    Downloadable URL sa 3D model file na ginawa ng Meshy. Ang property para sa isang format ay hindi isasama kung ang format ay hindi ginawa sa halip na magbalik ng walang laman na string.

    • Name
      3mf
      Type
      string
      Description

      Downloadable URL sa multi-color 3MF file.

  • Name
    progress
    Type
    integer
    Description

    Pag-unlad ng gawain. Kung ang gawain ay hindi pa nasisimulan, ang property na ito ay magiging 0. Kapag ang gawain ay nagtagumpay, ito ay magiging 100.

  • Name
    status
    Type
    string
    Description

    Katayuan ng gawain. Ang mga posibleng halaga ay isa sa PENDING, IN_PROGRESS, SUCCEEDED, FAILED.

  • Name
    preceding_tasks
    Type
    integer
    Description

    Ang bilang ng mga naunang gawain.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp kung kailan nilikha ang gawain, sa milliseconds.

  • Name
    started_at
    Type
    timestamp
    Description

    Timestamp kung kailan sinimulan ang gawain, sa milliseconds. Kung ang gawain ay hindi pa nasisimulan, ang property na ito ay magiging 0.

  • Name
    finished_at
    Type
    timestamp
    Description

    Timestamp kung kailan natapos ang gawain, sa milliseconds. Kung ang gawain ay hindi pa natatapos, ang property na ito ay magiging 0.

  • Name
    task_error
    Type
    object
    Description

    Mga detalye ng error para sa mga nabigong gawain. Tingnan ang Errors para sa buong task_error object reference.

  • Name
    consumed_credits
    Type
    integer
    Description

    Ang bilang ng credits na nagamit ng gawain na ito. Kasama kapag ang katayuan ng gawain ay PENDING, IN_PROGRESS, o SUCCEEDED. Nagbabalik ng 0 para sa mga FAILED na gawain (ang credits ay ibinabalik sa pagkabigo).

The 3D Print Task Object

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "print-multi-color",
  "model_urls": {
      "3mf": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.3mf?Expires=***"
},
  "progress": 100,
  "status": "SUCCEEDED",
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": null,
"consumed_credits": 10
}