एनिमेशन API

उपलब्ध एनिमेशन खोजने और उन्हें rig किए गए कैरेक्टर पर लागू करने के लिए endpoints.


POST/openapi/v1/animations

एनिमेशन टास्क बनाएं

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

पैरामीटर

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

    सफलतापूर्वक पूर्ण हुए rigging टास्क का id (POST /openapi/v1/rigging से)। इस टास्क के कैरेक्टर को एनिमेट किया जाएगा।

  • Name
    action_id
    Type
    integer
    आवश्यक
    Description

    लागू किए जाने वाले एनिमेशन एक्शन का पहचानकर्ता। उपलब्ध एनिमेशन की पूरी सूची के लिए एनिमेशन लाइब्रेरी संदर्भ देखें।

  • Name
    post_process
    Type
    object
    Description

    एनिमेशन आउटपुट के लिए वैकल्पिक पोस्ट-प्रोसेसिंग। मानक एनिमेशन फ़ाइलें प्राप्त करने के लिए इसे छोड़ दें।

केवल तब लागू होता है जब post_process is set
  • Name
    operation_type
    Type
    string
    आवश्यक
    Description

    किए जाने वाले ऑपरेशन का प्रकार। उपलब्ध मान: change_fps, fbx2usdz, extract_armature.

  • Name
    fps
    Type
    integer
    डिफ़ॉल्ट 30
    Description

    लक्षित फ़्रेम रेट। केवल तब लागू होता है जब operation_type change_fps हो। अनुमत मान: 24, 25, 30, 60.

रिटर्न

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

विफलता मोड

  • Name
    400 - Bad Request
    Description

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

    • पैरामीटर अनुपस्थित: rig_task_id या action_id अनुपस्थित है।
    • अमान्य rig टास्क: rig_task_id अमान्य है या किसी विफल/अस्तित्वहीन टास्क को संदर्भित करता है।
    • अमान्य action ID: action_id किसी मान्य एनिमेशन से मेल नहीं खाता।
  • Name
    401 - Unauthorized
    Description

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

  • Name
    402 - Payment Required
    Description

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

  • Name
    404 - Not Found
    Description

    rig_task_id द्वारा निर्दिष्ट rigging टास्क नहीं मिला।

  • Name
    429 - Too Many Requests
    Description

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

Request

POST
/openapi/v1/animations
# Animate a rigged model with required params only
curl https://api.meshy.ai/openapi/v1/animations \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579",
    "action_id": 92
  }'

# With post-processing to change FPS
curl https://api.meshy.ai/openapi/v1/animations \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579",
    "action_id": 92,
    "post_process": {
      "operation_type": "change_fps",
      "fps": 24
    }
  }'

Response

{
  "result": "018c425b-b2c6-727e-d333-3c1887i9h791"
}

GET/openapi/v1/animations/:id

एक एनिमेशन कार्य प्राप्त करें

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

पैरामीटर

  • Name
    id
    Type
    path
    Description

    प्राप्त किए जाने वाले एनिमेशन कार्य के लिए अद्वितीय पहचानकर्ता।

रिटर्न

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

Request

GET
/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791
curl https://api.meshy.ai/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791 
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

{
  "id": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "type": "animate",
  "status": "SUCCEEDED",
  "created_at": 1747032440896,
  "progress": 100,
  "started_at": 1747032441210,
  "finished_at": 1747032457530,
  "expires_at": 1747291657530,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 3,
  "result": {
    "animation_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/Animation_Reaping_Swing_withSkin.glb?Expires=...",
    "animation_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/Animation_Reaping_Swing_withSkin.fbx?Expires=...",
    "processed_usdz_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed.usdz?Expires=...",
    "processed_armature_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed_armature.fbx?Expires=...",
    "processed_animation_fps_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed_60fps.fbx?Expires=..."
  },
  "preceding_tasks": 0
}

DELETE/openapi/v1/animations/:id

एक एनिमेशन टास्क हटाएँ

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

पाथ पैरामीटर

  • Name
    id
    Type
    path
    Description

    हटाने के लिए एनिमेशन टास्क की ID।

रिटर्न

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

Request

DELETE
/openapi/v1/animations/018b314a-a1b5-716d-c222-2f1776f7f579
curl --request DELETE \
  --url https://api.meshy.ai/openapi/v1/animations/018b314a-a1b5-716d-c222-2f1776f7f579 \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

// Returns 200 Ok on success.

GET/openapi/v1/animations/:id/stream

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

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

पैरामीटर

  • Name
    id
    Type
    path
    Description

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

