The Leonardo API (Leonardo.Ai Production API) lets you build image and video generation into your product: text-to-image, image-to-image, inpainting, upscaling, Realtime Canvas (LCM), text-to-video, custom model training, and - new for 2026 - access to first-party Lucid & Phoenix models alongside a hosted shelf of leading third-party models, all through one API and one token balance.
https://cloud.leonardo.ai/api/rest/v1Authorization: Bearer <API_KEY>Leonardo has evolved from a single-model image generator into a creative aggregator platform: its own first-party models run alongside a rotating shelf of hosted third-party models, selectable per generation from one API and one token balance. Here's what changed and what it means for builders.
Lucid Origin (Full-HD renders, strong prompt adherence, accurate in-image text) and Lucid Realism join the Phoenix 1.0 / 0.9 family - Leonardo's foundational models, with Phoenix outputting up to ~5 MP (e.g. 2048×2048) and notably high prompt fidelity.
First-party Motion 1.0, Motion 2.0, and Motion 2.0 Fast handle text-to-video and image-to-motion, while hosted third-party video models (Veo 3.x, Kling 2.x/3.x, Sora 2, LTX-2, Hailuo, Wan) are available through the same platform for premium workloads.
One integration now reaches 80+ models: FLUX.1/FLUX.2, Ideogram 3.0, GPT-Image, Nano Banana & Nano Banana Pro, and Seedream 4.x sit next to Leonardo's own models - no separate vendor accounts or SDKs required.
Blueprints (pre-packaged multi-step generation workflows executable via API), 3D model generation via Rodin V2, a Universal Upscaler, background removal, outpainting (unzoom), and a Pricing Calculator endpoint for pre-flight cost estimation.
Model lineups rotate frequently. Verify current model availability in the official docs before hard-coding model IDs.
Leonardo is a creative generation platform with a visual-first web app and a Production API. The core developer workflow is "design visually → export code": teams iterate in the web UI (prompt, style, aspect ratio, upscales, canvas edits), then export the same configuration into code via the in-app "Get API Code" feature and run it at scale through the API.
Ad images, social graphics, product lifestyle shots, and campaign variants at volume - run A/B prompt tests and generate consistent assets in batches.
Embed generation in your own app: an "AI cover image" button, avatar generators, or templated content mapping user inputs to prompt scaffolds with guardrails.
Use Realtime Canvas (LCM) endpoints for interactive creation where latency matters: quick iterations, refinements, and live-feeling edits.
Concept art, textures, icons, and environment variants - pair datasets and custom model training to keep a consistent style for a game or brand universe.
The fastest path: (1) create an API key in the Leonardo web app under API Access, (2) call a generation endpoint with your prompt and settings, (3) retrieve the result by polling or via webhook callback. Name keys by environment (e.g. myapp-dev, myapp-prod) so you can rotate safely.
curl -X POST "https://cloud.leonardo.ai/api/rest/v1/generations" \
-H "accept: application/json" \
-H "content-type: application/json" \
-H "authorization: Bearer YOUR_LEONARDO_API_KEY" \
-d '{
"prompt": "A clean product hero shot of a smart watch on a white desk, soft natural light",
"num_images": 4
}'
GET /generations/{id}, list generations
by user, or configure webhook callbacks so your server receives results when ready.
The Production API uses a standard Bearer token:
set Authorization: Bearer <YOUR_API_KEY>
on requests against the cloud.leonardo.ai/api/rest/v1 base path.
The API is built around the generation - a job that produces one or more outputs. The workflow is always: create a generation → wait → retrieve results and metadata.
| Capability | Endpoint (typical) | Purpose | When you use it |
|---|---|---|---|
| Create image generation | POST /generations |
Start a text-to-image or config-driven generation job. | Most image flows (prompt → outputs). |
| Get a single generation | GET /generations/{id} |
Fetch status, metadata, and outputs. | Polling, status pages, debugging. |
| Get generations by user | GET /generations/user/{userId} |
List a user's generations. | History pages, export, auditing. |
| Prompt helpers | POST /prompt/improve |
Improve prompts or generate ideas. | UX features: an "Enhance prompt" button. |
| Model discovery | GET /platformModels |
List platform models available for generation. | Let users choose a model dynamically. |
// Poll generation until complete (conceptual) createGeneration() -> { generationId } repeat every 2-5 seconds with backoff: gen = GET /generations/{generationId} if gen.status in ("COMPLETE", "FAILED"): break if COMPLETE: store image URLs + metadata else: log error + show message
init_image_id vs init_generation_image_id:
the former is an ID from the Upload Init Image endpoint (a user-uploaded file); the latter refers to an
image produced by a prior Leonardo generation. The distinction matters for "edit this generated image"
vs "edit a user upload" flows.
Many workflows start from an existing image: image-to-image, inpainting, upscaling, canvas editing,
motion from an upload, or training datasets. Rather than posting raw bytes to Leonardo, upload endpoints
return presigned S3 upload details: call POST /init-image,
receive a temporary presigned URL and form fields, upload the file directly to S3, then use the returned
image ID in generation requests.
curl -X POST "https://cloud.leonardo.ai/api/rest/v1/init-image" \
-H "accept: application/json" \
-H "content-type: application/json" \
-H "authorization: Bearer YOUR_LEONARDO_API_KEY" \
-d '{ "extension": "png" }'
Inpainting needs both an init image and a mask. A canvas upload endpoint (e.g. POST /canvas-init-image) returns presigned details for uploading both files.
Soft-edged masks blend smoothly; hard masks give sharp edits (like replacing a sign). If you see artifacts, adjust the mask boundary and tighten prompt specificity.
Custom model training uses dataset creation plus dataset-image upload endpoints. Presigned URLs can expire quickly - upload immediately after receiving them, and validate file size/type first.
Realtime Canvas is built around LCM (Latent Consistency Models) for sub-second, interactive iteration. If an image takes 20–40 seconds, users abandon - realtime workflows keep the UI alive with a quick preview, then offer a refine/upscale path for final quality.
The API includes text-to-video endpoints and recipes for generating motion from uploaded images - "turn a product still into a subtle motion clip," "animate a scene from text," or "create short promo clips for ads." In 2026 this spans first-party Motion 1.0 / 2.0 / 2.0 Fast plus hosted third-party video models for premium workloads.
curl -X POST "https://cloud.leonardo.ai/api/rest/v1/generations-text-to-video" \
-H "accept: application/json" \
-H "content-type: application/json" \
-H "authorization: Bearer YOUR_LEONARDO_API_KEY" \
-d '{
"prompt": "A smooth camera pan across a minimalist workspace, soft daylight, cinematic",
"duration": 4
}'
You can list platform models via the API and pass a model ID in generation requests, or train custom models on your own datasets for brand-consistent style. The 2026 model landscape looks like this:
| Model | Type | Modality | Known For |
|---|---|---|---|
| Lucid OriginLeonardo first-party | First-party | Image | Full-HD renders, strong prompt adherence, accurate in-image text - great for branded content |
| Lucid RealismLeonardo first-party | First-party | Image | Photorealistic generation for lifestyle and product imagery |
| Phoenix 1.0 / 0.9Leonardo first-party | First-party | Image | Foundational model, up to ~5 MP outputs, very high prompt fidelity, coherent text rendering |
| Motion 1.0 / 2.0 / 2.0 FastLeonardo first-party | First-party | Video | Text-to-video and image-to-motion clips |
| FLUX Dev / Schnell / FLUX.2Black Forest Labs | Hosted 3rd-party | Image | Fast, high-quality open-ecosystem image models |
| Ideogram 3.0Ideogram | Hosted 3rd-party | Image | Typography-strong image generation |
| Nano Banana / ProGoogle | Hosted 3rd-party | Image | Fine-grained image editing and consistent characters |
| Seedream 4.xByteDance | Hosted 3rd-party | Image | High-aesthetic frontier image generation |
| Veo 3.x · Kling 2.x/3.x · Sora 2 · LTX-2Various | Hosted 3rd-party | Video | Premium frontier video models on the same token balance |
| Custom models & elementsYours | Trained | Image | LoRA-style fine-tuning on your uploaded datasets for style consistency |
Polling is simple, but webhooks win at scale: configure a webhook callback URL when
creating an API key so generation results are delivered to your server. This cuts latency and polling
traffic, and lets long jobs run without a waiting client. An optional webhook callback API key is sent to
your endpoint as authorization: Bearer <yourWebhookCallbackApiKey> - validate it.
// Conceptual webhook callback handler raw = readRawBody(req) auth = req.headers["authorization"] if auth != "Bearer YOUR_WEBHOOK_CALLBACK_API_KEY": return 401 payload = JSON.parse(raw) // Dedupe by generationId (and/or event id) if seen(payload.generationId): return 200 enqueue("leonardo_generation_completed", payload) markSeen(payload.generationId) return 200
Design for three separate capacity constraints, all documented explicitly by Leonardo: rate limits (requests per window), concurrency (simultaneous jobs - the API supports up to 10 concurrent generations), and the queue (what happens when concurrency is maxed and jobs wait).
The developer API is pure usage-based: start with a $5 credit, pay per token, enable auto top-ups, and run up to 10 concurrent generations. The self-serve app runs on seat-plus-bundled-token plans. Because every generation is metered in one shared token currency, cost planning matters - heavier models and video consume far more per output.
| Plan | Price | Fast Tokens | Rollover Bank | Notable |
|---|---|---|---|---|
| Free | $0 | 150 / day | - | Access to models incl. Phoenix, Lucid Origin, FLUX; non-exclusive commercial license |
| API Basic | From ~$9/mo | Usage-based | - | Developer API entry; $5 starting credit, auto top-ups |
| Essential | $12/mo | 8,500 / mo | 25,500 cap | Entry paid tier for regular creators |
| Premium | $30/mo | 25,000 / mo | 75,000 cap | Unlimited relaxed image generation on first-party models (Lucid, Phoenix, FLUX Dev/Schnell) |
| Ultimate | $60/mo | 60,000 / mo | 180,000 cap | Adds unlimited relaxed video on Motion models; 6 simultaneous generations |
| Team | From ~$24/seat | Shared pool | Shared | 3-seat minimum, shared token pool, collaboration features |
Prices and token allowances change often and vary with annual billing (~20% off). Confirm current numbers on leonardo.ai/pricing and the official pricing FAQ before building billing logic.
Leonardo provides official TypeScript and Python SDKs that wrap the REST endpoints, standardize auth and errors, and keep request shapes aligned with the reference as it evolves.
Ideal for Next.js backends, serverless functions, and Node services - typed requests reduce integration mistakes.
Best for batch generation pipelines, dataset upload automation, and training workflows - pairs well with worker queues.
The hard part isn't calling an endpoint - it's delivering a reliable product experience: controlling concurrency, handling queue states, managing costs, and supporting retries and user expectations.
| Component | What it does | Why it matters |
|---|---|---|
| API Gateway (your backend) | Validates inputs, enforces quotas, starts Leonardo generations. | Protects your key, prevents abuse, keeps costs predictable. |
| Job Queue / Worker | Runs requests, polls status, downloads results, writes to storage/DB. | Decouples user requests from long-running jobs. |
| Webhook Receiver | Receives callbacks and triggers worker processing without polling. | Lower latency, fewer API calls, real-time updates. |
| Object Storage | Stores final images/videos for durable, CDN-ready delivery. | Stable URLs, caching, retention control. |
| Database | Stores generations, status, user mappings, costs, metadata. | History, billing, support and debugging. |
| Observability | Logs, metrics, alerts, tracing for failures and latency spikes. | Quick debugging and reliable SLAs. |
// Prevent duplicate generations (a major hidden cost driver) hash = sha256(userId + prompt + modelId + width + height + numImages + seed + options) if existingGenerationByHash(hash) and status not FAILED: return existingGeneration else: create new generation and store hash
What is the base URL for the Leonardo Production API?
The reference uses https://cloud.leonardo.ai/api/rest/v1. Endpoints under this include generations, uploads, models, prompt utilities, canvas endpoints, video, datasets, and more.
How do I authenticate?
Bearer token header: Authorization: Bearer YOUR_API_KEY. Create keys in the web app under API Access and keep them on your backend only.
Which models should I use in 2026?
For general image work, start with Lucid Origin (strong prompt adherence and in-image text) or Phoenix 1.0 (high resolution and prompt fidelity). For video, first-party Motion models are the budget path, with hosted Veo/Kling/Sora 2 available for premium workloads. List platform models via the API to populate a model picker dynamically.
How do I generate images with a custom model?
Create a dataset → upload images via presigned URLs → train the custom model or element → pass the returned model ID in your generation requests.
Should I poll or use webhook callbacks?
Use webhooks for real-time results and lower API load, but keep polling as a fallback. Most production systems do both: callbacks for speed, polling for reconciliation and error recovery.
What are rate limits and concurrency limits?
Rate limits control request throughput; concurrency controls simultaneous generations (the API supports up to 10 concurrent); the queue governs what happens beyond that. Implement backoff and show queue-aware UX states.
How does API pricing work?
Pure pay-as-you-go: start with a $5 credit, pay per token, with auto top-ups available. Different models consume different token amounts - video and premium third-party models cost significantly more per output than first-party image models.
Is there an official SDK?
Yes - official TypeScript and Python SDKs. You can also call the REST endpoints directly if you prefer minimal dependencies.
For accurate, current parameter lists, request/response schemas, and feature availability, always confirm against the official documentation:
| Topic | Official link | Why it matters |
|---|---|---|
| Developer API overview | https://leonardo.ai/api/ | High-level positioning, production notes, entry points |
| Pricing | https://leonardo.ai/pricing | Current plans, token allowances, relaxed-generation model list |
| API reference (limits) | https://docs.leonardo.ai/reference/limits | Concurrency, rate limits, queue behavior |
| Quick start | https://docs.leonardo.ai/docs/getting-started | Get an API key, first calls, recommended setup |
| Create image generation | https://docs.leonardo.ai/reference/creategeneration | Start image generations |
| Get generation by ID | https://docs.leonardo.ai/reference/getgenerationbyid | Poll and retrieve a generation |
| Upload init image | https://docs.leonardo.ai/reference/uploadinitimage | Presigned uploads for image-to-image & edits |
| Webhook callback guide | https://docs.leonardo.ai/docs/guide-to-the-webhook-callback-feature | Async results; bearer auth for callbacks |
| Pricing FAQ | https://docs.leonardo.ai/docs/pricing-and-plans-faq | Pay-as-you-go model explanation |
| Official SDKs | https://docs.leonardo.ai/docs/leonardoai-official-sdks | TypeScript + Python SDK resources |
| Realtime Canvas recipe | https://docs.leonardo.ai/docs/generate-images-with-realtime-canvas | LCM generation and fast workflows |
| Text-to-video endpoint | https://docs.leonardo.ai/reference/createtexttovideogeneration | Start text-to-video jobs |