For Agents
Generate images and video from prompts, train custom models on your datasets, and run upscales and variations with the Leonardo.Ai API. Covers 55 endpoints across generations, datasets, models, and variations.
Use for: Generate a set of images from a text prompt, Check the status and results of a specific generation, Train a custom model on a dataset of my images, Upscale a generated image to a higher resolution
Not supported: Does not host or serve the generated assets long term. Use for creating generations, training models, and running image variations only.
The Leonardo.Ai API generates images and video from text prompts and trains custom image models, exposing generations, datasets, models, and variations over a REST interface. It lets you start a generation, poll for its results, build datasets, train a custom model, and run upscales and other variations on an image. Requests carry a bearer token and return structured JSON your application can act on.
Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Leonardo.Ai API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fleonardo.ai%2Fleonardo" | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fleonardo.ai%2Fleonardo" | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.
What an agent can do with Leonardo.Ai API.
Create image generations from a text prompt and poll for the results
Retrieve a generation and its resulting images by ID
Create datasets and upload images for model training
Train a custom model on your own dataset
Run upscale, unzoom, and background-removal variations on an image
Improve or generate prompts before creating images
Patterns agents use Leonardo.Ai API for, with concrete tasks.
★ AI Creative Agent via Jentic
An AI creative agent can generate and refine images without a developer wiring the Leonardo.Ai API by hand. Through Jentic the agent searches for the generation operation by intent, receives the endpoint and its input schema, and calls it with the bearer token injected at execution time. The agent then polls the generation by ID and returns the finished images.
Search Jentic for 'create an image generation', call POST /generations with the prompt, then poll GET /generations/{id} until the images are ready
Custom Model Training
Teams with their own image style can train a custom model rather than relying on base models. The Leonardo.Ai API builds a dataset, uploads training images, and trains a model against it, so a pipeline can produce a bespoke model programmatically. The trained model is then available for later generations.
Call POST /datasets to create a dataset, upload images to it, then POST /models to train a custom model on the dataset
Image Post-Processing
Applications that generate images often need to upscale or clean them up before delivery. The Leonardo.Ai API runs upscale, unzoom, and background-removal variations on an existing image, so a post-processing step can polish each result. This produces delivery-ready assets without leaving the platform.
Call POST /variations/upscale on a generated image, then retrieve the variation result by ID
55 endpoints — the leonardo.
METHOD
PATH
DESCRIPTION
/generations
Create a generation of images
/generations/{id}
Get a single generation
/datasets
Create a dataset
/models
Train a custom model
/variations/upscale
Create an upscale variation
/prompt/improve
Improve a prompt
/generations-text-to-video
Create a video generation from a text prompt
/me
Get user information
/generations
Create a generation of images
/generations/{id}
Get a single generation
/datasets
Create a dataset
/models
Train a custom model
/variations/upscale
Create an upscale variation
/prompt/improve
Improve a prompt
/generations-text-to-video
Create a video generation from a text prompt
/me
Get user information
What agents get from Jentic-routed access to this vendor.
Setup
Wiring the Leonardo.Ai API by hand means setting the bearer token on every request, starting a generation, and polling its ID until the images are ready yourself. Through Jentic you install once, import Leonardo.Ai from the API Directory, store the token once, and your agent calls it.
Permission scoping
Leonardo.Ai puts the record id in the URL path (/generations/{id}, /datasets/{id}), so a rule can pin your agent to creating and reading generations. You choose the operations it may call, so training a model or deleting a dataset is not included unless you add it.
Credential isolation
Your Leonardo.Ai token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'create an image generation' or 'train a custom model', and Jentic returns the matching Leonardo.Ai operation with its input schema so the agent calls the right endpoint without browsing the reference docs.
Alternatives and complements available in the Jentic catalogue.
Specific to using Leonardo.Ai API through Jentic.
What authentication does the Leonardo.Ai API use?
The Leonardo.Ai API authenticates with a bearer token in the Authorization header, as declared in its OpenAPI spec. Through Jentic the token is stored encrypted by your own Jentic One instance and injected at execution time, so it never enters the agent's prompt, logs, or context.
How do I get the images from a generation with the Leonardo.Ai API?
Call POST /generations to start a generation, which returns a generation ID, then poll GET /generations/{id} until the images are ready. The generation response carries the URLs of the finished images so your agent can download them.
What are the rate limits for the Leonardo.Ai API?
The OpenAPI spec does not specify rate limits. Check the Leonardo.Ai API documentation at https://docs.leonardo.ai for current limits before running high-volume generation jobs.
How do I generate images through Jentic?
Search Jentic for 'create an image generation', which resolves to the POST /generations operation, and Jentic returns its input schema so your agent can submit a prompt and poll for results. Credentials are injected at call time from your own instance. To run it on your own infrastructure, install Jentic One from its GitHub repo.
Can I restrict what my agent is allowed to do with the Leonardo.Ai API?
Yes. Write a rule that allows only the operations your agent needs, such as POST /generations and GET /generations/{id}, so it can create and read generations but cannot train models or delete datasets, and every call it makes is logged by your own instance. You add training or delete operations to the allowed set only when you decide to.
Is there a Leonardo.Ai MCP server?
You don't need an MCP server to give your agent Leonardo.Ai. Jentic connects it directly from the API Directory: import Leonardo.Ai, store your token once, and your agent calls the generation, dataset, and model operations on demand without loading another server's tool definitions into its context.
GET STARTED