기본 URL
https://gwanggo.ai/api/v1모든 요청과 응답은 JSON이에요.
빠른 시작
- 1
API 키 발급
대시보드의 API 키 페이지에서 키를 발급해요. 키는 gwk_로 시작하고 발급할 때 한 번만 보여요.
- 2
생성 요청
생성 요청은 바로 id와 쓴 크레딧을 돌려줘요. 결과물은 아직 없어요.
- 3
결과 받기
id로 작업 상태를 조회해요. COMPLETED가 되면 result_url에 결과 파일이 있어요.
export GWANGGO_API_KEY="gwk_..."
# 1. Submit: credits are charged now, the result comes later
curl -X POST https://gwanggo.ai/api/v1/generate/image \
-H "Authorization: Bearer $GWANGGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2", "prompt": "A neon sneaker on a wet street at night", "aspectRatio": "16:9", "quality": "medium"}'
# {"id": "8f6c2d1e-...", "task_id": "...", "credits_used": 2}
# 2. Poll with the id until status is COMPLETED or FAILED
curl https://gwanggo.ai/api/v1/tasks/8f6c2d1e-... \
-H "Authorization: Bearer $GWANGGO_API_KEY"Node.js 예제
const BASE = 'https://gwanggo.ai/api/v1'
const headers = {
Authorization: `Bearer ${process.env.GWANGGO_API_KEY}`,
'Content-Type': 'application/json',
}
async function generateImage(prompt) {
const res = await fetch(`${BASE}/generate/image`, {
method: 'POST',
headers,
body: JSON.stringify({ model: 'gpt-image-2', prompt, aspectRatio: '1:1', quality: 'medium' }),
})
const job = await res.json()
if (!res.ok) throw new Error(`${job.error.code}: ${job.error.message}`)
while (true) {
await new Promise((r) => setTimeout(r, 4000))
const task = await (await fetch(`${BASE}/tasks/${job.id}`, { headers })).json()
if (task.status === 'COMPLETED') return task.result_url
if (task.status === 'FAILED') throw new Error(task.error) // credits are refunded
}
}
generateImage('A neon sneaker on a wet street at night').then(console.log)인증
모든 요청의 Authorization 헤더에 API 키를 Bearer 토큰으로 보내요. 모델 목록(GET /models)만 키 없이 쓸 수 있어요.
Authorization: Bearer gwk_...키는 서버에만 두세요. 브라우저나 앱 코드에 넣으면 누구나 내 크레딧을 쓸 수 있어요. 새어 나간 키는 API 키 페이지에서 바로 폐기해요.
작업 흐름
생성은 비동기예요. 요청하면 크레딧이 차감되고 id가 와요. 그 id로 GET /tasks/{id}를 조회해서 상태를 확인해요.
| status | 의미 |
|---|---|
| PENDING | 접수됨 |
| IN_QUEUE | 생성 대기 중 |
| IN_PROGRESS | 생성 중 |
| COMPLETED | 완료. result_url에 결과 파일, 영상은 thumbnail_url도 있어요 |
| FAILED | 실패. error에 이유가 있고 크레딧은 자동으로 돌아와요 |
이미지는 3~5초, 영상과 3D는 10초 간격으로 조회하면 충분해요. 영상과 3D는 몇 분 걸릴 수 있어요.
요청 본문
세 생성 엔드포인트는 같은 형식을 써요. model 말고는 모델마다 받는 값이 달라요. 가격에 영향을 주는 값(quality, resolution, duration, tier)은 꼭 보내요. 빠지면 400 오류가 나요.
| 키 | 타입 | 설명 |
|---|---|---|
| model | string | 모델 slug. GET /models의 slug 값이에요. 필수 |
| prompt | string | 만들 내용. 이미지로 3D를 만들 때 말고는 필수 |
| imageUrl | string | 참고 이미지나 시작 프레임. 영상과 3D 이미지 모델은 이 키 하나로 받아요 |
| imageUrls | string[] | 참고 이미지 여러 장 (GPT Image, Seedance 1.5 Pro, Seedance 2.5) |
| endImageUrl | string | 마지막 프레임 (MiniMax H3, Kling O3, Wan 3.0) |
| videoUrl | string | 동작을 따라 할 원본 영상 (kling-3-mc) |
| aspectRatio | string | 화면 비율. 예: "16:9", "9:16", "1:1" |
| quality | string | 품질 등급. 이미지는 low, medium, high 같은 값, 3D는 none, standard, detailed |
| resolution | string | 영상 해상도. 예: "720p" |
| duration | number | 영상 길이(초) |
| tier | string | standard 또는 pro. 등급 가격이 있는 모델만 |
| generateAudio | boolean | 영상에 소리를 같이 만들지 |
| style, faceLimit, pbr, pose | 3D | 3D 옵션: 스타일, 폴리곤 수, PBR 머티리얼, 리깅용 자세(a-pose, t-pose) |
모델별 옵션 찾기
GET /models의 form_config.fields가 모델이 받는 값과 선택지, 기본값이에요. 필드에 field_name이 있으면 그 이름이 키예요. 없으면 아래 표로 바꿔요.
| form_config 필드 type | 요청 키 |
|---|---|
| prompt | prompt |
| image_upload | imageUrl |
| multi_image_upload | imageUrls |
| video_upload | videoUrl |
| aspect_ratio | aspectRatio |
| quality | quality |
| resolution | resolution |
| duration | duration |
| tier | tier |
크레딧
크레딧은 요청할 때 차감되고, 생성이 실패하면 자동으로 돌아와요. 가격은 모델의 credit_config로 계산해요. 잔액은 GET /me로 확인해요.
| credit_config type | 계산 | 예 |
|---|---|---|
| fixed | cost | {"type":"fixed","cost":3} -> 3 |
| quality | costs[quality] | gpt-image-2, quality "medium" -> 2 |
| per_second | (generateAudio ? audio_rates : rates)[resolution] x duration | seedance-2.0, 720p, 5 s -> 6 x 5 = 30 |
| tier_per_second | tiers[tier][resolution] x duration | kling-3, pro, 720p, 5 s -> 6 x 5 = 30 |
오류
오류는 HTTP 상태 코드와 함께 아래 형식으로 와요. code로 분기하고 message는 사람에게 보여 주세요.
| 상태 | code | 의미 |
|---|---|---|
| 400 | invalid_request | 본문이 없거나 잘못됐어요. 모르는 모델, 빠진 필수 값, 가격 옵션 누락 포함 |
| 400 | unsupported | 공개 API에서 쓸 수 없는 기능이에요 |
| 401 | unauthorized | API 키가 없거나 틀렸거나 폐기됐어요 |
| 402 | insufficient_credits | 크레딧이 부족해요. required, available, billing_url이 같이 와요 |
| 404 | not_found | 작업이나 리소스를 찾을 수 없어요. 다른 계정의 id도 여기에 해당해요 |
| 500 | provider_error | 생성 업체 쪽 오류예요. 크레딧은 자동으로 돌아와요. 잠시 후 다시 시도해요 |
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits",
"required": 30,
"available": 12,
"billing_url": "https://gwanggo.ai/dashboard/subscription"
}
}엔드포인트
/models키 없이 사용모델 목록
쓸 수 있는 모델과 각 모델의 옵션(form_config), 가격(credit_config)이에요. is_coming_soon이 false인 모델만 쓰세요.
curl https://gwanggo.ai/api/v1/models{
"models": [
{
"slug": "gpt-image-2",
"name": "GPT Image 2",
"type": "image",
"creator": "OpenAI",
"credit_config": { "type": "quality", "costs": { "low": 1, "medium": 2, "high": 7 } },
"form_config": {
"fields": [
{ "type": "prompt", "required": true },
{ "type": "image_upload", "required": false },
{ "type": "aspect_ratio", "default": "1:1", "options": ["1:1", "4:3", "3:4", "16:9", "9:16"] },
{ "type": "quality", "default": "high", "options": ["low", "medium", "high"] }
]
},
"is_coming_soon": false
}
]
}/meAPI 키 필요내 계정
키 주인의 계정 id, 이메일, 남은 크레딧이에요.
curl https://gwanggo.ai/api/v1/me \
-H "Authorization: Bearer $GWANGGO_API_KEY"{ "id": "2b1f0c9e-...", "email": "you@example.com", "credits": 982 }/uploadAPI 키 필요파일 업로드
내 컴퓨터의 이미지나 영상을 생성 요청에 쓰려면 먼저 올려요. uploadUrl로 파일을 PUT하고 publicUrl을 imageUrl이나 videoUrl에 넣어요. uploadUrl은 5분 동안 유효해요.
contentTypestring필수- image/* 또는 video/*
extstring선택- 확장자. 없으면 contentType에서 정해요
curl -X POST https://gwanggo.ai/api/v1/upload \
-H "Authorization: Bearer $GWANGGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contentType": "image/png"}'
# Then upload the file bytes to uploadUrl (within 5 minutes)
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: image/png" \
--data-binary @photo.png{
"uploadUrl": "https://...r2.cloudflarestorage.com/...?X-Amz-Signature=...",
"publicUrl": "https://.../studio-uploads/.../5c1e....png"
}/generate/imageAPI 키 필요이미지 생성
텍스트나 참고 이미지로 이미지를 만들어요. 응답의 id로 결과를 조회해요.
curl -X POST https://gwanggo.ai/api/v1/generate/image \
-H "Authorization: Bearer $GWANGGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A neon sneaker on a wet street at night",
"aspectRatio": "16:9",
"quality": "medium"
}'{ "id": "8f6c2d1e-...", "task_id": "fal-gptimg2:...", "credits_used": 2 }/generate/videoAPI 키 필요영상 생성
텍스트나 시작 이미지로 영상을 만들어요. 가격은 해상도와 길이로 정해져요.
curl -X POST https://gwanggo.ai/api/v1/generate/video \
-H "Authorization: Bearer $GWANGGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0",
"prompt": "The sneaker spins slowly, camera pushes in",
"imageUrl": "https://.../studio-uploads/.../sneaker.png",
"resolution": "720p",
"duration": 5,
"aspectRatio": "9:16",
"generateAudio": true
}'{ "id": "41d7a0b3-...", "task_id": "...", "credits_used": 30 }/generate/3dAPI 키 필요3D 생성
텍스트나 이미지로 GLB 3D 모델을 만들어요. 이미지 모델(-image)은 imageUrl이 필수예요.
curl -X POST https://gwanggo.ai/api/v1/generate/3d \
-H "Authorization: Bearer $GWANGGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tripo-h31-image",
"imageUrl": "https://.../studio-uploads/.../robot.png",
"style": "roblox",
"quality": "standard"
}'{ "id": "c93e5f20-...", "task_id": "...", "credits_used": 10 }/tasks/{id}API 키 필요작업 상태
생성 결과를 조회해요. 생성 응답의 id를 쓰고, task_id는 쓰지 않아요.
idstring필수- 생성 요청이 돌려준 id
curl https://gwanggo.ai/api/v1/tasks/8f6c2d1e-... \
-H "Authorization: Bearer $GWANGGO_API_KEY"{
"id": "8f6c2d1e-...",
"type": "image",
"model": "gpt-image-2",
"status": "COMPLETED",
"result_url": "https://.../8f6c2d1e.png",
"credits_used": 2
}/generationsAPI 키 필요생성 기록
내가 만든 결과물을 최신순으로 가져와요.
typeimage | video | 3d선택- 종류로 거르기. 없으면 전체
pagenumber선택- 1부터 시작. 기본 1
pageSizenumber선택- 최대 50. 기본 24
curl "https://gwanggo.ai/api/v1/generations?type=image&page=1&pageSize=24" \
-H "Authorization: Bearer $GWANGGO_API_KEY"{
"generations": [
{
"id": "8f6c2d1e-...",
"type": "image",
"model": "gpt-image-2",
"prompt": "A neon sneaker on a wet street at night",
"status": "COMPLETED",
"result_url": "https://.../8f6c2d1e.png",
"thumbnail_url": null,
"credits_used": 2,
"created_at": "2026-11-21T09:12:44.000Z"
}
],
"pagination": { "page": 1, "pageSize": 24, "totalCount": 57, "totalPages": 3, "hasMore": true }
}지금 키를 발급하고 첫 요청을 보내 보세요
가입하면 35크레딧을 드려요. 웹에서 쓰는 크레딧을 API에서 그대로 써요.