टेक्स्ट से 3D API

टेक्स्ट से 3D API एक विशेषता है जो आपको Meshy की टेक्स्ट से 3D क्षमताओं को आपके अपने एप्लिकेशन में एकीकृत करने की अनुमति देती है। इस खंड में, आपको इस API के साथ आरंभ करने के लिए सभी जानकारी मिलेगी।

टेक्स्ट से 3D एक दो-चरणीय वर्कफ़्लो का उपयोग करता है। पहले, एक प्रिव्यू टास्क (mode: "preview") बनाएं ताकि आप आकार का मूल्यांकन कर सकें, बिना टेक्सचर के 3D मेश उत्पन्न करने के लिए। फिर, मेश पर टेक्सचर लागू करने के लिए पूर्ण प्रिव्यू के टास्क आईडी को एक रिफाइन टास्क (mode: "refine") में पास करें। दोनों चरण एक ही एंडपॉइंट साझा करते हैं।


POST/openapi/v2/text-to-3d

Create a Text to 3D Preview Task

यह एंडपॉइंट एक Text to 3D प्रीव्यू टास्क बनाता है, जो टेक्स्ट prompt से एक बिना टेक्सचर वाला 3D मेश (केवल ज्यामिति) जनरेट करता है। यह टू-स्टेप वर्कफ़्लो का पहला चरण है। एक बार प्रीव्यू सफल हो जाने पर, टेक्सचरिंग के लिए refine टास्क बनाने हेतु लौटाए गए टास्क ID का उपयोग करें। पूरे रिस्पॉन्स स्कीमा के लिए The Text to 3D Task Object देखें।

पैरामीटर

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

    प्रीव्यू टास्क बनाते समय इस फील्ड को "preview" पर सेट किया जाना चाहिए।

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

    बताएं कि 3D मॉडल किस प्रकार की ऑब्जेक्ट है। अधिकतम 800 वर्ण।

  • Name
    model_type
    Type
    string
    डिफ़ॉल्ट standard
    Description

    3D मेश जनरेशन के प्रकार को निर्दिष्ट करें।

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

    • standard: नियमित हाई-डिटेल 3D मेश जनरेशन।
    • smart-topology: ai_model (meshy-t2) के साथ Smart Topology मॉडल चुनें।
    • lowpoly (डेप्रिकेटेड): क्लीनर पॉलीगॉन के लिए ऑप्टिमाइज़्ड लो-पॉली मेश जनरेट करता है। हम इसके बजाय smart-topology उपयोग करने की सलाह देते हैं।
  • Name
    ai_model
    Type
    string
    डिफ़ॉल्ट latest
    Description

    उपयोग किए जाने वाले मॉडल का ID। उपलब्ध वैल्यू model_type पर निर्भर करती हैं।

    स्टैंडर्ड जनरेशन (model_type: standard):

    • meshy-5, meshy-6, meshy-7, latest (Meshy 7)

    Smart Topology जनरेशन (model_type: smart-topology):

    • meshy-t2 (डिफ़ॉल्ट): Smart Topology मॉडल — साफ़ topology, स्वाभाविक रूप से अलग किए गए पार्ट्स, ट्राएंगल आउटपुट, और एक फेस काउंट जिसे आप target_polycount के साथ सेट कर सकते हैं।
  • Name
    ultra_mode
    Type
    boolean
    डिफ़ॉल्ट false
    Description

    बेहतर सतह विवरण के साथ उच्च-निष्ठा ज्यामिति के लिए Ultra जनरेशन सक्षम करता है। जनरेशन में अधिक समय लगता है और 5 क्रेडिट जुड़ते हैं।

  • Name
    should_remesh
    Type
    boolean
    डिफ़ॉल्ट false (meshy-6, meshy-7), true (others)
    Description

    नियंत्रित करता है कि रीमेश फ़ेज़ को सक्षम किया जाए या नहीं। उच्चतम-गुणवत्ता वाले मॉडल के लिए, हम should_remesh को false पर सेट करने की सलाह देते हैं।

