Animatie-API

Endpoints voor het ontdekken van beschikbare animaties en het toepassen ervan op personages met een rig.


POST/openapi/v1/animations

Een animatietaak maken

Met dit endpoint kunt u een nieuwe taak maken om een specifieke animatieactie toe te passen op een eerder gerigged personage. Bevat opties voor nabewerking.

Parameters

  • Name
    rig_task_id
    Type
    string
    Verplicht
    Description

    De id van een succesvol voltooide rigging-taak (van POST /openapi/v1/rigging). Het personage uit deze taak wordt geanimeerd.

  • Name
    action_id
    Type
    integer
    Verplicht
    Description

    De identifier van de toe te passen animatieactie. Zie de Referentie voor de Animatiebibliotheek voor een volledige lijst met beschikbare animaties.

  • Name
    post_process
    Type
    object
    Description

    Optionele nabewerking voor de animatie-uitvoer. Laat dit weg om de standaard animatiebestanden te ontvangen.

Alleen van toepassing wanneer post_process is set
  • Name
    operation_type
    Type
    string
    Verplicht
    Description

    Het type bewerking dat moet worden uitgevoerd. Beschikbare waarden: change_fps, fbx2usdz, extract_armature.

  • Name
    fps
    Type
    integer
    standaard 30
    Description

    De doel-framesnelheid. Alleen van toepassing wanneer operation_type change_fps is. Toegestane waarden: 24, 25, 30, 60.

Retourneert

De eigenschap result van de respons bevat de taak-id van de nieuw gemaakte animatietaak.

Foutmodi

  • Name
    400 - Bad Request
    Description

    Het verzoek was niet acceptabel. Veelvoorkomende oorzaken:

    • Ontbrekende parameter: rig_task_id of action_id ontbreekt.
    • Ongeldige rigging-taak: De rig_task_id is ongeldig of verwijst naar een mislukte/niet-bestaande taak.
    • Ongeldige action-ID: De action_id komt niet overeen met een geldige animatie.
  • Name
    401 - Unauthorized
    Description

    Authenticatie mislukt. Controleer uw API-sleutel.

  • Name
    402 - Payment Required
    Description

    Onvoldoende credits om deze taak uit te voeren.

  • Name
    404 - Not Found
    Description

    De rigging-taak die is opgegeven door rig_task_id is niet gevonden.

  • Name
    429 - Too Many Requests
    Description

    U hebt uw rate limit overschreden.

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

Een animatietaak ophalen

Met deze endpoint kun je een animatietaak ophalen met een geldige taak-id. Raadpleeg Het animatietaakobject om te zien welke eigenschappen zijn opgenomen.

Parameters

  • Name
    id
    Type
    path
    Description

    Unieke identifier voor de animatietaak die moet worden opgehaald.

Retourneert

De response bevat het animatietaakobject. Bekijk de sectie Het animatietaakobject voor details.

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

Een Animatie-taak verwijderen

Deze endpoint verwijdert permanent een animatietaak, inclusief alle bijbehorende modellen en gegevens. Deze actie is onomkeerbaar.

Padparameters

  • Name
    id
    Type
    path
    Description

    De ID van de animatietaak die moet worden verwijderd.

Retourneert

Retourneert 200 OK bij succes.

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

Stream een Animatie-taak

Deze endpoint streamt realtime-updates voor een Animatie-taak met behulp van Server-Sent Events (SSE).

Parameters

  • Name
    id
    Type
    path
    Description

    Unieke identifier voor de Animatie-taak om te streamen.

Retourneert

Retourneert een stream van De Animatie-taakobjecten als Server-Sent Events.

Voor PENDING- of IN_PROGRESS-taken bevat de responsstream alleen de noodzakelijke velden progress en 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
}

Het Animatie-taakobject

Het Animatie-taakobject vertegenwoordigt de werkeenheid voor het toepassen van een animatie op een personage met een rig.

Eigenschappen

  • Name
    id
    Type
    string
    Description

    Unieke identifier voor de taak.

  • Name
    type
    Type
    string
    Description

    Type van de Animatie-taak. De waarde is animate.

  • Name
    status
    Type
    string
    Description

    Status van de taak. Mogelijke waarden: PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED.

  • Name
    progress
    Type
    integer
    Description

    Progress van de taak (0-100).

  • Name
    created_at
    Type
    timestamp
    Description

    Tijdstempel (milliseconden sinds epoch) waarop de taak is aangemaakt.

  • Name
    started_at
    Type
    timestamp
    Description

    Tijdstempel (milliseconden sinds epoch) waarop de taak begon met verwerken. 0 indien niet gestart.

  • Name
    finished_at
    Type
    timestamp
    Description

    Tijdstempel (milliseconden sinds epoch) waarop de taak is voltooid. 0 indien niet voltooid.

  • Name
    expires_at
    Type
    timestamp
    Description

    Tijdstempel (milliseconden sinds epoch) waarop de resultaat-assets van de taak verlopen.

  • Name
    task_error
    Type
    object
    Description

    Foutdetails voor mislukte taken. Zie Fouten voor de volledige task_error-objectreferentie.

  • Name
    consumed_credits
    Type
    integer
    Description

    Het aantal credits dat door deze taak is verbruikt. Aanwezig wanneer de taakstatus PENDING, IN_PROGRESS of SUCCEEDED is. Retourneert 0 voor FAILED-taken (credits worden terugbetaald bij mislukking).

  • Name
    result
    Type
    object
    Description

    Bevat de uitvoer-animatie-URL's als de taak SUCCEEDED.

    • Name
      animation_glb_url
      Type
      string
      Description
      Downloadbare URL voor de animatie in GLB-formaat.
    • Name
      animation_fbx_url
      Type
      string
      Description
      Downloadbare URL voor de animatie in FBX-formaat.
    • Name
      processed_usdz_url
      Type
      string
      Description
      Downloadbare URL voor de verwerkte animatie in USDZ-formaat.
    • Name
      processed_armature_fbx_url
      Type
      string
      Description
      Downloadbare URL voor de verwerkte armature in FBX-formaat.
    • Name
      processed_animation_fps_fbx_url
      Type
      string
      Description
      Downloadbare URL voor de animatie met gewijzigde FPS in FBX-formaat (bijv. als de change_fps-bewerking is gebruikt).
  • Name
    preceding_tasks
    Type
    integer
    Description

    Het aantal voorafgaande taken in de wachtrij. Alleen betekenisvol als de status PENDING is.

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
}