रीमेश API

रीमेश API आपको अन्य Meshy API (जैसे इमेज से 3D या टेक्स्ट से 3D) द्वारा जनरेट किए गए मौजूदा 3D मॉडल्स को रीमेश करने और उन्हें विभिन्न फॉर्मेट्स में एक्सपोर्ट करने की सुविधा देता है। यह सेक्शन रीमेश API का उपयोग करने के तरीके के बारे में विवरण प्रदान करता है।


POST/openapi/v1/remesh

एक Remesh टास्क बनाएँ

यह एंडपॉइंट एक नया remesh टास्क बनाता है।

पैरामीटर

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

    उस पूर्ण हो चुके इमेज से 3D या टेक्स्ट से 3D टास्क का ID, जिसे आप remesh करना चाहते हैं। यह टास्क निम्न में से एक होना चाहिए: Text to 3D Preview, Text to 3D Refine, इमेज से 3D या रीटेक्सचर। इसके अतिरिक्त, इसकी स्थिति SUCCEEDED होनी चाहिए।

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

    कृपया एक सार्वजनिक रूप से एक्सेस किए जा सकने वाले URL या data URI के माध्यम से Meshy को remesh करने के लिए एक 3D मॉडल प्रदान करें। समर्थित फॉर्मेट: .glb, .gltf, .obj, .fbx, .stl.

    Data URIs के लिए, MIME type: application/octet-stream का उपयोग करें।

  • Name
    target_formats
    Type
    string[]
    डिफ़ॉल्ट ["glb"]
    Description

    remesh किए गए मॉडल के लिए टारगेट फॉर्मेट की एक सूची। यदि इसे छोड़ दिया जाता है, तो केवल GLB जनरेट होता है।

    उपलब्ध वैल्यू: glb, fbx, obj, usdz, blend, stl, 3mf.

  • Name
    topology
    Type
    string
    डिफ़ॉल्ट triangle
    Description

    जनरेट किए गए मॉडल की topology निर्दिष्ट करें।

    उपलब्ध वैल्यू:

    • quad: एक quad-प्रधान मेश जनरेट करें।
    • triangle: एक डेसिमेटेड ट्राएंगल मेश जनरेट करें।
  • Name
    target_polycount
    Type
    integer
    डिफ़ॉल्ट 30,000
    Description

    जनरेट किए गए मॉडल में पॉलीगॉन की टारगेट संख्या निर्दिष्ट करें। ज्यामिति की जटिलता के अनुसार पॉलीगॉन की वास्तविक संख्या टारगेट से भिन्न हो सकती है।

    मान्य वैल्यू रेंज यूज़र टियर के अनुसार अलग-अलग होती है:

    • 100 से 300,000 (सम्मिलित)
  • Name
    decimation_mode
    Type
    integer
    Description

    एक पॉलीकाउंट लेवल सेट करके एडेप्टिव डेसिमेशन सक्षम करें। जब सेट किया जाता है, तो target_polycount को नज़रअंदाज़ कर दिया जाता है।

    उपलब्ध वैल्यू:

    • 1: Adaptive — अल्ट्रा पॉलीकाउंट।
    • 2: Adaptive — हाई पॉलीकाउंट।
    • 3: Adaptive — मीडियम पॉलीकाउंट।
    • 4: Adaptive — लो पॉलीकाउंट।
  • Name
    resize_height
    Type
    number
    ⚠ पुराना
    डिफ़ॉल्ट 0
    Description

    मॉडल को मीटर में मापी गई एक निश्चित ऊँचाई तक रीसाइज़ करें। इसके बजाय समर्पित Resize API का उपयोग करने की सलाह दी जाती है।

  • Name
    resize_longest_side
    Type
    number
    ⚠ पुराना
    डिफ़ॉल्ट 0
    Description

    मॉडल को इस तरह रीसाइज़ करें कि सबसे लंबा बाउंडिंग-बॉक्स आयाम मीटर में निर्दिष्ट वैल्यू के बराबर हो। इसके बजाय समर्पित Resize API का उपयोग करने की सलाह दी जाती है।

  • Name
    auto_size
    Type
    boolean
    ⚠ पुराना
    डिफ़ॉल्ट false
    Description

    जब true पर सेट किया जाता है, तो सर्विस ऑब्जेक्ट की वास्तविक दुनिया की ऊँचाई का स्वतः अनुमान लगाने के लिए AI विज़न का उपयोग करती है और तदनुसार मॉडल को रीसाइज़ करती है। इसके बजाय समर्पित Resize API का उपयोग करने की सलाह दी जाती है।