केवल तब लागू होता है जब should_remesh = true
  • Name
    topology
    Type
    string
    डिफ़ॉल्ट triangle
    Description

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

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

    • quad: एक क्वाड-प्रधान मेश जनरेट करें।
    • triangle: एक डेसिमेटेड ट्राएंगल मेश जनरेट करें।
  • Name
    decimation_mode
    Type
    integer
    Description

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

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

    • 1: एडेप्टिव — अल्ट्रा पॉलीकाउंट।
    • 2: एडेप्टिव — हाई पॉलीकाउंट।
    • 3: एडेप्टिव — मीडियम पॉलीकाउंट।
    • 4: एडेप्टिव — लो पॉलीकाउंट।
  • Name
    target_polycount
    Type
    integer
    Description

    आउटपुट में पॉलीगॉन (फेस) की लक्ष्य संख्या। वास्तविक काउंट ज्यामिति के आधार पर लक्ष्य से भिन्न हो सकता है।

    target_polycount दो स्वतंत्र मामलों में प्रभावी होता है:

    • रीमेशstandard मॉडल पर should_remesh: true के साथ। मेश को लगभग इस काउंट तक रीमेश (डेसिमेट) किया जाता है। रेंज 100 से 300,000, डिफ़ॉल्ट 30,000। यदि decimation_mode सेट है, तो इसे प्राथमिकता मिलती है और target_polycount को अनदेखा किया जाता है।
    • Smart Topologymodel_type: smart-topology और ai_model: meshy-t2 के साथ। मॉडल सीधे इस फेस काउंट पर जनरेट किया जाता है; कोई रीमेश नहीं चलता और should_remesh की आवश्यकता नहीं है। रेंज 100 से 15,000, डिफ़ॉल्ट 4,000।
  • Name
    symmetry_mode
    Type
    string
    पुराना
    डिफ़ॉल्ट auto
    Description

    डेप्रिकेटेड। यह पैरामीटर अब आउटपुट को प्रभावित नहीं करता है।

    symmetry_mode फ़ील्ड मॉडल जनरेशन प्रक्रिया के दौरान सममिति व्यवहार को नियंत्रित करती है।

    मान्य वैल्यू हैं:

    • off: सममिति को अक्षम करता है।
    • auto: इनपुट ज्यामिति के आधार पर स्वचालित रूप से सममिति निर्धारित करता है और लागू करता है।
    • on: जनरेशन के दौरान सममिति को लागू करता है।
  • Name
    pose_mode
    Type
    string
    डिफ़ॉल्ट ""
    Description

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

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

    • a-pose: मॉडल को A pose में जनरेट करें।
    • t-pose: मॉडल को T pose में जनरेट करें।
    • "" (खाली स्ट्रिंग): कोई विशिष्ट pose लागू नहीं।
  • Name
    is_a_t_pose
    Type
    boolean
    पुराना
    डिफ़ॉल्ट false
    Description

    इसके बजाय pose_mode का उपयोग करें। क्या मॉडल को A/T pose में जनरेट करना है।

  • Name
    art_style
    Type
    string
    पुराना
    डिफ़ॉल्ट realistic
    Description

    Meshy-6 द्वारा समर्थित नहीं है। Meshy-6 का उपयोग करने वाले अनुरोध art_style को अनदेखा कर देंगे, और कुछ संयोजनों से एरर आ सकते हैं। उपलब्ध वैल्यू: realistic, sculpture

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

    जब true पर सेट किया जाता है, तो इनपुट कंटेंट की संभावित रूप से हानिकारक कंटेंट के लिए स्वचालित रूप से जांच की जाएगी। यदि हानिकारक कंटेंट का पता चलता है, तो टास्क जनरेशन के लिए आगे नहीं बढ़ेगा।

    prompt से टेक्स्ट की जांच की जाएगी।

  • Name
    target_formats
    Type
    string[]
    Description

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

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

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

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

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

    जब true पर सेट किया जाता है, तो सर्विस ऑब्जेक्ट की वास्तविक-दुनिया की ऊँचाई का स्वचालित रूप से अनुमान लगाने और तदनुसार मॉडल का आकार बदलने के लिए AI विज़न का उपयोग करती है। जब तक origin_at स्पष्ट रूप से सेट न हो, ओरिजिन डिफ़ॉल्ट रूप से bottom होगा।

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

    जब auto_size सक्षम हो तो ओरिजिन की स्थिति।

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

रिटर्न

रिस्पॉन्स के result प्रॉपर्टी में नए बनाए गए Text to 3D टास्क का टास्क id शामिल है।

फेल्यर मोड

  • Name
    400 - Bad Request
    Description

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

    • मिसिंग पैरामीटर: एक आवश्यक पैरामीटर (जैसे, prompt, mode) गायब है।
    • अमान्य पैरामीटर: art_style अनुमत वैल्यू में से एक नहीं है।
    • prompt बहुत लंबा है: prompt वर्ण सीमा से अधिक है।
  • Name
    401 - Unauthorized
    Description

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

  • Name
    402 - Payment Required
    Description

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

  • Name
    429 - Too Many Requests
    Description

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

