curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-2.0",
"prompt": "햇살 아래 낮잠 자는 귀여운 주황색 고양이"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "qwen-image-2.0",
"prompt": "햇살 아래 낮잠 자는 귀여운 주황색 고양이"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "qwen-image-2.0",
prompt: "햇살 아래 낮잠 자는 귀여운 주황색 고양이",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "잘못된 요청 매개변수",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증 실패, API 키를 확인하세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "잔액 부족, 충전해 주세요",
"type": "payment_required"
}
}
Qwen Image 2.0
Qwen Image 2.0 이미지 생성
- 비동기 처리 모드, 후속 쿼리를 위한 작업 ID 반환
- 텍스트-이미지, 이미지-이미지 등 다양한 생성 모드 지원
- 1K/2K 해상도 등급 지원, 최대 6장 이미지 생성
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-2.0",
"prompt": "햇살 아래 낮잠 자는 귀여운 주황색 고양이"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "qwen-image-2.0",
"prompt": "햇살 아래 낮잠 자는 귀여운 주황색 고양이"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "qwen-image-2.0",
prompt: "햇살 아래 낮잠 자는 귀여운 주황색 고양이",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "잘못된 요청 매개변수",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증 실패, API 키를 확인하세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "잔액 부족, 충전해 주세요",
"type": "payment_required"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-2.0",
"prompt": "햇살 아래 낮잠 자는 귀여운 주황색 고양이"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "qwen-image-2.0",
"prompt": "햇살 아래 낮잠 자는 귀여운 주황색 고양이"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "qwen-image-2.0",
prompt: "햇살 아래 낮잠 자는 귀여운 주황색 고양이",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "잘못된 요청 매개변수",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "인증 실패, API 키를 확인하세요",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "잔액 부족, 충전해 주세요",
"type": "payment_required"
}
}
지원되는 모델
| 모델명 | 설명 | 최대 장수 | 과금 방식 |
|---|---|---|---|
qwen-image-2.0 | 표준 버전, 품질과 성능의 균형 | 6장 | 고정 가격 |
qwen-image-2.0-pro | Pro 버전, 텍스트 렌더링이 강력하고 사실적 질감이 더 세밀 | 6장 | 고정 가격 |
인증
string
필수
모든 엔드포인트는 Bearer Token 인증이 필요합니다API Key 받기:API Key 관리 페이지에서 API Key를 받으세요요청 헤더에 추가:
Authorization: Bearer YOUR_API_KEY
Body
string
필수
모델 이름
qwen-image-2.0- 표준 버전, 품질과 성능의 균형qwen-image-2.0-pro- Pro 버전, 텍스트 렌더링이 강력하고 사실적 질감이 더 세밀
boolean
기본값:"false"
이미지 작업을 제출하기 전에 콘텐츠 검토를 실행할지 여부를 지정합니다.
true:omni-moderation-latest로 프롬프트와 입력 이미지를 검토false또는 생략: 검토 요청을 보내지 않으며 검토 비용이나 지연이 추가되지 않음(기본값)
string
필수
이미지 생성을 위한 텍스트 설명, 최대 800자
string
기본값:"1:1"
이미지 가로세로 비율지원되는 가로세로 비율:
1:1- 정사각형 (기본값)4:3- 가로 4:33:4- 세로 3:416:9- 가로 와이드스크린9:16- 세로 전체화면3:2- 가로 3:22:3- 세로 2:3
string
기본값:"1K"
해상도 등급
1K- 표준 해상도 (기본값)2K- 고화질 해상도
integer
기본값:"1"
생성할 이미지 수범위: 1-6
string
네거티브 프롬프트 (나타나지 않기를 원하는 콘텐츠), 최대 500자
array
참조 이미지 URL 배열 (이미지-이미지 모드)제한:
- 공개적으로 접근 가능한 URL이어야 함
- Base64 형식은 지원되지 않음
해상도 대조표
size(비율) + resolution(해상도 등급) 조합으로 출력 크기를 제어합니다.
| 비율 | 1K 등급 | 2K 등급 |
|---|---|---|
1:1 | 1024×1024 | 2048×2048 |
4:3 | 1152×864 | 2048×1536 |
3:4 | 864×1152 | 1536×2048 |
16:9 | 1280×720 | 2048×1152 |
9:16 | 720×1280 | 1152×2048 |
3:2 | 1248×832 | 2048×1360 |
2:3 | 832×1248 | 1360×2048 |
size만 전달 → 기본 1K 등급:{"size": "16:9"}→ 1280×720size+resolution전달 → 지정 등급:{"size": "16:9", "resolution": "2K"}→ 2048×1152
사용 예시
텍스트-이미지 (최소 요청){
"model": "qwen-image-2.0",
"prompt": "햇살 아래 낮잠 자는 귀여운 주황색 고양이"
}
{
"model": "qwen-image-2.0-pro",
"prompt": "사이버펑크 스타일의 미래 도시 야경, 네온 불빛이 깜빡임",
"size": "16:9",
"n": 4
}
{
"model": "qwen-image-2.0-pro",
"prompt": "정교한 음식 사진, 초밥 모듬",
"size": "4:3",
"resolution": "2K",
"n": 2
}
{
"model": "qwen-image-2.0",
"prompt": "배경을 해변 일몰로 변경",
"image_urls": ["https://example.com/my-photo.jpg"]
}
Response
integer
응답 상태 코드
주의사항
- 비동기 처리: 제출 후
task_id가 반환됩니다. 결과를 얻으려면/v1/tasks/{task_id}를 폴링하세요 - 이미지 저장: 생성된 이미지는 플랫폼 CDN에 미러링되어 장기간 유효합니다
- 과금 규칙: 성공적으로 생성된 이미지 수에 따라 과금, 실패 시 과금되지 않음
- 이미지 URL 요구사항: 입력 이미지는 공개적으로 접근 가능한 URL이어야 합니다, base64는 지원되지 않습니다