AI & Machine Learning
Bearer Token
Leonardo AI REST API
AI-powered image generation and editing API
Leonardo AI provides a powerful REST API for generating, editing, and manipulating images using advanced AI models. Developers use it to integrate text-to-image generation, image-to-image transformation, upscaling, and creative editing capabilities into their applications. The API supports multiple AI models, custom training, and real-time generation workflows.
Base URL
https://cloud.leonardo.ai/api/rest/v1
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /generations | Generate images from text prompts using AI models |
| GET | /generations/{id} | Retrieve details and status of a specific generation job |
| GET | /generations/user/{userId} | Get all generations created by a specific user |
| DELETE | /generations/{id} | Delete a specific generation and its associated images |
| POST | /generations-texture | Generate textures for 3D models from text descriptions |
| POST | /init-images | Upload an init image for image-to-image generation |
| POST | /variations/upscale | Upscale an existing generated image to higher resolution |
| POST | /variations/unzoom | Extend image boundaries by unzooming outward |
| GET | /platform-models | List all available AI models on the platform |
| GET | /models/{id} | Get detailed information about a specific AI model |
| POST | /models | Create and train a custom AI model |
| GET | /me | Get current user information and API usage statistics |
| POST | /prompt-improve | Enhance and optimize text prompts for better results |
| POST | /prompt-random | Generate random creative prompts for inspiration |
| GET | /datasets/{id} | Retrieve training dataset information for custom models |
Code Examples
curl -X POST https://cloud.leonardo.ai/api/rest/v1/generations \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "A futuristic cityscape at sunset, cyberpunk style",
"modelId": "6bef9f1b-29cb-40c7-b9df-32b51c1f67d3",
"width": 1024,
"height": 768,
"num_images": 4,
"guidance_scale": 7,
"num_inference_steps": 30
}'
Connect Leonardo AI to AI
Deploy a Leonardo AI MCP server on IOX Cloud and connect it to Claude, ChatGPT, Cursor, or any AI client. Your AI assistant gets direct access to Leonardo AI through these tools:
generate_image
Generate AI images from text prompts with configurable parameters like model, size, and style
upscale_image
Enhance image resolution and quality using AI upscaling
improve_prompt
Automatically optimize and enhance text prompts for better generation results
list_models
Retrieve available AI models with their capabilities and characteristics
check_generation_status
Monitor the status and progress of image generation jobs
Deploy in 60 seconds
Describe what you need, AI generates the code, and IOX deploys it globally.
Deploy Leonardo AI MCP Server →