Request

POST
/openapi/v2/text-to-3d
# Simple preview with required params only
curl https://api.meshy.ai/openapi/v2/text-to-3d \
  -H 'Authorization: Bearer ${YOUR_API_KEY}' \
  -H 'Content-Type: application/json' \
  -d '{
  "mode": "preview",
  "prompt": "a monster mask"
}'

# Preview with remesh and A-pose
curl https://api.meshy.ai/openapi/v2/text-to-3d \
  -H 'Authorization: Bearer ${YOUR_API_KEY}' \
  -H 'Content-Type: application/json' \
  -d '{
  "mode": "preview",
  "prompt": "a futuristic robot warrior",
  "should_remesh": true,
  "target_polycount": 100000,
  "pose_mode": "a-pose",
  "target_formats": ["glb"]
}'

Response

{
  "result": "018a210d-8ba4-705c-b111-1f1776f7f578"
}

POST/openapi/v2/text-to-3d

Create a Text to 3D Refine Task

यह एंडपॉइंट एक Text to 3D refine task बनाता है, जो एक पूर्ण हो चुके preview mesh पर टेक्सचर लागू करता है। आपको सफल preview task से प्राप्त preview_task_id प्रदान करनी होगी। यह दो-चरणीय वर्कफ़्लो का दूसरा चरण है।

पैरामीटर

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

    refine task बनाते समय इस फ़ील्ड को "refine" पर सेट किया जाना चाहिए।

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

    संबंधित preview task id।

    दी गई preview task की स्थिति SUCCEEDED होनी चाहिए।

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

    बेस कलर के अतिरिक्त PBR मैप (metallic, roughness, normal) जनरेट करें। जब ai_model, meshy-6 हो तो एक emission map भी शामिल होता है, सिवाय texture_resolution: 8k के (इस पर कोई emission map नहीं बनता)। meshy-7 (और latest) कोई emission map नहीं बनाता।

  • Name
    texture_resolution
    Type
    string
    डिफ़ॉल्ट 2k
    Description

    बेस कलर टेक्सचर रिज़ॉल्यूशन। 2k (2048×2048), 4k (4096×4096), या 8k (8192×8192) में से एक। उच्च रिज़ॉल्यूशन अधिक सतह विवरण कैप्चर करते हैं। यह केवल refine mode पर लागू होता है।

  • 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 फॉर्मेट का समर्थन करते हैं।

    इमेज प्रदान करने के दो तरीके हैं:

    • सार्वजनिक रूप से सुलभ URL: एक ऐसा URL जो सार्वजनिक इंटरनेट से सुलभ हो
    • Data URI: इमेज का एक base64-एन्कोडेड data URI। data URI का उदाहरण: data:image/jpeg;base64,<your base64-encoded image data>
  • Name
    ai_model
    Type
    string
    डिफ़ॉल्ट latest
    Description

    refine के लिए उपयोग किए जाने वाले मॉडल का ID। उपलब्ध मान: meshy-5, meshy-6, meshy-7, latest (Meshy 7)।

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

    जब true पर सेट किया जाता है, तो इनपुट सामग्री की स्वचालित रूप से संभावित हानिकारक सामग्री के लिए स्क्रीनिंग की जाएगी। यदि हानिकारक सामग्री का पता चलता है, तो task जनरेशन के लिए आगे नहीं बढ़ेगा।

    texture_prompt से टेक्स्ट और texture_image_url से इमेज दोनों की स्क्रीनिंग की जाएगी।

  • Name
    remove_lighting
    Type
    boolean
    डिफ़ॉल्ट true
    Description

    बेस कलर टेक्सचर से हाइलाइट्स और शैडो हटाता है, जिससे एक साफ़ परिणाम मिलता है जो कस्टम लाइटिंग सेटअप में बेहतर काम करता है।

  • Name
    target_formats
    Type
    string[]
    Description

    निर्दिष्ट करता है कि आउटपुट में कौन-से 3D फ़ाइल फॉर्मेट शामिल किए जाएँ। केवल अनुरोधित फॉर्मेट ही जनरेट और वापस किए जाएंगे, जिससे task पूरा होने का समय कम हो सकता है। जब यह छोड़ दिया जाता है, तो सभी समर्थित फॉर्मेट शामिल होते हैं।

    उपलब्ध मान: glb, obj, fbx, stl, usdz, 3mf

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

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

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

    जब true पर सेट किया जाता है, तो सेवा वस्तु की वास्तविक-दुनिया की ऊँचाई का स्वचालित रूप से अनुमान लगाने के लिए AI vision का उपयोग करती है और तदनुसार मॉडल का आकार बदल देती है। जब तक origin_at को स्पष्ट रूप से सेट नहीं किया जाता, ओरिजिन डिफ़ॉल्ट रूप से bottom होगा।

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

    जब auto_size सक्षम हो तो ओरिजिन की स्थिति।

    उपलब्ध मान: bottom, center

