Skip to main content

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/v1

Every request and response is JSON.

Quickstart

  1. 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. 2

    Submit

    A generate call returns an id and the credits used right away. The file is not ready yet.

  3. 3

    Fetch the result

    Poll the task with that id. When it is COMPLETED, result_url holds the file.

curl
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

generate.mjs
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.

statusMeaning
PENDINGAccepted
IN_QUEUEWaiting for the model
IN_PROGRESSGenerating
COMPLETEDDone. result_url holds the file; videos also have thumbnail_url
FAILEDFailed. 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.

KeyTypeDescription
modelstringModel slug from GET /models. Required
promptstringWhat to make. Required except for image-to-3D
imageUrlstringReference image or start frame. Video and image-to-3D models all take it under this key
imageUrlsstring[]Several reference images (GPT Image, Seedance 1.5 Pro, Seedance 2.5)
endImageUrlstringLast frame (MiniMax H3, Kling O3, Wan 3.0)
videoUrlstringSource video whose motion is copied (kling-3-mc)
aspectRatiostringAspect ratio, e.g. "16:9", "9:16", "1:1"
qualitystringQuality level: values such as low, medium, high for images; none, standard, detailed for 3D
resolutionstringVideo resolution, e.g. "720p"
durationnumberVideo length in seconds
tierstringstandard or pro, for models with tier pricing
generateAudiobooleanGenerate sound with the video
style, faceLimit, pbr, pose3D3D 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 typeRequest key
promptprompt
image_uploadimageUrl
multi_image_uploadimageUrls
video_uploadvideoUrl
aspect_ratioaspectRatio
qualityquality
resolutionresolution
durationduration
tiertier

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 typePriceExample
fixedcost{"type":"fixed","cost":3} -> 3
qualitycosts[quality]gpt-image-2, quality "medium" -> 2
per_second(generateAudio ? audio_rates : rates)[resolution] x durationseedance-2.0, 720p, 5 s -> 6 x 5 = 30
tier_per_secondtiers[tier][resolution] x durationkling-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.

StatuscodeMeaning
400invalid_requestMissing or invalid body: unknown model, missing required value or price option
400unsupportedThe feature is not available in the public API
401unauthorizedAPI key missing, wrong or revoked
402insufficient_creditsNot enough credits; required, available and billing_url are included
404not_foundTask or resource not found, including ids of other accounts
500provider_errorThe model provider failed; the credits are refunded. Try again shortly
402
{
  "error": {
    "code": "insufficient_credits",
    "message": "Not enough credits",
    "required": 30,
    "available": 12,
    "billing_url": "https://gwanggo.ai/dashboard/subscription"
  }
}

Endpoints

GET/modelsNo key

List models

Every available model with its options (form_config) and price (credit_config). Use models where is_coming_soon is false.

Request
curl https://gwanggo.ai/api/v1/models
Response
{
  "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
    }
  ]
}
GET/meAPI key

Your account

Account id, email and credit balance of the key owner.

Request
curl https://gwanggo.ai/api/v1/me \
  -H "Authorization: Bearer $GWANGGO_API_KEY"
Response
{ "id": "2b1f0c9e-...", "email": "you@example.com", "credits": 982 }
POST/uploadAPI key

Upload 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
Request
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
Response
{
  "uploadUrl": "https://...r2.cloudflarestorage.com/...?X-Amz-Signature=...",
  "publicUrl": "https://.../studio-uploads/.../5c1e....png"
}
POST/generate/imageAPI key

Generate an image

Make an image from text or a reference image. Use the returned id to fetch the result.

Request
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"
  }'
Response
{ "id": "8f6c2d1e-...", "task_id": "fal-gptimg2:...", "credits_used": 2 }
POST/generate/videoAPI key

Generate a video

Make a video from text or a start image. The price depends on resolution and length.

Request
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
  }'
Response
{ "id": "41d7a0b3-...", "task_id": "...", "credits_used": 30 }
POST/generate/3dAPI key

Generate a 3D model

Make a GLB model from text or an image. Image models (-image) require imageUrl.

Request
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"
  }'
Response
{ "id": "c93e5f20-...", "task_id": "...", "credits_used": 10 }
GET/tasks/{id}API key

Task status

Fetch a generation result. Use the id from the generate response, not task_id.

idstringrequired
The id returned by the generate call
Request
curl https://gwanggo.ai/api/v1/tasks/8f6c2d1e-... \
  -H "Authorization: Bearer $GWANGGO_API_KEY"
Response
{
  "id": "8f6c2d1e-...",
  "type": "image",
  "model": "gpt-image-2",
  "status": "COMPLETED",
  "result_url": "https://.../8f6c2d1e.png",
  "credits_used": 2
}
GET/generationsAPI key

Generation 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
Request
curl "https://gwanggo.ai/api/v1/generations?type=image&page=1&pageSize=24" \
  -H "Authorization: Bearer $GWANGGO_API_KEY"
Response
{
  "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.

Get an API key