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.
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 |
Sponsor this page
AvailableReach developers actively building with Leonardo AI. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →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
}'
Use Leonardo AI from Claude / Cursor / ChatGPT
Get a hosted MCP endpoint for Leonardo AI. Paste your Leonardo AI API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Leonardo AI directly with your credentials — no local install, works on mobile.
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
Connect in 60 seconds
Paste your Leonardo AI key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.
Connect Leonardo AI to your AI →