# モデルのリテクスチャリング

> **POST** `/v3/models/texture`

既存のモデルのテクスチャ マップを再生成します。

## リクエストパラメータ

### リクエストヘッダー

| パラメータ | 種類 | 必須 | デフォルト | 説明 |
| :-: | :-: | :-: | :-: | :-: |
| Content-Type | 文字列 | はい | - | `application/json` |
| Authorization | 文字列 | はい | - | `Bearer {api_key}` |

### リクエストボディ

| パラメータ | 種類 | 必須 | デフォルト | 説明 |
| :-: | :-: | :-: | :-: | :-: |
| input | 文字列 | はい | - | モデルソース。 `task_` で始まる task_id、`file_` で始まる file_token、または `http(s)://` で始まる URL を受け入れます。 |
| model | 文字列 | いいえ | 最新バージョン | AI モデル バージョン |
| texture_seed | 整数 | いいえ | ランダム | テクスチャ生成用のランダム シード |
| texture_quality | 文字列 | いいえ | `standard` | テクスチャの品質。使用可能な値: `standard`、`detailed`、`extreme` |
| pbr | ブール値 | いいえ | `true` | PBR マテリアルを有効にする |

## リクエスト例

### curl

```bash
curl -X POST https://openapi.tripo3d.ai/v3/models/texture \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {api_key}" \
  -d '{
    "input": "task_abc123",
    "texture_quality": "detailed",
    "pbr": true
  }'
```

### Python

```python
import requests

url = "https://openapi.tripo3d.ai/v3/models/texture"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {api_key}"
}
payload = {
    "input": "task_abc123",
    "texture_quality": "detailed",
    "pbr": True
}

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

### JavaScript

```javascript
const url = "https://openapi.tripo3d.ai/v3/models/texture";

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer {api_key}"
  },
  body: JSON.stringify({
    input: "task_abc123",
    texture_quality: "detailed",
    pbr: true
  })
});

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

## 応答

### 成功した応答

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

### 応答フィールド

| パラメータ | 種類 | 説明 |
| :-: | :-: | :-: |
| code | 整数 | ステータスコード。 `0` は成功を示します |
| data.task_id | 文字列 | 生成の進行状況と結果をクエリするために使用される一意のタスク識別子 |

## エラーコード

| HTTP ステータスコード | エラーコード | 説明 | おすすめ |
| :-: | :-: | :-: | :-: |
| 429 | 2000 | 世代制限を超えました | リクエスト率を下げて後で再試行してください |
| 400 | 2002 | サポートされていないリクエストパラメータ | リクエストボディのパラメータ名と値の範囲を確認してください |
| 400 | 2006 | 入力ソースのタスクタイプが無効です | `task_id` のタスク タイプが正しいことを確認します。 |
| 400 | 2007 | ソースタスクが正常に完了しませんでした | リテクスチャを開始する前に、ソース タスクが完了するのを待ちます。 |
| 403 | 2010 | クレジットが不十分です | クレジットを補充して再試行してください |
