प्रिंट-योग्यता मरम्मत API

FDM प्रिंट-योग्यता के लिए 3D मॉडल की मरम्मत करें — नॉन-मैनिफोल्ड किनारे, डिजेनरेट फेस, छेद, और अन्य topology समस्याएँ ठीक करें ताकि मेश प्रिंट के लिए तैयार हो।


POST/openapi/v1/print/repair

प्रिंट-योग्यता मरम्मत कार्य बनाएँ

यह एंडपॉइंट एक नया repair-printability कार्य बनाता है। यह कार्य 3D मॉडल पर topology मरम्मत चलाता है और एक watertight, प्रिंट के लिए तैयार संस्करण लौटाता है।

आउटपुट फ़ॉर्मैट इनपुट फ़ॉर्मैट से मेल खाता है। यदि आप model_url के माध्यम से .stl सबमिट करते हैं, तो प्रतिक्रिया का model_urls.stl मरम्मत किया गया मेश रखेगा और अन्य फ़ॉर्मैट फ़ील्ड खाली होंगे। input_task_id पाथ हमेशा स्रोत कार्य का GLB पढ़ता है, इसलिए आउटपुट .glb होता है।

पैरामीटर

  • Name
    model_url
    Type
    string
    आवश्यक
    Description

    मरम्मत करने के लिए 3D मॉडल का URL। समर्थित फ़ॉर्मैट: .glb, .stl, .obj। अधिकतम फ़ाइल आकार: 100 MB। http, https, या data: URL का उपयोग करना चाहिए (data URLs एक्सटेंशन जाँचों को बायपास करते हैं)।

  • Name
    alpha_thumbnail
    Type
    boolean
    डिफ़ॉल्ट false
    Description

    जब true पर सेट किया जाता है, तो कार्य अतिरिक्त रूप से प्रीव्यू का transparent-background (RGBA) संस्करण रेंडर करता है और GET प्रतिक्रिया में इसे alpha_thumbnail_url के रूप में लौटाता है। मौजूदा thumbnail_url फ़ील्ड अपरिवर्तित रहता है।

रिटर्न

प्रतिक्रिया की result प्रॉपर्टी में नए बनाए गए repair-printability कार्य का id होता है।

विफलता मोड

  • Name
    400 - Bad Request
    Description

    अनुरोध स्वीकार्य नहीं था। सामान्य कारण:

    • अनुपस्थित पैरामीटर: न तो input_task_id और न ही model_url दिया गया था।
    • अमान्य UUID: input_task_id मान्य UUID नहीं है।
    • अमान्य मॉडल URL: model_url गलत ढंग से बना है, असमर्थित scheme का उपयोग करता है, या उसकी फ़ाइल एक्सटेंशन असमर्थित है।
    • मॉडल फ़ाइल बहुत बड़ी है: model_url body 100 MB से अधिक हो गई।
    • कार्य सफल नहीं हुआ: संदर्भित कार्य अभी भी pending है, progress में है, या failed है।
    • GLB अनुपस्थित: संदर्भित कार्य में मरम्मत करने के लिए कोई GLB एसेट नहीं है।
  • Name
    401 - Unauthorized
    Description

    प्रमाणीकरण विफल रहा। कृपया अपनी API की जाँचें।

  • Name
    402 - Payment Required
    Description

    सामान्य कारण:

    • मुफ़्त प्लान: कार्य निर्माण के लिए paid plan आवश्यक है। सब्सक्रिप्शन पेज पर अपग्रेड करें।
    • अपर्याप्त क्रेडिट: वर्कस्पेस क्रेडिट लिमिट पहुँच गई।
  • Name
    404 - Not Found
    Description

    संदर्भित कार्य मौजूद नहीं है या किसी अलग उपयोगकर्ता के स्वामित्व में है।

  • Name
    429 - Too Many Requests
    Description

    आपने अपनी pending-task quota या रेट लिमिट पार कर ली है।

Request

POST
/openapi/v1/print/repair
# Repair an existing task
curl https://api.meshy.ai/openapi/v1/print/repair \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578"
  }'

# Or repair a model URL directly
curl https://api.meshy.ai/openapi/v1/print/repair \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "model_url": "https://example.com/model.stl"
  }'

Response

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

GET/openapi/v1/print/repair/:id

प्रिंट-योग्यता मरम्मत टास्क प्राप्त करें

यह एंडपॉइंट किसी प्रिंट-योग्यता मरम्मत टास्क को उसकी ID द्वारा प्राप्त करता है।

पैरामीटर

  • Name
    id
    Type
    path
    Description

    प्राप्त करने के लिए प्रिंट-योग्यता मरम्मत टास्क की ID।

रिटर्न

प्रिंट-योग्यता मरम्मत टास्क ऑब्जेक्टmodel_urls ब्लॉक तब तक खाली रहता है जब तक टास्क SUCCEEDED तक नहीं पहुँचता। केवल इनपुट फ़ॉर्मैट से मेल खाने वाला model_urls फ़ील्ड पॉप्युलेट किया जाता है।