रिटर्न

रिस्पॉन्स की result प्रॉपर्टी में नई बनाई गई Text to 3D task की task id होती है।

विफलता स्थितियाँ

  • Name
    400 - Bad Request
    Description

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

    • अमान्य task ID: preview_task_id अमान्य है या मौजूद नहीं है।
    • Task तैयार नहीं है: preview task अभी तक सफल नहीं हुआ है।
    • मॉडल बेमेल: preview task का AI मॉडल अनुरोधित refine मॉडल के साथ असंगत है।
  • Name
    401 - Unauthorized
    Description

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

  • Name
    402 - Payment Required
    Description

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

  • Name
    404 - Not Found
    Description

    preview_task_id द्वारा निर्दिष्ट preview task नहीं मिला।

  • Name
    429 - Too Many Requests
    Description

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

Request

POST
/openapi/v2/text-to-3d
# Basic refine task
curl https://api.meshy.ai/openapi/v2/text-to-3d \
  -H 'Authorization: Bearer ${YOUR_API_KEY}' \
  -H 'Content-Type: application/json' \
  -d '{
  "mode": "refine",
  "preview_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "enable_pbr": true
}'

# Refine with auto-size and GLB format
curl https://api.meshy.ai/openapi/v2/text-to-3d \
  -H 'Authorization: Bearer ${YOUR_API_KEY}' \
  -H 'Content-Type: application/json' \
  -d '{
  "mode": "refine",
  "preview_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "target_formats": ["glb"],
  "auto_size": true
}'

Response

{
  "result": "018a210d-8ba4-705c-b111-1f1776f7f578"
}

GET/openapi/v2/text-to-3d/:id

टेक्स्ट से 3D कार्य प्राप्त करें

यह एंडपॉइंट आपको एक मान्य कार्य id के साथ एक टेक्स्ट से 3D कार्य प्राप्त करने की अनुमति देता है। टेक्स्ट से 3D कार्य ऑब्जेक्ट में कौन-कौन सी प्रॉपर्टीज़ शामिल हैं, यह देखने के लिए टेक्स्ट से 3D कार्य ऑब्जेक्ट देखें।

यह एंडपॉइंट दोनों पूर्वावलोकन और परिष्कृत कार्यों के लिए काम करता है।

पैरामीटर्स

  • Name
    id
    Type
    path
    Description

    प्राप्त करने के लिए टेक्स्ट से 3D कार्य का अद्वितीय पहचानकर्ता।

रिटर्न्स

प्रतिक्रिया में टेक्स्ट से 3D कार्य ऑब्जेक्ट शामिल होता है। विवरण के लिए टेक्स्ट से 3D कार्य ऑब्जेक्ट अनुभाग देखें।

उदाहरण

मोडनमूना मॉडल
पूर्वावलोकनपूर्वावलोकन मॉडल
परिष्कृतपरिष्कृत मॉडल

अनुरोध

GET
/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578
curl https://api.meshy.ai/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \
-H "Authorization: Bearer ${YOUR_API_KEY}"

प्रतिक्रिया

{
  "id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "type": "text-to-3d-preview",
  "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=***",
    "mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?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=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
  "prompt": "a monster mask",
  "progress": 100,
  "started_at": 1692771667037,
  "created_at": 1692771650657,
  "finished_at": 1692771669037,
  "status": "SUCCEEDED",
  "texture_urls": [
    {
      "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***"
    }
  ],
  "preceding_tasks": 0,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 20
}

DELETE/openapi/v2/text-to-3d/:id

टेक्स्ट से 3D कार्य को हटाएं

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

पथ पैरामीटर्स

  • Name
    id
    Type
    path
    Description

    हटाने के लिए टेक्स्ट से 3D कार्य का ID।

रिटर्न्स

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

Request

DELETE
/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578
curl --request DELETE \
  --url https://api.meshy.ai/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578 \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

