v1
gwanggo REST API
Generate images, videos and 3D models from your own product. The same models and credits as the web app, over HTTP.
Base URL
https://gwanggo.ai/api/v1Every request and response is JSON.
Quickstart
- 1
Get a key
Create a key on the API keys page of your dashboard. Keys start with gwk_ and are shown only once.
- 2
Submit
A generate call returns an id and the credits used right away. The file is not ready yet.
- 3
Fetch the result
Poll the task with that id. When it is COMPLETED, result_url holds the file.
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 example
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)Authentication
Send your API key as a Bearer token in the Authorization header of every request. Only the model list (GET /models) works without a key.
Authorization: Bearer gwk_...Keep keys on your server. A key in browser or app code lets anyone spend your credits. Revoke a leaked key on the API keys page at once.
How a generation runs
Generation is asynchronous. A request charges the credits and returns an id; call GET /tasks/{id} with it to follow the status.
| status | Meaning |
|---|---|
| PENDING | Accepted |
| IN_QUEUE | Waiting for the model |
| IN_PROGRESS | Generating |
| COMPLETED | Done. result_url holds the file; videos also have thumbnail_url |
| FAILED | Failed. error says why, and the credits are refunded automatically |
Poll every 3-5 s for images and every 10 s for video and 3D. Video and 3D can take a few minutes.
Request body
The three generate endpoints share one format. Apart from model, the accepted keys depend on the model. Always send the options that set the price (quality, resolution, duration, tier): a request without them fails with 400.
| Key | Type | Description |
|---|---|---|
| model | string | Model slug from GET /models. Required |
| prompt | string | What to make. Required except for image-to-3D |
| imageUrl | string | Reference image or start frame. Video and image-to-3D models all take it under this key |
| imageUrls | string[] | Several reference images (GPT Image, Seedance 1.5 Pro, Seedance 2.5) |
| endImageUrl | string | Last frame (MiniMax H3, Kling O3, Wan 3.0) |
| videoUrl | string | Source video whose motion is copied (kling-3-mc) |
| aspectRatio | string | Aspect ratio, e.g. "16:9", "9:16", "1:1" |
| quality | string | Quality level: values such as low, medium, high for images; none, standard, detailed for 3D |
| resolution | string | Video resolution, e.g. "720p" |
| duration | number | Video length in seconds |
| tier | string | standard or pro, for models with tier pricing |
| generateAudio | boolean | Generate sound with the video |
| style, faceLimit, pbr, pose | 3D | 3D options: style, polygon budget, PBR materials, rig pose (a-pose, t-pose) |
Finding the options of a model
form_config.fields in GET /models lists what a model accepts, with its choices and defaults. A field with field_name uses that name as the key; otherwise map its type with this table.
| form_config field type | Request key |
|---|---|
| prompt | prompt |
| image_upload | imageUrl |
| multi_image_upload | imageUrls |
| video_upload | videoUrl |
| aspect_ratio | aspectRatio |
| quality | quality |
| resolution | resolution |
| duration | duration |
| tier | tier |
Credits
Credits are charged when you submit and refunded automatically if the generation fails. The price comes from the model credit_config. Check your balance with GET /me.
| credit_config type | Price | Example |
|---|---|---|
| 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 |
Errors
Errors come with an HTTP status and this body. Branch on code; message is a human-readable explanation and may be in Korean.
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_request | Missing or invalid body: unknown model, missing required value or price option |
| 400 | unsupported | The feature is not available in the public API |
| 401 | unauthorized | API key missing, wrong or revoked |
| 402 | insufficient_credits | Not enough credits; required, available and billing_url are included |
| 404 | not_found | Task or resource not found, including ids of other accounts |
| 500 | provider_error | The model provider failed; the credits are refunded. Try again shortly |
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits",
"required": 30,
"available": 12,
"billing_url": "https://gwanggo.ai/dashboard/subscription"
}
}Endpoints
/modelsNo keyList models
Every available model with its options (form_config) and price (credit_config). Use models where is_coming_soon is 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 keyYour account
Account id, email and credit balance of the key owner.
curl https://gwanggo.ai/api/v1/me \
-H "Authorization: Bearer $GWANGGO_API_KEY"{ "id": "2b1f0c9e-...", "email": "you@example.com", "credits": 982 }/uploadAPI keyUpload a file
Upload a local image or video before using it in a generate call. PUT the file to uploadUrl, then pass publicUrl as imageUrl or videoUrl. uploadUrl is valid for 5 minutes.
contentTypestringrequired- image/* or video/*
extstringoptional- File extension; taken from contentType when omitted
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 keyGenerate an image
Make an image from text or a reference image. Use the returned id to fetch the result.
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 keyGenerate a video
Make a video from text or a start image. The price depends on resolution and length.
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 keyGenerate a 3D model
Make a GLB model from text or an image. Image models (-image) require 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 keyTask status
Fetch a generation result. Use the id from the generate response, not task_id.
idstringrequired- The id returned by the generate call
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 keyGeneration history
Your generations, newest first.
typeimage | video | 3doptional- Filter by kind; all when omitted
pagenumberoptional- Starts at 1. Default 1
pageSizenumberoptional- Up to 50. Default 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 }
}Create a key and send your first request
New accounts get 35 credits. The API spends the same credits as the web app.