# 텍스트를 이미지로
> **POST** `/v3/generation/text-to-image`
텍스트 프롬프트에서 이미지를 생성합니다.
## 요청 매개변수
### 요청 헤더
| 매개변수 | 유형 | 필수 | 기본값 | 설명 |
| :-: | :-: | :-: | :-: | :-: |
| Content-Type | 문자열 | 예 | - | `application/json` |
| Authorization | 문자열 | 예 | - | `Bearer {api_key}` |
### 요청 본문
| 매개변수 | 유형 | 필수 | 기본값 | 설명 |
| :-: | :-: | :-: | :-: | :-: |
| prompt | 문자열 | 예 | - | 텍스트 프롬프트, 최대 1024자 |
| model | 문자열 | 아니요 | `seedream_v4` | 이미지 모델. 지원되는 값: `seedream_v5`, `seedream_v4`, `gemini-2.5-flash`, `gemini-3-pro`, `gemini-3.1-flash`, `chat_image_1`, `chat_image_1.5`, `chat_image_2`, `chat_image_2.5_flare`, `chat_image_2.5_sunburst` |
| quality | 문자열 | 아니요 | `low` | 품질 등급. `chat_image_2`(`low`, `medium`, `high`) 및 `chat_image_2.5_flare` / `chat_image_2.5_sunburst`(추가로 `xhigh`, `max`)만 지원합니다. 생략하면 `low`와 같으며 `auto`는 지원하지 않습니다. `high`/`xhigh`/`max`는 크레딧이 더 소모됩니다. |
| background | 문자열 | 아니요 | - | 배경 처리 방식. `chat_image_2.5_flare` / `chat_image_2.5_sunburst`만 지원: `auto`, `opaque`, `transparent`. 다른 모델에서는 오류 없이 무시됩니다. `transparent`는 `output_format=png`가 필요합니다(JPEG는 알파 채널 미지원). |
| template | 문자열 | 아니요 | - | 템플릿 이름. 지원되는 값: `asset_extraction`, `character_completion`, `t_pose`, `head_extraction`, `3d_enhance`, `variants`, `print_clay`, `figure` |
| t_pose | 부울 | 아니요 | `false` | T-포즈로 변환 |
| sketch_to_render | 부울 | 아니요 | `false` | 스케치를 렌더링된 이미지로 변환 |
## 요청 예시
### curl
```bash
curl -X POST https://openapi.tripo3d.ai/v3/generation/text-to-image \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {api_key}" \
-d '{
"prompt": "A cat wearing a spacesuit, cyberpunk style",
"model": "seedream-v4"
}'
```
### Python
```python
import requests
url = "https://openapi.tripo3d.ai/v3/generation/text-to-image"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer {api_key}"
}
payload = {
"prompt": "A cat wearing a spacesuit, cyberpunk style",
"model": "seedream-v4"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
```
### JavaScript
```javascript
const url = "https://openapi.tripo3d.ai/v3/generation/text-to-image";
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, cyberpunk style",
model: "seedream-v4"
})
});
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`를 현재 지원되는 버전으로 업그레이드하세요. |
텍스트를 이미지로
POST /v3/generation/text-to-image
텍스트 프롬프트에서 이미지를 생성합니다.
요청 매개변수
요청 헤더
매개변수
유형
필수
기본값
설명
Content-Type
문자열
예
-
application/json
Authorization
문자열
예
-
Bearer {api_key}
요청 본문
매개변수
유형
필수
기본값
설명
prompt
문자열
예
-
텍스트 프롬프트, 최대 1024자
model
문자열
아니요
seedream_v4
이미지 모델. 지원되는 값: seedream_v5, seedream_v4, gemini-2.5-flash, gemini-3-pro, gemini-3.1-flash, chat_image_1, chat_image_1.5, chat_image_2, chat_image_2.5_flare, chat_image_2.5_sunburst
quality
문자열
아니요
low
품질 등급. chat_image_2(low, medium, high) 및 chat_image_2.5_flare / chat_image_2.5_sunburst(추가로 xhigh, max)만 지원합니다. 생략하면 low와 같으며 auto는 지원하지 않습니다. high/xhigh/max는 크레딧이 더 소모됩니다.
background
문자열
아니요
-
배경 처리 방식. chat_image_2.5_flare / chat_image_2.5_sunburst만 지원: auto, opaque, transparent. 다른 모델에서는 오류 없이 무시됩니다. transparent는 output_format=png가 필요합니다(JPEG는 알파 채널 미지원).
template
문자열
아니요
-
템플릿 이름. 지원되는 값: asset_extraction, character_completion, t_pose, head_extraction, 3d_enhance, variants, print_clay, figure
t_pose
부울
아니요
false
T-포즈로 변환
sketch_to_render
부울
아니요
false
스케치를 렌더링된 이미지로 변환
요청 예시
curl -X POST https://openapi.tripo3d.ai/v3/generation/text-to-image \
-H "Content-Type : application/json" \
-H "Authorization: Bearer {api_key}" \
-d '{
"prompt" : "A cat wearing a spacesuit, cyberpunk style" ,
"model" : "seedream-v4"
}'
import requests
url = "https://openapi.tripo3d.ai/v3/generation/text-to-image"
headers = {
"Content-Type" : "application/json" ,
"Authorization" : "Bearer {api_key}"
}
payload = {
"prompt" : "A cat wearing a spacesuit, cyberpunk style" ,
"model" : "seedream-v4"
}
response = requests .post(url, headers=headers, json =payload)
print (response.json ())
const url = "https://openapi.tripo3d.ai/v3/generation/text-to-image" ;
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, cyberpunk style" ,
model: "seedream-v4"
})
});
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를 현재 지원되는 버전으로 업그레이드하세요.
이전 Gaussian Splat에 대한 이미지다음 이미지를 이미지로 이 페이지에서
요청 매개변수 요청 예시 응답 오류 코드