// Returns 200 Ok on success.

GET/openapi/v2/text-to-3d

टेक्स्ट से 3D कार्यों की सूची

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

पैरामीटर्स

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

    पेजिनेशन के लिए पृष्ठ संख्या।

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

    पृष्ठ आकार सीमा। अधिकतम अनुमत 50 आइटम हैं।

  • Name
    sort_by
    Type
    string
    Description

    छांटने के लिए फ़ील्ड।

    उपलब्ध मान:

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

रिटर्न्स

टेक्स्ट से 3D कार्य ऑब्जेक्ट्स की पेजिनेटेड सूची लौटाता है।

Request

GET
/openapi/v2/text-to-3d
curl https://api.meshy.ai/openapi/v2/text-to-3d?page_size=10 \
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response

[
  {
    "id": "018a210d-8ba4-705c-b111-1f1776f7f578",
    "type": "text-to-3d-preview",
    "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=***",
      "mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***",
      "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***"
    },
    "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
    "prompt": "a monster mask",
    "progress": 100,
    "started_at": 1692771667037,
    "created_at": 1692771650657,
    "finished_at": 1692771669037,
    "status": "SUCCEEDED",
    "texture_urls": [
      {
        "base_color": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***"
      }
    ],
    "preceding_tasks": 0,
    "task_error": {

      "message": ""

    },

    "consumed_credits": 20
  }
]

GET/openapi/v2/text-to-3d/:id/stream

टेक्स्ट से 3D कार्य को स्ट्रीम करें

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

पैरामीटर्स

  • Name
    id
    Type
    path
    Description

    स्ट्रीम करने के लिए टेक्स्ट से 3D कार्य के लिए अद्वितीय पहचानकर्ता।

रिटर्न्स

सर्वर-सेंट इवेंट्स के रूप में टेक्स्ट से 3D कार्य ऑब्जेक्ट्स की एक स्ट्रीम रिटर्न करता है।

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

अनुरोध

GET
/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream
curl -N https://api.meshy.ai/openapi/v2/text-to-3d/018a210d-8ba4-705c-b111-1f1776f7f578/stream \
-H "Authorization: Bearer ${YOUR_API_KEY}"

प्रतिक्रिया स्ट्रीम

// 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",
  "progress": 50,
  "status": "IN_PROGRESS"
}

event: message
data: {
"id": "018a210d-8ba4-705c-b111-1f1776f7f578",
"type": "text-to-3d-preview",
"progress": 100,
"status": "SUCCEEDED",
"created_at": 1692771650657,
"started_at": 1692771667037,
"finished_at": 1692771669037,
"model_urls": {
  "glb": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***"
},
"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": 20
}

टेक्स्ट से 3D टास्क ऑब्जेक्ट

टेक्स्ट से 3D टास्क ऑब्जेक्ट एक कार्य इकाई है जिसे Meshy ट्रैक करता है ताकि एक टेक्स्ट इनपुट से 3D मॉडल उत्पन्न किया जा सके। टेक्स्ट से 3D API के दो चरण होते हैं, preview और refine। प्रीव्यू चरण केवल मेश-आधारित 3D मॉडल उत्पन्न करने के लिए है, और रिफाइन चरण प्रीव्यू चरण के परिणाम के आधार पर एक टेक्सचरयुक्त 3D मॉडल उत्पन्न करने के लिए है।

ऑब्जेक्ट में निम्नलिखित गुण होते हैं:

