HTTP API

Use the API to generate assets and check job status.

API Key header
X-API-Key

Create and manage keys in API Keys.

Quickstart (Image)
curl -s -X POST 'https://api.gamelabstudio.co/v1/generate/image'   -H 'X-API-Key: YOUR_API_KEY'   -F 'prompt=low poly treasure chest, 3/4 view'   -F 'transparent_bg=true'   -F 'chroma_key_hex=#FF00FF'   -F 'width=512'   -F 'height=512'
        
Authentication
Header
X-API-Key
Example
X-API-Key: YOUR_API_KEY
Notes
Use with every request. Errors: 401 (missing/invalid), 402 (insufficient credits), 403 (forbidden).

POST /v1/generate/image

Create an image generation job from a prompt and optional seed image.

Parameters (multipart form)
prompt
required — text prompt
images
optional — one or more image files
transparent_bg
optional — boolean
chroma_key_hex
optional — #RRGGBB (e.g., #FF00FF)
width, height
optional — pixels
centered
optional — boolean
isometric
optional — boolean
2d
optional — boolean
camera_orientation
top | bottom | front | back | left_side | right_side
subject_orientation_in_frame
north | north east | east | south east | south | south west | west | northwest
curl -s -X POST 'https://api.gamelabstudio.co/v1/generate/image'   -H 'X-API-Key: YOUR_API_KEY'   -F 'prompt=low poly treasure chest, 3/4 view'   -F 'transparent_bg=true'   -F 'chroma_key_hex=#FF00FF'   -F 'width=512'   -F 'height=512'
Seed an image by adding: -F 'images=@seed.png'
Response
{
  "job_id": "01895c57-aa56-4afb-900d-74e18b7069de",
  "status": "queued",
  "type": "image",
  "credits_debited": 1
}

POST /v1/generate/video

Create a video generation job from text, optionally referencing a completed image job or an uploaded image.

Parameters (multipart form)
prompt
required
source_image_job_id
optional — completed image job id
images
optional — seed image file
chroma_key_hex
optional — #RRGGBB (e.g., #FF00FF)
width, height
optional — pixels
centered, isometric, 2d
optional — booleans
camera_orientation
top | bottom | front | back | left_side | right_side
subject_orientation_in_frame
compass directions
loopable
optional — boolean
curl -s -X POST 'https://api.gamelabstudio.co/v1/generate/video'   -H 'X-API-Key: YOUR_API_KEY'   -F 'prompt=idle animation of blue pixel airship'   -F 'chroma_key_hex=#FF00FF'   -F 'loopable=true'   -F 'width=512'   -F 'height=512'
Response
{
  "job_id": "c936415d-3b9b-4417-8072-9ba779fbb619",
  "status": "queued",
  "type": "video",
  "credits_debited": 6
}

POST /v1/generate/spritesheet

Convert a video into a spritesheet with FPS, grid, padding, and chroma keying options including auto chroma detection, despill, and advanced edge spill removal.

Parameters (multipart form)
fps
required — positive number
length_seconds
required — integer
cols, rows
optional — integers
padding_px
optional — integer
chroma_key_hex
optional — #RRGGBB
chroma_key_threshold
optional — integer
chroma_key_auto
optional — boolean; auto-detect color from 10x10 average near top-left
chroma_despill_strength
optional — float 0–1; neutralizes color spill near key
edge_despill_enabled
optional — boolean; advanced spill removal at transparency edges
edge_despill_radius_px
optional — positive integer; pixels inward from edge (required if enabled)
edge_despill_strength
optional — 1–100; overall subtraction strength (required if enabled)
color_to_alpha
optional — boolean; preserve semi-transparent effects
color_to_alpha_cleanup
optional — integer 0–100; increasingly removes chroma-hued compression debris, defaults to 10
color_to_alpha_opacity
optional — integer 0–100; continuous SFX density, with 50 preserving linear alpha
Legacy color-to-alpha
threshold, range, and opaque_cutoff remain accepted and are translated to the new controls
source_video_job_id
optional — completed video job id
videos
optional — video file(s)
curl -s -X POST 'https://api.gamelabstudio.co/v1/generate/spritesheet'   -H 'X-API-Key: YOUR_API_KEY'   -F 'fps=12'   -F 'length_seconds=2'   -F 'cols=6'   -F 'rows=4'   -F 'padding_px=0'   -F 'chroma_key_hex=#FF00FF'   -F 'chroma_key_threshold=20'   -F 'chroma_key_auto=true'   -F 'chroma_despill_strength=0.8'   -F 'edge_despill_enabled=true'   -F 'edge_despill_radius_px=3'   -F 'edge_despill_strength=60'   -F 'color_to_alpha=true'   -F 'color_to_alpha_cleanup=10'   -F 'color_to_alpha_opacity=50'   -F 'videos=@walk_cycle.mp4'
Response
{
  "job_id": "c17ad106-77c4-4fef-ac6a-a8b8d0f56cb3",
  "status": "queued",
  "type": "spritesheet",
  "credits_debited": 1
}

GET /v1/jobs/{job_id}

Poll a job for status and, when completed, get artifact paths.

Notes
status
queued | processing | completed | failed
artifacts
array of { kind: output | text, path: absolute file path, sequence: number }
curl -s -X GET 'https://api.gamelabstudio.co/v1/jobs/$JOB_ID'   -H 'X-API-Key: YOUR_API_KEY'
Response (completed)
{
  "job_id": "2b10b04a-13d9-47a3-886f-bcb0d7dc3c28",
  "status": "completed",
  "type": "video",
  "error": null,
  "created_at": "2025-08-08T12:34:56.000000",
  "updated_at": "2025-08-08T12:36:03.000000",
  "artifacts": [
    { "kind": "output", "path": "/abs/path/to/data/jobs/2b10.../output/video_000.mp4", "sequence": 0 }
  ]
}

GET /v1/assets/{asset_id}/download

Download a generated asset that you own. Ownership is enforced via API key.

Parameters
path
/v1/assets/{asset_id}/download
asset_id
required — numeric
kind
optional — image | video | spritesheet (defaults to best available)
curl -s -L 'https://api.gamelabstudio.co/v1/assets/123/download?kind=spritesheet'   -H 'X-API-Key: YOUR_API_KEY'   -o asset.png