Request

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

Response

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "print-repair",
  "status": "SUCCEEDED",
  "progress": 100,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000030000,
  "expires_at": 1715725401000,
  "task_error": null,
  "model_urls": {
    "glb": "",
    "fbx": "",
    "obj": "",
    "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***",
    "usdz": "",
    "3mf": "",
    "mtl": ""
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
  "texture_urls": [],
  "consumed_credits": 10
}

DELETE/openapi/v1/print/repair/:id

प्रिंट-योग्यता मरम्मत कार्य हटाएं

यह एंडपॉइंट प्रिंट-योग्यता मरम्मत कार्य और उसके मरम्मत किए गए आउटपुट को स्थायी रूप से हटा देता है। यह कार्रवाई अपरिवर्तनीय है।

पाथ पैरामीटर

  • Name
    id
    Type
    path
    Description

    हटाने के लिए प्रिंट-योग्यता मरम्मत कार्य की ID।

रिटर्न

सफलता पर 200 OK लौटाता है।

Request

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

Response

// Returns 200 Ok on success.

GET/openapi/v1/print/repair

प्रिंट-योग्यता मरम्मत कार्यों की सूची बनाएं

यह एंडपॉइंट आपको प्रिंट-योग्यता मरम्मत कार्यों की सूची प्राप्त करने की अनुमति देता है।

पैरामीटर

वैकल्पिक एट्रिब्यूट

  • Name
    page_num
    Type
    integer
    Description

    पेजिनेशन के लिए पेज संख्या। 1 से शुरू होता है और डिफ़ॉल्ट भी 1 है।

  • Name
    page_size
    Type
    integer
    Description

    पेज आकार सीमा। डिफ़ॉल्ट 10 आइटम है। अधिकतम अनुमत 50 आइटम हैं।

  • Name
    sort_by
    Type
    string
    Description

    जिस फ़ील्ड के अनुसार सॉर्ट करना है। उपलब्ध मान:

    • +created_at: निर्माण समय के अनुसार आरोही क्रम में सॉर्ट करें।
    • -created_at: निर्माण समय के अनुसार अवरोही क्रम में सॉर्ट करें।

रिटर्न्स

प्रिंट-योग्यता मरम्मत कार्य ऑब्जेक्ट्स की पेजिनेटेड सूची लौटाता है।

Request

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

Response

[
  {
    "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
    "type": "print-repair",
    "status": "SUCCEEDED",
    "progress": 100,
    "preceding_tasks": 0,
    "created_at": 1699999999000,
    "started_at": 1700000000000,
    "finished_at": 1700000030000,
    "expires_at": 1715725401000,
    "task_error": null,
    "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
      "fbx": "",
      "obj": "",
      "stl": "",
      "usdz": "",
      "3mf": "",
      "mtl": ""
    },
    "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
    "texture_urls": [],
    "consumed_credits": 10
  }
]

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

प्रिंट-योग्यता मरम्मत टास्क स्ट्रीम करें

यह एंडपॉइंट Server-Sent Events (SSE) का उपयोग करके प्रिंट-योग्यता मरम्मत टास्क के लिए रीयल-टाइम अपडेट स्ट्रीम करता है।

पैरामीटर

  • Name
    id
    Type
    path
    Description

    स्ट्रीम किए जाने वाले प्रिंट-योग्यता मरम्मत टास्क के लिए विशिष्ट पहचानकर्ता।

रिटर्न

Server-Sent Events के रूप में प्रिंट-योग्यता मरम्मत टास्क ऑब्जेक्ट्स की एक स्ट्रीम लौटाता है।

PENDING या IN_PROGRESS टास्क के लिए, रिस्पॉन्स स्ट्रीम में केवल आवश्यक progress और status फ़ील्ड शामिल होंगे। model_urls ब्लॉक केवल तब भेजा जाता है जब टास्क SUCCEEDED तक पहुँचता है।

Request

GET
/openapi/v1/print/repair/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream
curl -N https://api.meshy.ai/openapi/v1/print/repair/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-repair",
  "status": "SUCCEEDED",
  "progress": 100,
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000030000,
  "expires_at": 1715725401000,
  "task_error": null,
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/model.glb?Expires=***",
    "fbx": "",
    "obj": "",
    "stl": "",
    "usdz": "",
    "3mf": "",
    "mtl": ""
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/a43b5c6d-7e8f-901a-234b-567c890d1e2f/output/preview.png?Expires=***",
  "texture_urls": [],
  "consumed_credits": 10
}

