# テキストを 3D モデルに変換
> **POST** `/v3/generation/text-to-model`
テキスト プロンプトから 3D モデルを生成します。
## リクエストパラメータ
### リクエストヘッダー
| パラメータ | 種類 | 必須 | デフォルト | 説明 |
| :-: | :-: | :-: | :-: | :-: |
| Content-Type | 文字列 | はい | - | `application/json` |
| Authorization | 文字列 | はい | - | `Bearer {api_key}` |
### リクエストボディ
| パラメータ | 種類 | 必須 | デフォルト | 説明 |
| :-: | :-: | :-: | :-: | :-: |
| prompt | 文字列 | はい | - | テキスト プロンプト、最大 1024 文字 |
| model | 文字列 | いいえ | `tripo-v3.1` | AI モデルのバージョン。サポートされている値: `tripo-p1`、`tripo-turbo`、`tripo-v3.1`、`tripo-v3.0`、`tripo-v2.5`、`tripo-v2.0` |
| negative_prompt | 文字列 | いいえ | - | 否定プロンプト、最大 255 文字 |
| model_seed | 整数 | いいえ | ランダム | ジオメトリ生成用のランダム シード |
| image_seed | 整数 | いいえ | ランダム | テキストから画像への段階のランダム シード |
| face_limit | 整数 | いいえ | アダプティブ | 出力の最大ポリ数 |
| texture | ブール値 | いいえ | `true` | テクスチャ マップを有効にする |
| pbr | ブール値 | いいえ | `true` | PBR マテリアルを有効にします。有効にすると、`texture` は強制的に `true` になります。 |
| texture_seed | 整数 | いいえ | ランダム | テクスチャ生成用のランダム シード |
| texture_quality | 文字列 | いいえ | `standard` | テクスチャの品質。サポートされている値: `standard`、`detailed`、`extreme` |
| geometry_quality | 文字列 | いいえ | `standard` | ジオメトリの品質。 `standard` (バランス)、`detailed` (ウルトラモード) |
| auto_size | ブール値 | いいえ | `false` | モデルを現実世界のメートル単位の寸法に自動的にスケールします |
| quad | ブール値 | いいえ | `false` | クワッドメッシュを出力します。有効にすると、出力形式は強制的に FBX になります。 |
| smart_low_poly | ブール値 | いいえ | `false` | 手作りのトポロジ スタイルでローポリ モデルを生成する |
| generate_parts | ブール値 | いいえ | `false` | 編集可能なセグメント化されたパーツを生成します。 `texture=true`、`pbr=true`、および `quad=true` と相互排他的 |
| compress | 文字列 | いいえ | - | 圧縮タイプ。 `geometry` (meshopt 圧縮) |
次のパラメータは、`model >= tripo-v3.0` の場合にのみ有効です: `texture_quality`、`geometry_quality`、`auto_size`、`quad`、`smart_low_poly`、`generate_parts`、`compress`。
## リクエスト例
### curl
```bash
curl -X POST https://openapi.tripo3d.ai/v3/generation/text-to-model \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {api_key}" \
-d '{
"prompt": "A cat wearing a spacesuit",
"model": "tripo-v3.1",
"texture": true,
"pbr": true,
"texture_quality": "detailed"
}'
```
### Python
```python
import requests
url = "https://openapi.tripo3d.ai/v3/generation/text-to-model"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer {api_key}"
}
payload = {
"prompt": "A cat wearing a spacesuit",
"model": "tripo-v3.1",
"texture": True,
"pbr": True,
"texture_quality": "detailed"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
```
### JavaScript
```javascript
const url = "https://openapi.tripo3d.ai/v3/generation/text-to-model";
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer {api_key}"
},
body: JSON.stringify({
prompt: "A cat wearing a spacesuit",
model: "tripo-v3.1",
texture: true,
pbr: true,
texture_quality: "detailed"
})
});
const data = await response.json();
console.log(data);
```
## 応答
### 成功の応答
```json
{
"code": 0,
"data": {
"task_id": "task_abc123"
}
}
```
### 応答フィールド
| パラメータ | 種類 | 説明 |
| :-: | :-: | :-: |
| code | 整数 | ステータスコード。 `0` は成功を示します |
| data.task_id | 文字列 | 生成の進行状況と結果をクエリするために使用される一意のタスク識別子 |
## エラーコード
| HTTP ステータスコード | エラーコード | 説明 | おすすめ |
| :-: | :-: | :-: | :-: |
| 429 | 2000 | 世代制限を超えました | リクエストの頻度を減らし、後で再試行してください |
| 400 | 2002 | サポートされていないリクエストパラメータです | リクエストボディのパラメータ名と値の範囲を確認してください |
| 400 | 2008 | 入力がコンテンツ ポリシーに違反しています | プロンプトを修正し、ポリシーに違反する説明を削除します。 |
| 403 | 2010 | クレジットが不十分です | クレジットを追加して再試行してください |
| 400 | 2015 | モデルのバージョンが非推奨になりました | `model` を現在サポートされているバージョンにアップグレードします |
| 400 | 2018 | モデルが複雑すぎて再メッシュできません | `face_limit` を下げるか、入力プロンプトを簡素化します |
テキストを 3D モデルに変換
POST /v3/generation/text-to-model
テキスト プロンプトから 3D モデルを生成します。
リクエストパラメータ
リクエストヘッダー
| パラメータ |
種類 |
必須 |
デフォルト |
説明 |
| Content-Type |
文字列 |
はい |
- |
application/json |
| Authorization |
文字列 |
はい |
- |
Bearer {api_key} |
リクエストボディ
| パラメータ |
種類 |
必須 |
デフォルト |
説明 |
| prompt |
文字列 |
はい |
- |
テキスト プロンプト、最大 1024 文字 |
| model |
文字列 |
いいえ |
tripo-v3.1 |
AI モデルのバージョン。サポートされている値: tripo-p1、tripo-turbo、tripo-v3.1、tripo-v3.0、tripo-v2.5、tripo-v2.0 |
| negative_prompt |
文字列 |
いいえ |
- |
否定プロンプト、最大 255 文字 |
| model_seed |
整数 |
いいえ |
ランダム |
ジオメトリ生成用のランダム シード |
| image_seed |
整数 |
いいえ |
ランダム |
テキストから画像への段階のランダム シード |
| face_limit |
整数 |
いいえ |
アダプティブ |
出力の最大ポリ数 |
| texture |
ブール値 |
いいえ |
true |
テクスチャ マップを有効にする |
| pbr |
ブール値 |
いいえ |
true |
PBR マテリアルを有効にします。有効にすると、texture は強制的に true になります。 |
| texture_seed |
整数 |
いいえ |
ランダム |
テクスチャ生成用のランダム シード |
| texture_quality |
文字列 |
いいえ |
standard |
テクスチャの品質。サポートされている値: standard、detailed、extreme |
| geometry_quality |
文字列 |
いいえ |
standard |
ジオメトリの品質。 standard (バランス)、detailed (ウルトラモード) |
| auto_size |
ブール値 |
いいえ |
false |
モデルを現実世界のメートル単位の寸法に自動的にスケールします |
| quad |
ブール値 |
いいえ |
false |
クワッドメッシュを出力します。有効にすると、出力形式は強制的に FBX になります。 |
| smart_low_poly |
ブール値 |
いいえ |
false |
手作りのトポロジ スタイルでローポリ モデルを生成する |
| generate_parts |
ブール値 |
いいえ |
false |
編集可能なセグメント化されたパーツを生成します。 texture=true、pbr=true、および quad=true と相互排他的 |
| compress |
文字列 |
いいえ |
- |
圧縮タイプ。 geometry (meshopt 圧縮) |
次のパラメータは、model >= tripo-v3.0 の場合にのみ有効です: texture_quality、geometry_quality、auto_size、quad、smart_low_poly、generate_parts、compress。
リクエスト例
-cmd">curl -X POST https://openapi.tripo3d.ai/v3/generation/text class="hl-flag">-to-model \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {api_key}" \
-d '{
"prompt": "A cat wearing a spacesuit",
"model": "tripo-v3.1",
"texture": true,
"pbr": true,
"texture_quality": "detailed"}'
import requests
url = "https://openapi.tripo3d.ai/v3/generation/text-to-model"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer {api_key}"
}
payload = {
"prompt": "A cat wearing a spacesuit",
"model": "tripo-v3.1",
"texture": True,
"pbr": True,
"texture_quality": "detailed"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const url = "https://openapi.tripo3d.ai/v3/generation/text-to-model";
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer {api_key}"
},
body: JSON.stringify({
prompt: "A cat wearing a spacesuit",
model: "tripo-v3.1",
texture: true,
pbr: true,
texture_quality: "detailed"
})
});
const data = await response.json();
console.log(data);
応答
成功の応答
{
"code": 0,
"data": {
"task_id": "task_abc123"}
}
応答フィールド
| パラメータ |
種類 |
説明 |
| code |
整数 |
ステータスコード。 0 は成功を示します |
| data.task_id |
文字列 |
生成の進行状況と結果をクエリするために使用される一意のタスク識別子 |
エラーコード
| HTTP ステータスコード |
エラーコード |
説明 |
おすすめ |
| 429 |
2000 |
世代制限を超えました |
リクエストの頻度を減らし、後で再試行してください |
| 400 |
2002 |
サポートされていないリクエストパラメータです |
リクエストボディのパラメータ名と値の範囲を確認してください |
| 400 |
2008 |
入力がコンテンツ ポリシーに違反しています |
プロンプトを修正し、ポリシーに違反する説明を削除します。 |
| 403 |
2010 |
クレジットが不十分です |
クレジットを追加して再試行してください |
| 400 |
2015 |
モデルのバージョンが非推奨になりました |
model を現在サポートされているバージョンにアップグレードします |
| 400 |
2018 |
モデルが複雑すぎて再メッシュできません |
face_limit を下げるか、入力プロンプトを簡素化します |