केवल तब लागू होता है जब auto_size = true
  • Name
    origin_at
    Type
    string
    ⚠ पुराना
    डिफ़ॉल्ट bottom
    Description

    ओरिजिन की स्थिति। इसके बजाय समर्पित Resize API का उपयोग करने की सलाह दी जाती है।

    उपलब्ध वैल्यू: bottom, center.

  • Name
    convert_format_only
    Type
    boolean
    ⚠ पुराना
    Description

    यदि true है, तो सर्विस केवल इनपुट मॉडल फ़ाइल का फॉर्मेट बदलेगी, और topology, resize_height, और target_polycount जैसे अन्य इनपुट को नज़रअंदाज़ करेगी। इसके बजाय समर्पित Convert API का उपयोग करने की सलाह दी जाती है।

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

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

रिटर्न

रिस्पॉन्स की result प्रॉपर्टी में नए बनाए गए remesh टास्क का id होता है।

विफलता के मोड

  • Name
    400 - Bad Request
    Description

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

    • पैरामीटर गायब: model_url या input_task_id में से एक प्रदान किया जाना चाहिए।
    • अमान्य इनपुट टास्क: input_task_id को एक समर्थित मॉडल से सफल टास्क का संदर्भ देना चाहिए।
    • अमान्य मॉडल फॉर्मेट: model_url एक असमर्थित एक्सटेंशन वाली फ़ाइल की ओर इशारा करता है।
    • पहुँच से बाहर URL: model_url को डाउनलोड नहीं किया जा सका।
    • अमान्य topology: topology पैरामीटर अमान्य है।
    • परस्पर अनन्य पैरामीटर: auto_size और resize_height दोनों एक साथ सेट नहीं किए जा सकते।
  • Name
    401 - Unauthorized
    Description

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

  • Name
    402 - Payment Required
    Description

    इस टास्क को करने के लिए अपर्याप्त क्रेडिट।

  • Name
    429 - Too Many Requests
    Description

    आपने अपनी रेट लिमिट पार कर ली है।

Request

POST
/openapi/v1/remesh
# Basic remesh with custom formats and resize
curl https://api.meshy.ai/openapi/v1/remesh \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "target_formats": ["glb", "fbx"],
    "topology": "quad",
    "target_polycount": 50000,
    "resize_height": 1.0,
    "origin_at": "bottom"
  }'

# Quad remesh with auto-size
curl https://api.meshy.ai/openapi/v1/remesh \
-X POST \
-H "Authorization: Bearer ${YOUR_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
    "input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "target_formats": ["glb", "fbx"],
    "topology": "quad",
    "target_polycount": 50000,
    "auto_size": true
  }'

Response

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

GET/openapi/v1/remesh/:id

एक रीमेश टास्क प्राप्त करें

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

Parameters

  • Name
    id
    Type
    path
    Description

    प्राप्त किए जाने वाले रीमेश टास्क की ID।

Returns

रीमेश टास्क ऑब्जेक्ट।

Request

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

Response

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "remesh",
  "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
      "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***",
      "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***",
      "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***",
      "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***",
      "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
},
  "progress": 100,
  "status": "SUCCEEDED",
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": null,
}

DELETE/openapi/v1/remesh/:id

