S
spritesynthAPI
Python Client

Python Client

The official spritesynth Python client provides a clean, type-safe interface to the full REST API. Install via pip and start generating pixel art programmatically in minutes.

Installation

pip install spritesynth

Quick Start

from spritesynth import SpriteSynth

client = SpriteSynth(api_key="your-key-here")

# Generate pixel art
result = client.generate_image(
    prompt="16-bit knight with blue armor",
    size="128x128"
)
print(f"Job ID: {result.job_id}")

# Check status and download
job = client.get_generation(result.job_id)
if job.status == "completed":
    job.download("knight.png")

The client handles authentication, rate limiting, polling, and error handling automatically. All API features are available: image generation, character creation, tilesets, editing operations, and asset management.

Async Support

The client also provides an async interface for concurrent generation workloads:

import asyncio
from spritesynth import AsyncSpriteSynth

async def main():
    client = AsyncSpriteSynth(api_key="your-key")
    result = await client.generate_image(prompt="forest tileset")
    print(f"Generated: {result.job_id}")

asyncio.run(main())

Resources

  • Client Libraries
    Python client library for programmatic access to the API.
  • REST API
    Full REST API with JSON request/response format.
  • API Limits
    Rate limits and credit costs vary by model and operation type.