क्विकस्टार्ट

अपनी API की बनाकर शुरुआत करें

इस गाइड में हर रिक्वेस्ट के लिए इसकी आवश्यकता होती है। की बनाने में कुछ ही सेकंड लगते हैं।

अपनी API की बनाएं

Meshy REST API का उपयोग करके अपने पहले 3D मॉडल तक पहुँचने के चार चरण।


1अपनी API की प्राप्त करें

Developer Platform के API Keys पेज से एक API की बनाएं — इस स्क्रीन के बाद आप इसे दोबारा नहीं देख पाएंगे, इसलिए इसे कहीं सुरक्षित रखें। हर रिक्वेस्ट Authorization हेडर में Bearer टोकन के साथ प्रमाणीकरण करती है — देखें Authentication।

Developer Platform में API Keys पेज खोलें, फिर अपनी की बनाएं


2अपना पहला इमेज-टू-3D रिक्वेस्ट बनाएं

अपनी की एक्सपोर्ट करें, फिर इमेज से 3D के साथ अपना पहला टास्क बनाएं। किसी टेक्स्ट prompt या कई फोटो से काम कर रहे हैं? देखें टेक्स्ट से 3D या मल्टी-इमेज से 3D।

Export your key

export MESHY_API_KEY="<your-api-key>"

नीचे दिया गया हर उदाहरण इसी फोटो का उपयोग करता है — कुछ और आज़माने के लिए अपना खुद का image_url डालें।

Sample fantasy character illustration used as the Image to 3D input in this guide
Sample input

Request

POST
/openapi/v1/image-to-3d
curl https://api.meshy.ai/openapi/v1/image-to-3d \
  -X POST \
  -H "Authorization: Bearer ${MESHY_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://docs.meshy.ai/images/api/quick-start/source-photo.webp"
  }'

3टास्क स्टेटस जांचें

रिक्वेस्ट तुरंत एक टास्क ID लौटाती हैं। status के SUCCEEDED होने तक उसी एंडपॉइंट को पोल करें — नीचे <task_id> को चरण 2 में लौटाई गई ID से बदलें।

Request

GET
/openapi/v1/image-to-3d/:id
curl https://api.meshy.ai/openapi/v1/image-to-3d/<task_id> \
  -H "Authorization: Bearer ${MESHY_API_KEY}"

Response — SUCCEEDED

{
  "id": "018a210d-8ba4-705c-b111-1f1776f7f578",
  "status": "SUCCEEDED",
  "progress": 100,
  "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=***"
  },
  "thumbnail_url": "https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***",
  "task_error": {
    "message": ""
  }
}

4अपना मॉडल डाउनलोड करें

ऊपर दिए गए रिस्पॉन्स में model_urls से मॉडल प्राप्त करें। हर फॉर्मैट (GLB, FBX, OBJ, USDZ, STL) एक साइन्ड, समय-सीमित URL है — या कमांड लाइन को छोड़कर डाउनलोड करने के लिए URL को सीधे अपने ब्राउज़र के एड्रेस बार में पेस्ट करें।

Download

model_urls.glb
curl -L "<model_urls.glb from the response above>" -o model.glb
The resulting 3D model generated from the sample fantasy character photo
Your result

सब कुछ एक साथ रखें

एक ऐसी स्क्रिप्ट पसंद करते हैं जो पूरा काम कर दे — बनाना, पोल करना, डाउनलोड करना?

Full script

import axios from 'axios';
import fs from 'fs';

const headers = { Authorization: `Bearer ${process.env.MESHY_API_KEY}` };
const imageUrl = 'https://docs.meshy.ai/images/api/quick-start/source-photo.webp';

// 1. Create the task
const { data: created } = await axios.post(
  'https://api.meshy.ai/openapi/v1/image-to-3d',
  { image_url: imageUrl },
  { headers },
);
const taskId = created.result;

// 2. Poll until it finishes
let task;
while (true) {
  const { data } = await axios.get(`https://api.meshy.ai/openapi/v1/image-to-3d/${taskId}`, { headers });
  task = data;
  if (task.status === 'SUCCEEDED' || task.status === 'FAILED') break;
  await new Promise((resolve) => setTimeout(resolve, 5000));
}

// 3. Download the result (only if the task succeeded)
if (task.status !== 'SUCCEEDED') {
  throw new Error(`Task ${task.status}: ${task.task_error?.message || 'unknown error'}`);
}
const { data: model } = await axios.get(task.model_urls.glb, { responseType: 'arraybuffer' });
fs.writeFileSync('model.glb', model);
console.log('Saved model.glb');

सामान्य वर्कफ़्लो एक्सप्लोर करें


अगले कदम

  • UI पसंद करते हैं? Developer Platform खोलें — Playground में रिक्वेस्ट चलाएं, उपयोग और रिक्वेस्ट लॉग ट्रैक करें, और webhooks प्रबंधित करें।
  • हर एंडपॉइंट के लिए पूरा API रेफरेंस ब्राउज़ करें।
  • प्रोडक्शन में जाने से पहले मूल्य निर्धारण, Rate Limits, और एरर जांच लें।
  • अपडेट और बग फिक्स के लिए चेंजलॉग देखते रहें।
  • फीडबैक है या कोई समस्या हो रही है? हमारे Discord समुदाय से जुड़ें — हमें आपसे सुनना अच्छा लगेगा!