एक रीमेश टास्क डिलीट करें

यह एंडपॉइंट किसी रीमेश टास्क को स्थायी रूप से डिलीट करता है, जिसमें उससे जुड़े सभी मॉडल और डेटा शामिल हैं। यह क्रिया अपरिवर्तनीय है।

Path Parameters

  • Name
    id
    Type
    path
    Description

    डिलीट किए जाने वाले रीमेश टास्क की ID।

Task Status

जो टास्क अभी भी PENDING है उसे डिलीट कर दिया जाता है और create-time पर खर्च किए गए क्रेडिट रिफंड कर दिए जाते हैं।

जो टास्क पहले से IN_PROGRESS है उसे डिलीट नहीं किया जा सकता: रिक्वेस्ट को 409 Conflict के साथ रिजेक्ट कर दिया जाता है और टास्क चलता रहता है। जिस टास्क को worker पहले ही शुरू कर चुका है उसके क्रेडिट रिफंडेबल नहीं होते, इसलिए उसे बीच में डिलीट करने पर आपको क्रेडिट और परिणाम दोनों गंवाने पड़ेंगे। इसके SUCCEEDED, FAILED या CANCELED तक पहुंचने का इंतज़ार करें, फिर इसे डिलीट करें।

टर्मिनल स्टेट (SUCCEEDED, FAILED या CANCELED) में मौजूद टास्क को बिना रिफंड के डिलीट कर दिया जाता है।

Returns

सफल होने पर 200 OK रिटर्न करता है, या जब टास्क IN_PROGRESS हो तो 409 Conflict रिटर्न करता है।

Request

DELETE
/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f
curl --request DELETE \
  --url https://api.meshy.ai/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f \
  -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."
}

GET/openapi/v1/remesh

रीमेश टास्क की सूची

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

पैरामीटर

  • Name
    page_num
    Type
    integer
    डिफ़ॉल्ट 1
    Description

    पेजिनेशन के लिए पेज नंबर।

  • Name
    page_size
    Type
    integer
    डिफ़ॉल्ट 10
    Description

    पेज साइज़ लिमिट। अधिकतम अनुमत 100 आइटम है।

  • Name
    sort_by
    Type
    string
    Description

    सॉर्ट करने के लिए फ़ील्ड।

    उपलब्ध मान:

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

रिटर्न वैल्यू

The Remesh Task Objects की एक पेजिनेटेड सूची लौटाता है।

Request

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

Response

[
  {
    "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
    "type": "remesh",
    "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
      "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***",
      "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***",
      "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***",
      "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***",
      "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
    },
    "progress": 100,
    "status": "SUCCEEDED",
    "created_at": 1699999999000,
    "started_at": 1700000000000,
    "finished_at": 1700000001000,
    "task_error": null
  }
]

GET/openapi/v1/remesh/:id/stream

रीमेश टास्क को स्ट्रीम करें

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

पैरामीटर्स

  • Name
    id
    Type
    path
    Description

    स्ट्रीम करने के लिए रीमेश टास्क का यूनीक आइडेंटिफायर।

रिटर्न

Server-Sent Events के रूप में रीमेश टास्क ऑब्जेक्ट्स की एक स्ट्रीम रिटर्न करता है।

PENDING या IN_PROGRESS टास्क के लिए, रिस्पॉन्स स्ट्रीम में केवल आवश्यक progress और status फ़ील्ड्स शामिल होंगे।

Request

GET
/openapi/v1/remesh/a43b5c6d-7e8f-901a-234b-567c890d1e2f/stream
curl -N https://api.meshy.ai/openapi/v1/remesh/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": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "remesh",
  "model_urls": {
    "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
    "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***",
    "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***",
    "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***",
    "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***",
    "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
  },
  "progress": 100,
  "status": "SUCCEEDED",
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": null,
}

द रीमेश टास्क ऑब्जेक्ट

