S
spritesynthDOCS

UI Elements

Generate game UI components like health bars, buttons, and icons.

UI Elements

Generate game UI components — health bars, buttons, icons, inventory slots, and other interface elements optimized for game development.

Endpoint

POST /api/generations/ui

Parameters

NameTypeRequiredDescription
descriptionstringYesText prompt describing the UI element to generate
image_sizestringNoOutput dimensions as WxH. Default: 128x128
seedintegerNoRandom seed for reproducible results. 0 = random
stylestringNoUI style preset (e.g. fantasy, sci-fi, minimal)

Example

curl -X POST https://api.spritesynth.com/api/generations/ui \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "a red pixel art health bar with gold border",
    "image_size": "256x64",
    "style": "fantasy"
  }'

Response

{
  "id": "gen_ui_345",
  "status": "completed",
  "asset": {
    "url": "https://cdn.spritesynth.com/assets/gen_ui_345.png",
    "width": 256,
    "height": 64
  },
  "credits_cost": 1,
  "duration_ms": 1500
}

Tips

  • Use style to match your game's aesthetic.
  • Generate at the exact pixel dimensions you need to avoid scaling artifacts.
  • Generate empty and filled states separately for animation.

Need help?

Join our Discord community for support and tips.
Was this page helpful?

On this page