गुण

  • Name
    id
    Type
    string
    Description

    कार्य के लिए अद्वितीय पहचानकर्ता। जबकि हम कार्य आईडी के लिए k-sortable UUID का उपयोग करते हैं, आपको आईडी के प्रारूप के बारे में कोई धारणा नहीं बनानी चाहिए।

  • Name
    type
    Type
    string
    Description

    टेक्स्ट से 3D टास्क का प्रकार। संभावित मान हैं text-to-3d-preview प्रीव्यू चरण के कार्यों के लिए और text-to-3d-refine रिफाइन चरण के कार्यों के लिए।

  • Name
    model_urls
    Type
    object
    Description

    Meshy द्वारा उत्पन्न टेक्सचरयुक्त 3D मॉडल फ़ाइल के लिए डाउनलोड करने योग्य URL। यदि कोई प्रारूप उत्पन्न नहीं होता है तो उस प्रारूप के लिए गुण को छोड़ दिया जाएगा बजाय इसके कि खाली स्ट्रिंग लौटाई जाए।

    • Name
      glb
      Type
      string
      Description

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

    • Name
      fbx
      Type
      string
      Description

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

    • Name
      usdz
      Type
      string
      Description

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

    • Name
      obj
      Type
      string
      Description

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

    • Name
      mtl
      Type
      string
      Description

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

    • Name
      stl
      Type
      string
      Description

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

    • Name
      3mf
      Type
      string
      Description

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

  • Name
    prompt
    Type
    string
    Description

    यह वह अपरिवर्तित prompt है जिसका उपयोग कार्य बनाने के लिए किया गया था।

  • Name
    negative_prompt
    Type
    string
    पुराना
    Description

    पिछली संगतता के लिए बनाए रखा गया। इस फ़ील्ड का उत्पन्न मॉडल्स पर कोई कार्यात्मक प्रभाव नहीं है।

  • Name
    art_style
    Type
    string
    पुराना
    Description

    वह अपरिवर्तित art_style जिसका उपयोग प्रीव्यू टास्क बनाने के लिए किया गया था। Meshy-6 द्वारा समर्थित नहीं है।

  • Name
    texture_richness
    Type
    string
    पुराना
    Description

    पिछली संगतता के लिए बनाए रखा गया। इस फ़ील्ड का उत्पन्न मॉडल्स पर कोई कार्यात्मक प्रभाव नहीं है।

  • Name
    texture_prompt
    Type
    string
    Description

    रिफाइन चरण के दौरान टेक्सचरिंग प्रक्रिया को मार्गदर्शन देने के लिए प्रदान किया गया अतिरिक्त टेक्स्ट प्रॉम्प्ट।

  • Name
    ultra_mode
    Type
    boolean
    Description

    ultra_mode मान को प्रतिध्वनित करता है जिसके साथ प्रीव्यू टास्क बनाया गया था। केवल meshy-7 (या latest) प्रीव्यू टास्क के लिए मौजूद होता है जो स्पष्ट रूप से ultra_mode सेट करता है; अन्यथा छोड़ा जाता है।

  • Name
    texture_image_url
    Type
    string
    Description

    टेक्सचरिंग प्रक्रिया को मार्गदर्शन देने के लिए उपयोग की गई टेक्सचर छवि के लिए डाउनलोड करने योग्य URL।

  • Name
    thumbnail_url
    Type
    string
    Description

    मॉडल फ़ाइल की थंबनेल छवि के लिए डाउनलोड करने योग्य URL।

  • Name
    alpha_thumbnail_url
    Type
    string
    Description

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

  • Name
    video_url
    Type
    string
    पुराना
    Description

    प्रीव्यू वीडियो के लिए डाउनलोड करने योग्य URL। भविष्य के रिलीज में हटा दिया जाएगा।

  • Name
    progress
    Type
    integer
    Description

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

  • Name
    started_at
    Type
    timestamp
    Description

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

  • Name
    created_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

    टेक्सचर URL ऑब्जेक्ट्स की एक श्रृंखला जो कार्य से उत्पन्न होती है। सामान्यतः इसमें केवल एक टेक्सचर URL ऑब्जेक्ट होता है। प्रत्येक टेक्सचर URL में निम्नलिखित गुण होते हैं:

    • Name
      base_color
      Type
      string
      Description

      बेस कलर मैप छवि के लिए डाउनलोड करने योग्य URL।

    • Name
      metallic
      Type
      string
      Description

      मेटालिक मैप छवि के लिए डाउनलोड करने योग्य URL।

    • Name
      normal
      Type
      string
      Description

      नॉर्मल मैप छवि के लिए डाउनलोड करने योग्य URL।

    • Name
      roughness
      Type
      string
      Description

      रफनेस मैप छवि के लिए डाउनलोड करने योग्य URL।

    • Name
      emission
      Type
      string
      Description

      एमिशन मैप छवि के लिए डाउनलोड करने योग्य URL।

  • Name
    preceding_tasks
    Type
    integer
    Description

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

  • Name
    task_error
    Type
    object
    Description

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

  • Name
    consumed_credits
    Type
    integer
    Description

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

Example Text to 3D Task Object

{
  "id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "type": "text-to-3d-preview",
  "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=***",
    "usdz": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***",
    "obj": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***",
    "mtl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***",
    "stl": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***"
  },
  "prompt": "a monster mask",
  "texture_prompt": "green slimy skin with scales and warts",
  "texture_image_url": "",
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
  "progress": 100,
  "started_at": 1692771667037,
  "created_at": 1692771650657,
  "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": 20
}