रीमेश टास्क ऑब्जेक्ट एक कार्य इकाई को दर्शाता है जिसका उपयोग Meshy किसी मौजूदा 3D मॉडल को रीमेश करने और विभिन्न फॉर्मेट में एक्सपोर्ट करने के लिए करता है। इस ऑब्जेक्ट में निम्नलिखित प्रॉपर्टीज़ हैं:

Properties

  • Name
    id
    Type
    string
    Description

    टास्क के लिए यूनीक आइडेंटिफायर। हालांकि हम इम्प्लीमेंटेशन डिटेल के रूप में टास्क आईडी के लिए k-sortable UUID का उपयोग करते हैं, आपको आईडी के फॉर्मेट के बारे में कोई भी अनुमान नहीं लगाना चाहिए।

  • Name
    type
    Type
    string
    Description

    रीमेश टास्क का प्रकार। इसका मान remesh है।

  • 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
      blend
      Type
      string
      Description

      Blender फ़ाइल के लिए डाउनलोड करने योग्य URL।

    • Name
      stl
      Type
      string
      Description

      STL फ़ाइल के लिए डाउनलोड करने योग्य URL।

    • Name
      3mf
      Type
      string
      Description

      3MF फ़ाइल के लिए डाउनलोड करने योग्य URL। यह केवल तब मौजूद होता है जब target_formats के माध्यम से 3mf का अनुरोध किया गया हो।

  • Name
    thumbnail_url
    Type
    string
    Description

    रीमेश किए गए मॉडल से रेंडर की गई प्रीव्यू इमेज के लिए डाउनलोड करने योग्य URL।

  • Name
    alpha_thumbnail_url
    Type
    string
    Description

    thumbnail_url के ट्रांसपेरेंट-बैकग्राउंड (RGBA) वर्शन के लिए डाउनलोड करने योग्य URL। यह केवल तब मौजूद होता है जब टास्क alpha_thumbnail: true के साथ बनाया गया था और ट्रांसपेरेंट प्रीव्यू सफलतापूर्वक रेंडर किया गया था; अन्यथा यह फ़ील्ड छोड़ दी जाती है।

  • Name
    progress
    Type
    integer
    Description

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

  • Name
    status
    Type
    string
    Description

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

  • Name
    preceding_tasks
    Type
    integer
    Description

    पूर्ववर्ती टास्क की संख्या।

  • Name
    created_at
    Type
    timestamp
    Description

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

  • Name
    started_at
    Type
    timestamp
    Description

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

  • Name
    finished_at
    Type
    timestamp
    Description

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

  • Name
    task_error
    Type
    object
    Description

    असफल टास्क के लिए एरर विवरण। पूर्ण task_error ऑब्जेक्ट संदर्भ के लिए एरर देखें।

  • Name
    consumed_credits
    Type
    integer
    Description

    इस टास्क द्वारा खपत किए गए क्रेडिट की संख्या। यह तब मौजूद होता है जब टास्क की स्थिति PENDING, IN_PROGRESS, या SUCCEEDED हो। FAILED टास्क के लिए 0 लौटाता है (असफलता पर क्रेडिट रिफंड कर दिए जाते हैं)।

Example Remesh Task Object

{
  "id": "0193bfc5-ee4f-73f8-8525-44b398884ce9",
  "type": "remesh",
  "model_urls": {
      "glb": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.glb?Expires=***",
      "fbx": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.fbx?Expires=***",
      "obj": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.obj?Expires=***",
      "usdz": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.usdz?Expires=***",
      "blend": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.blend?Expires=***",
      "stl": "https://assets.meshy.ai/***/tasks/0193bfc5-ee4f-73f8-8525-44b398884ce9/output/model.stl?Expires=***"
  },
  "progress": 100,
  "status": "SUCCEEDED",
  "preceding_tasks": 0,
  "created_at": 1699999999000,
  "started_at": 1700000000000,
  "finished_at": 1700000001000,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 5
}