Prerequisites
- Python 3.7 or higher
- An API key from @KellyAIBot on Telegram
Installation
Install the SDK
Install the Kelly AI Python SDK using pip:The SDK will automatically install its dependencies:
aiohttp- For asynchronous HTTP requestsdotmap- For convenient response object handling
Get your API key
If you don’t have an API key yet, message @KellyAIBot on Telegram to get one. See the authentication guide for detailed instructions.
Create your first script
Create a new Python file and import the SDK:
The
generate() method returns raw binary image data (bytes). You can save it directly to a file or process it with image libraries like PIL.Complete example
Here’s a more complete example showing multiple SDK features:Next steps
Authentication
Learn more about API keys and authentication options
Image generation
Explore all image generation capabilities and models
Language models
Use ChatGPT, Gemini, and other LLMs
API reference
Browse the complete API documentation
Common issues
Timeout errors
If you’re generating large images or using complex prompts, you may need to increase the timeout. The default timeout is 60 seconds.Async/await syntax
All SDK methods are asynchronous and must be called withawait inside an async function. If you’re new to async Python, check out the Python asyncio documentation.