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 spritesynthQuick 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 LibrariesPython client library for programmatic access to the API.
- REST APIFull REST API with JSON request/response format.
- API LimitsRate limits and credit costs vary by model and operation type.