प्रिंट-योग्यता मरम्मत कार्य ऑब्जेक्ट

  • Name
    id
    Type
    string
    Description

    कार्य के लिए अद्वितीय पहचानकर्ता। हालांकि हम task ids के लिए implementation detail के रूप में k-sortable UUID का उपयोग करते हैं, आपको id के format के बारे में कोई भी अनुमान नहीं लगाना चाहिए।

  • Name
    type
    Type
    string
    Description

    repair-printability कार्य का प्रकार। मान print-repair है।

  • Name
    status
    Type
    string
    Description

    कार्य की स्थिति। संभावित मान PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED में से एक हैं।

  • Name
    progress
    Type
    integer
    Description

    कार्य का progress। यदि कार्य अभी शुरू नहीं हुआ है, तो यह property 0 होगी। कार्य सफल हो जाने के बाद, यह 100 हो जाएगी।

  • Name
    preceding_tasks
    Type
    integer
    Description

    पिछले कार्यों की संख्या।

  • Name
    created_at
    Type
    timestamp
    Description

    कार्य बनाए जाने का टाइमस्टैंप, मिलीसेकंड में।

  • Name
    started_at
    Type
    timestamp
    Description

    कार्य शुरू किए जाने का टाइमस्टैंप, मिलीसेकंड में। यदि कार्य अभी शुरू नहीं हुआ है, तो यह property 0 होगी।

  • Name
    finished_at
    Type
    timestamp
    Description

    कार्य समाप्त किए जाने का टाइमस्टैंप, मिलीसेकंड में। यदि कार्य अभी समाप्त नहीं हुआ है, तो यह property 0 होगी।

  • Name
    expires_at
    Type
    timestamp
    Description

    सिस्टम से कार्य परिणाम के समाप्त होने का टाइमस्टैंप, मिलीसेकंड में। यदि कार्य अभी समाप्त नहीं हुआ है तो 0

  • Name
    task_error
    Type
    object
    Description

    यदि कार्य विफल हुआ है तो एरर जानकारी। यदि कार्य विफल नहीं हुआ है तो यह property null है। अधिक विवरण के लिए एरर देखें।

    • Name
      message
      Type
      string
      Description

      क्या गलत हुआ, इसका वर्णन करने वाला एरर संदेश।

  • Name
    model_urls
    Type
    object
    Description

    मरम्मत किए गए 3D मॉडल के लिए डाउनलोड करने योग्य URLs। केवल इनपुट format से मेल खाने वाला field भरा जाता है; अन्य format fields खाली strings होते हैं।

    • Name
      glb
      Type
      string
      Description

      मरम्मत किए गए GLB के लिए डाउनलोड करने योग्य URL। जब इनपुट GLB था या जब input_task_id का उपयोग किया गया था, तब भरा जाता है।

    • Name
      fbx
      Type
      string
      Description

      FBX output के लिए आरक्षित। repair-printability कार्यों के लिए हमेशा एक खाली string।

    • Name
      obj
      Type
      string
      Description

      मरम्मत किए गए OBJ के लिए डाउनलोड करने योग्य URL। जब इनपुट OBJ upload था, तब भरा जाता है।

    • Name
      stl
      Type
      string
      Description

      मरम्मत किए गए STL के लिए डाउनलोड करने योग्य URL। जब इनपुट STL upload था, तब भरा जाता है।

    • Name
      usdz
      Type
      string
      Description

      USDZ output के लिए आरक्षित। repair-printability कार्यों के लिए हमेशा एक खाली string।

    • Name
      3mf
      Type
      string
      Description

      3MF output के लिए आरक्षित। repair-printability कार्यों के लिए हमेशा एक खाली string।

    • Name
      mtl
      Type
      string
      Description

      MTL output के लिए आरक्षित। repair-printability कार्यों के लिए हमेशा एक खाली string।

  • Name
    thumbnail_url
    Type
    string
    Description

    मरम्मत किए गए मॉडल से रेंडर की गई preview image का URL।

  • Name
    alpha_thumbnail_url
    Type
    string
    Description

    thumbnail_url के transparent-background (RGBA) version के लिए डाउनलोड करने योग्य URL। केवल तब मौजूद होता है जब कार्य alpha_thumbnail: true के साथ बनाया गया था और transparent preview सफलतापूर्वक render हुआ था; अन्यथा यह field छोड़ दिया जाता है।

  • Name
    texture_urls
    Type
    array
    Description

    हमेशा एक खाली array। मरम्मत केवल इनपुट ज्यामिति को सुरक्षित रखती है और टेक्सचर को फिर से bake नहीं करती।

  • Name
    consumed_credits
    Type
    integer
    Description

    इस कार्य द्वारा खपत किए गए क्रेडिट की संख्या। कार्य SUCCEEDED तक पहुँचने के बाद 10FAILED कार्यों के लिए 0 लौटाता है (विफलता पर क्रेडिट वापस कर दिए जाते हैं)।

The Repair Printability Task Object

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "print-repair",
  "status": "SUCCEEDED",
  "progress": 100,
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000030000,
  "expires_at": 1715725401000,
  "task_error": null,
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
    "fbx": "",
    "obj": "",
    "stl": "",
    "usdz": "",
    "3mf": "",
    "mtl": ""
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/preview.png?Expires=***",
  "texture_urls": [],
  "consumed_credits": 10
}