# Automatisches Rigging

> **POST** `/v3/animations/rig`

Fügen Sie einem 3D-Modell automatisch ein Skelett-Rig hinzu.

## Anforderungsparameter

### Anforderungsheader

| Parameter | Typ | Erforderlich | Standard | Beschreibung |
| :-: | :-: | :-: | :-: | :-: |
| Content-Type | Zeichenfolge | Ja | — | `application/json` |
| Authorization | Zeichenfolge | Ja | — | `Bearer {api_key}` |

### Anforderungstext

| Parameter | Typ | Erforderlich | Standard | Beschreibung |
| :-: | :-: | :-: | :-: | :-: |
| input | Zeichenfolge | Ja | — | Modellquelle. Akzeptiert einen task_id, der mit `task_` beginnt, oder einen file_token, der mit `file_` beginnt |
| model | Zeichenfolge | Nein | `rig-v1.0` | Auto-Rigging-Modellversion. Mögliche Werte: `rig-v2.0`, `rig-v1.0` |
| rig_type | Zeichenfolge | Nein | `biped` | Rig-Typ. Wir empfehlen, zuerst `rig-check` aufzurufen, um den empfohlenen Wert zu erhalten. Mögliche Werte: `biped`, `quadruped`, `hexapod`, `octopod`, `avian`, `serpentine`, `aquatic` |
| spec | Zeichenfolge | Nein | `tripo` | Rigging-Spezifikation. Mögliche Werte: `tripo`, `mixamo` |
| out_format | Zeichenfolge | Nein | `glb` | Ausgabeformat. Mögliche Werte: `glb`, `fbx` |

## Fordern Sie Beispiele an

### curl

```bash
curl -X POST https://openapi.tripo3d.ai/v3/animations/rig \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {api_key}" \
  -d '{
    "input": "task_abc123",
    "model": "rig-v2.0",
    "rig_type": "biped",
    "spec": "mixamo",
    "out_format": "glb"
  }'
```

### Python

```python
import requests

url = "https://openapi.tripo3d.ai/v3/animations/rig"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {api_key}"
}
payload = {
    "input": "task_abc123",
    "model": "rig-v2.0",
    "rig_type": "biped",
    "spec": "mixamo",
    "out_format": "glb"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```

### JavaScript

```javascript
const url = "https://openapi.tripo3d.ai/v3/animations/rig";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer {api_key}"
  },
  body: JSON.stringify({
    input: "task_abc123",
    model: "rig-v2.0",
    rig_type: "biped",
    spec: "mixamo",
    out_format: "glb"
  })
});

const data = await response.json();
console.log(data);
```

## Antwort

### Erfolgreiche Antwort

```json
{
  "code": 0,
  "data": {
    "task_id": "task_def456"
  }
}
```

### Antwortfelder

| Parameter | Typ | Beschreibung |
| :-: | :-: | :-: |
| code | ganze Zahl | Statuscode. `0` zeigt Erfolg an |
| data.task_id | Zeichenfolge | Eindeutige Aufgabenkennung, die zum Abfragen des Fortschritts und des Ergebnisses des automatischen Riggings verwendet wird |

## Fehlercodes

| HTTP Statuscode | Fehlercode | Beschreibung | Empfehlung |
| :-: | :-: | :-: | :-: |
| 429 | 2000 | Generationslimit überschritten | Reduzieren Sie die Anforderungsrate und versuchen Sie es später erneut |
| 400 | 2002 | Nicht unterstützter Anforderungsparameter | Überprüfen Sie die Parameternamen und Wertebereiche des Anforderungshauptteils |
| 400 | 2006 | Ungültiger Aufgabentyp der Eingabequelle | Bestätigen Sie, dass task_id einer 3D-Modellaufgabe entspricht |
| 400 | 2007 | Der Status der Quellaufgabe ist nicht erfolgreich | Warten Sie, bis die Quellaufgabe abgeschlossen ist, bevor Sie mit dem automatischen Rigging beginnen |
| 403 | 2010 | Unzureichende Credits | Guthaben aufladen und erneut versuchen |