रिटर्न

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

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

Request

GET
/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791/stream
curl -N https://api.meshy.ai/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791/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": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "progress": 50,
  "status": "IN_PROGRESS"
}

event: message
data: { // Example of a SUCCEEDED task stream item, mirroring The Animation Task Object structure
  "id": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "type": "animate",
  "status": "SUCCEEDED",
  "created_at": 1747032440896,
  "progress": 100,
  "started_at": 1747032441210,
  "finished_at": 1747032457530,
  "expires_at": 1747291657530,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 3,
  "result": {
    "animation_glb_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.glb?...",
    "animation_fbx_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.fbx?...",
    "processed_usdz_url": "https://assets.meshy.ai/.../processed.usdz?...",
    "processed_armature_fbx_url": "https://assets.meshy.ai/.../processed_armature.fbx?...",
    "processed_animation_fps_fbx_url": "https://assets.meshy.ai/.../processed_60fps.fbx?..."
  },
  "preceding_tasks": 0
}

एनिमेशन कार्य ऑब्जेक्ट

एनिमेशन कार्य ऑब्जेक्ट, rig किए गए कैरेक्टर पर एनिमेशन लागू करने के लिए कार्य इकाई का प्रतिनिधित्व करता है।

गुण

  • Name
    id
    Type
    string
    Description

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

  • Name
    type
    Type
    string
    Description

    एनिमेशन कार्य का प्रकार। मान animate है।

  • Name
    status
    Type
    string
    Description

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

  • Name
    progress
    Type
    integer
    Description

    कार्य का progress (0-100)।

  • Name
    created_at
    Type
    timestamp
    Description

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

  • Name
    started_at
    Type
    timestamp
    Description

    कार्य की प्रोसेसिंग शुरू होने का टाइमस्टैंप (epoch से मिलीसेकंड)। शुरू नहीं हुआ हो तो 0

  • Name
    finished_at
    Type
    timestamp
    Description

    कार्य समाप्त होने का टाइमस्टैंप (epoch से मिलीसेकंड)। समाप्त नहीं हुआ हो तो 0

  • Name
    expires_at
    Type
    timestamp
    Description

    कार्य के परिणाम एसेट्स की समाप्ति का टाइमस्टैंप (epoch से मिलीसेकंड)।

  • Name
    task_error
    Type
    object
    Description

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

  • Name
    consumed_credits
    Type
    integer
    Description

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

  • Name
    result
    Type
    object
    Description

    यदि कार्य SUCCEEDED हो तो आउटपुट एनिमेशन URL शामिल करता है।

    • Name
      animation_glb_url
      Type
      string
      Description
      GLB फ़ॉर्मैट में एनिमेशन के लिए डाउनलोड करने योग्य URL।
    • Name
      animation_fbx_url
      Type
      string
      Description
      FBX फ़ॉर्मैट में एनिमेशन के लिए डाउनलोड करने योग्य URL।
    • Name
      processed_usdz_url
      Type
      string
      Description
      USDZ फ़ॉर्मैट में प्रोसेस किए गए एनिमेशन के लिए डाउनलोड करने योग्य URL।
    • Name
      processed_armature_fbx_url
      Type
      string
      Description
      FBX फ़ॉर्मैट में प्रोसेस किए गए आर्मेचर के लिए डाउनलोड करने योग्य URL।
    • Name
      processed_animation_fps_fbx_url
      Type
      string
      Description
      FBX फ़ॉर्मैट में बदले हुए FPS वाले एनिमेशन के लिए डाउनलोड करने योग्य URL (उदा., यदि change_fps ऑपरेशन का उपयोग किया गया हो)।
  • Name
    preceding_tasks
    Type
    integer
    Description

    कतार में पिछले कार्यों की संख्या। केवल तभी अर्थपूर्ण जब स्थिति PENDING हो।

Example Animation Task Object

{
  "id": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "type": "animate",
  "status": "SUCCEEDED",
  "created_at": 1747032440896,
  "progress": 100,
  "started_at": 1747032441210,
  "finished_at": 1747032457530,
  "expires_at": 1747291657530,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 3,
  "result": {
    "animation_glb_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.glb?...",
    "animation_fbx_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.fbx?...",
    "processed_usdz_url": "https://assets.meshy.ai/.../processed.usdz?...",
    "processed_armature_fbx_url": "https://assets.meshy.ai/.../processed_armature.fbx?...",
    "processed_animation_fps_fbx_url": "https://assets.meshy.ai/.../processed_60fps.fbx?..."
  },
  "preceding_tasks": 0
}