Leonardo.AI Realtime Canvas API
Real-time Latent Consistency Model (LCM) endpoints for sub-second iterative generation, inpainting, instant refine, and Alchemy upscale — backing the Leonardo Realtime Canvas product surface.
Real-time Latent Consistency Model (LCM) endpoints for sub-second iterative generation, inpainting, instant refine, and Alchemy upscale — backing the Leonardo Realtime Canvas product surface.
{
"openapi": "3.0.0",
"info": {
"title": "Leonardo.AI Realtime Canvas API",
"description": "Real-time LCM (Latent Consistency Model) generation, inpainting, instant refine, and Alchemy upscale for interactive canvas workflows.",
"version": "v1.0.0",
"contact": {
"name": "Leonardo.AI Support",
"url": "https://docs.leonardo.ai/docs/need-more-support"
},
"license": {
"name": "Leonardo.AI Terms of Service",
"url": "https://leonardo.ai/terms-of-service/"
}
},
"servers": [
{
"url": "https://cloud.leonardo.ai/api/rest/v1",
"description": "Leonardo.AI Production API"
}
],
"tags": [
{
"name": "Realtime Canvas"
}
],
"paths": {
"/generations-lcm": {
"post": {
"tags": [
"Realtime Canvas"
],
"summary": "Create LCM Generation",
"description": "This endpoint will generate a LCM image generation.",
"operationId": "createLCMGeneration",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"imageDataUrl": {
"nullable": false,
"title": "String",
"type": "string",
"description": "Image data used to generate image. In base64 format. Prefix: `data:image/jpeg;base64,`"
},
"prompt": {
"nullable": false,
"title": "String",
"type": "string",
"description": "The prompt used to generate images"
},
"guidance": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "How strongly the generation should reflect the prompt. Must be a float between 0.5 and 20."
},
"strength": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "Creativity strength of generation. Higher strength will deviate more from the original image supplied in imageDataUrl. Must be a float between 0.1 and 1."
},
"requestTimestamp": {
"$ref": "#/components/schemas/timestamp"
},
"style": {
"$ref": "#/components/schemas/lcm_generation_style"
},
"steps": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The number of steps to use for the generation. Must be between 4 and 16."
},
"width": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The output width of the image. Must be 512, 640 or 1024.",
"default": 512
},
"height": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The output width of the image. Must be 512, 640 or 1024.",
"default": 512
},
"seed": {
"$ref": "#/components/schemas/seed"
}
},
"type": "object",
"required": [
"imageDataUrl",
"prompt"
]
}
}
},
"description": "Query parameters can also be provided in the request body as a JSON object",
"required": false
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"lcmGenerationJob": {
"nullable": true,
"properties": {
"imageDataUrl": {
"nullable": false,
"title": "Array of Strings",
"type": "array",
"items": {
"type": "string"
}
},
"requestTimestamp": {
"$ref": "#/components/schemas/timestamp"
},
"apiCreditCost": {
"$ref": "#/components/schemas/apiCreditCost"
},
"cost": {
"$ref": "#/components/schemas/cost"
}
},
"title": "LcmGenerationOutput",
"type": "object"
}
}
},
"example": {
"lcmGenerationJob": {
"imageDataUrl": [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD..."
],
"requestTimestamp": "1234567890",
"apiCreditCost": null,
"cost": {
"amount": "0.0147",
"unit": "DOLLARS"
}
}
}
}
},
"description": "Responses for POST /generations-lcm"
}
}
}
},
"/lcm-instant-refine": {
"post": {
"tags": [
"Realtime Canvas"
],
"summary": "Perform instant refine on a LCM image",
"description": "This endpoint will perform instant refine on a LCM image",
"operationId": "performInstantRefine",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"imageDataUrl": {
"nullable": false,
"title": "String",
"type": "string",
"description": "Image data used to generate image. In base64 format. Prefix: `data:image/jpeg;base64,`"
},
"prompt": {
"nullable": false,
"title": "String",
"type": "string",
"description": "The prompt used to generate images"
},
"guidance": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "How strongly the generation should reflect the prompt. Must be a float between 0.5 and 20."
},
"strength": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "Creativity strength of generation. Higher strength will deviate more from the original image supplied in imageDataUrl. Must be a float between 0.1 and 1."
},
"requestTimestamp": {
"$ref": "#/components/schemas/timestamp"
},
"style": {
"$ref": "#/components/schemas/lcm_generation_style"
},
"steps": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The number of steps to use for the generation. Must be between 4 and 16."
},
"width": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The output width of the image. Must be 512, 640 or 1024.",
"default": 512
},
"height": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The output width of the image. Must be 512, 640 or 1024.",
"default": 512
},
"seed": {
"$ref": "#/components/schemas/seed"
}
},
"type": "object",
"required": [
"imageDataUrl",
"prompt"
]
}
}
},
"description": "Query parameters can also be provided in the request body as a JSON object",
"required": false
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"lcmGenerationJob": {
"nullable": true,
"properties": {
"imageDataUrl": {
"nullable": false,
"title": "Array of Strings",
"type": "array",
"items": {
"type": "string"
}
},
"requestTimestamp": {
"$ref": "#/components/schemas/timestamp"
},
"apiCreditCost": {
"$ref": "#/components/schemas/apiCreditCost"
},
"cost": {
"$ref": "#/components/schemas/cost"
}
},
"title": "LcmGenerationOutput",
"type": "object"
}
}
},
"example": {
"lcmGenerationJob": {
"imageDataUrl": [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD..."
],
"requestTimestamp": "1234567891",
"apiCreditCost": null,
"cost": {
"amount": "0.0147",
"unit": "DOLLARS"
}
}
}
}
},
"description": "Responses for POST /lcm-instant-refine"
}
}
}
},
"/lcm-inpainting": {
"post": {
"tags": [
"Realtime Canvas"
],
"summary": "Perform inpainting on a LCM image",
"description": "This endpoint will perform a inpainting on a LCM image",
"operationId": "performInpaintingLCM",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"imageDataUrl": {
"nullable": false,
"title": "String",
"type": "string",
"description": "Image data used to generate image. In base64 format. Prefix: `data:image/jpeg;base64,`"
},
"maskDataUrl": {
"nullable": false,
"title": "String",
"type": "string",
"description": "Image data of the mask layer used for inpainting. In base64 format. Prefix: `data:image/jpeg;base64,`. Mask should be white on black where generation is applied to the white area."
},
"prompt": {
"nullable": false,
"title": "String",
"type": "string",
"description": "The prompt used to generate images"
},
"guidance": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "How strongly the generation should reflect the prompt. Must be a float between 0.5 and 20."
},
"strength": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "Creativity strength of generation. Higher strength will deviate more from the original image supplied in imageDataUrl. Must be a float between 0.1 and 1."
},
"requestTimestamp": {
"$ref": "#/components/schemas/timestamp"
},
"style": {
"$ref": "#/components/schemas/lcm_generation_style"
},
"steps": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The number of steps to use for the generation. Must be between 4 and 16."
},
"width": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The output width of the image. Must be 512, 640 or 1024.",
"default": 512
},
"height": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The output width of the image. Must be 512, 640 or 1024.",
"default": 512
},
"seed": {
"$ref": "#/components/schemas/seed"
}
},
"type": "object",
"required": [
"imageDataUrl",
"maskDataUrl",
"prompt"
]
}
}
},
"description": "Query parameters can also be provided in the request body as a JSON object",
"required": false
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"lcmGenerationJob": {
"nullable": true,
"properties": {
"imageDataUrl": {
"nullable": false,
"title": "Array of Strings",
"type": "array",
"items": {
"type": "string"
}
},
"requestTimestamp": {
"$ref": "#/components/schemas/timestamp"
},
"apiCreditCost": {
"$ref": "#/components/schemas/apiCreditCost"
},
"cost": {
"$ref": "#/components/schemas/cost"
}
},
"title": "LcmGenerationOutput",
"type": "object"
}
}
},
"example": {
"lcmGenerationJob": {
"imageDataUrl": [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD..."
],
"requestTimestamp": "1234567892",
"apiCreditCost": null,
"cost": {
"amount": "0.0147",
"unit": "DOLLARS"
}
}
}
}
},
"description": "Responses for POST /lcm-inpainting"
}
}
}
},
"/lcm-upscale": {
"post": {
"tags": [
"Realtime Canvas"
],
"summary": "Perform Alchemy Upscale on a LCM image",
"description": "This endpoint will perform Alchemy Upscale on a LCM image",
"operationId": "performAlchemyUpscaleLCM",
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"imageDataUrl": {
"nullable": false,
"title": "String",
"type": "string",
"description": "Image data used to generate image. In base64 format. Prefix: `data:image/jpeg;base64,`"
},
"prompt": {
"nullable": false,
"title": "String",
"type": "string",
"description": "The prompt used to generate images"
},
"guidance": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "How strongly the generation should reflect the prompt. Must be a float between 0.5 and 20."
},
"strength": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "Creativity strength of generation. Higher strength will deviate more from the original image supplied in imageDataUrl. Must be a float between 0.1 and 1."
},
"requestTimestamp": {
"$ref": "#/components/schemas/timestamp"
},
"style": {
"$ref": "#/components/schemas/lcm_generation_style"
},
"steps": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The number of steps to use for the generation. Must be between 4 and 16."
},
"width": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The output width of the image. Must be 512, 640 or 1024.",
"default": 512
},
"height": {
"nullable": true,
"title": "Int",
"type": "integer",
"description": "The output width of the image. Must be 512, 640 or 1024.",
"default": 512
},
"seed": {
"$ref": "#/components/schemas/seed"
},
"refineCreative": {
"nullable": true,
"title": "Boolean",
"type": "boolean",
"description": "Refine creative"
},
"refineStrength": {
"nullable": true,
"title": "Float",
"type": "number",
"description": "Must be a float between 0.5 and 0.9."
}
},
"type": "object",
"required": [
"imageDataUrl",
"prompt"
]
}
}
},
"description": "Query parameters can also be provided in the request body as a JSON object",
"required": false
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"lcmGenerationJob": {
"nullable": true,
"properties": {
"imageDataUrl": {
"nullable": false,
"title": "Array of Strings",
"type": "array",
"items": {
"type": "string"
}
},
"generationId": {
"nullable": false,
"title": "Array of Strings",
"type": "array",
"items": {
"type": "string"
}
},
"variationId": {
"nullable": false,
"title": "Array of Strings",
"type": "array",
"items": {
"type": "string"
}
},
"generatedImageId": {
"nullable": false,
"title": "String",
"type": "string"
},
"requestTimestamp": {
"$ref": "#/components/schemas/timestamp"
},
"apiCreditCost": {
"$ref": "#/components/schemas/apiCreditCost"
},
"cost": {
"$ref": "#/components/schemas/cost"
}
},
"title": "LcmGenerationOutput",
"type": "object"
}
}
},
"example": {
"lcmGenerationJob": {
"imageDataUrl": [
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD..."
],
"variationId": [
"var234567-8901-bcde-fghi-jklmnopqrstu"
],
"generatedImageId": "l1m2n3o4-p5q6-r7s8-tuvw-xy0123456789",
"requestTimestamp": "1234567893",
"apiCreditCost": null,
"cost": {
"amount": "0.0147",
"unit": "DOLLARS"
}
}
}
}
},
"description": "Responses for POST /lcm-upscale"
}
}
}
}
},
"components": {
"schemas": {
"cost": {
"nullable": true,
"type": "object",
"title": "Cost",
"description": "The cost of the operation.",
"properties": {
"amount": {
"type": "string",
"description": "The amount of the cost."
},
"unit": {
"type": "string",
"enum": [
"CREDITS",
"DOLLARS"
],
"description": "The unit of the cost. Can be CREDITS or DOLLARS. Note: DOLLARS unit only supports PAYG plan."
}
}
},
"Cursor": {
"type": "string",
"title": "Cursor",
"description": "An opaque cursor used for pagination"
},
"Blueprint": {
"type": "object",
"title": "Blueprint",
"description": "A Blueprint object",
"properties": {
"akUUID": {
"type": "string",
"description": "Unique identifier for the Blueprint",
"example": "c846413e-92ba-4302-84f8-47c667d4761f"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp",
"example": "2025-10-29T21:31:47.999Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp",
"example": "2025-12-19T02:34:44.740Z"
},
"name": {
"type": "string",
"description": "Name of the Blueprint",
"example": "Golden Hour Relight"
},
"description": {
"type": "string",
"description": "Description of the Blueprint",
"example": "Relight an image with warm, golden tones of late afternoon sunlight for a soft and radiant glow."
},
"thumbnails": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Thumbnail type name (e.g., thumbnailUrl, videoUrl, thumbnailUrlBanner, thumbnailUrlLandscape, thumbnailUrlExtremePortrait)",
"example": "thumbnailUrl"
},
"url": {
"type": "string",
"description": "URL of the thumbnail",
"example": "https://cdn.leonardo.ai/blueprint_assets/official/384ab5c8-55d8-47a1-be22-6a274913c324/thumbnails/goldenhour.jpg"
}
}
}
},
"teamId": {
"type": "string",
"nullable": true,
"description": "Team ID if Blueprint belongs to a team",
"example": null
},
"official": {
"type": "boolean",
"description": "Whether this is an official Blueprint",
"example": true
}
}
},
"BlueprintVersion": {
"type": "object",
"title": "BlueprintVersion",
"description": "A Blueprint Version object",
"properties": {
"edges": {
"type": "array",
"items": {
"type": "object",
"properties": {
"cursor": {
"type": "string",
"example": "eyJjcmVhdGVkQXQiOiIyMDI1LTExLTI3VDA1OjEzOjIxLjg5NloiLCJha1VVSUQiOiI5NTZlOTU2NC0xOWY3LTQ5NjgtYjU2ZC0wNWMyYzU2NzcyNmYifQ=="
},
"node": {
"type": "object",
"properties": {
"akUUID": {
"type": "string",
"format": "uuid",
"example": "956e9564-19f7-4968-b56d-05c2c567726f"
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2025-11-27T05:13:21.896Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"example": "2025-11-27T05:13:21.896Z"
},
"cost": {
"type": "integer",
"example": 160
},
"uiMetadata": {
"type": "object",
"properties": {
"inputs": {
"type": "array",
"items": {
"type": "object"
}
},
"outputs": {
"type": "array",
"items": {
"type": "object"
}
}
},
"additionalProperties": false
},
"uiMetadataSchemaVersion": {
"type": "string",
"example": "21"
},
"models": {
"type": "array",
"items": {
"type": "string"
}
},
"executability": {
"type": "object",
"properties": {
"isExecutable": {
"type": "boolean",
"example": true
},
"reasons": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"models": {
"type": "string",
"example": "gemini-2.5-flash-image"
}
}
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"totalCount": {
"type": "integer",
"example": 2
},
"pageInfo": {
"type": "object",
"properties": {
"hasNextPage": {
"type": "boolean",
"example": false
},
"hasPreviousPage": {
"type": "boolean",
"example": false
},
"startCursor": {
"type": "string",
"example": "eyJjcmVhdGVkQXQiOiIyMDI1LTExLTI3VDA1OjEzOjIxLjg5NloiLCJha1VVSUQiOiI5NTZlOTU2NC0xOWY3LTQ5NjgtYjU2ZC0wNWMyYzU2NzcyNmYifQ=="
},
"endCursor": {
"type": "string",
"example": "eyJjcmVhdGVkQXQiOiIyMDI1LTExLTI3VDA1OjEzOjIxLjg5NloiLCJha1VVSUQiOiI5NTZlOTU2NC0xOWY3LTQ5NjgtYjU2ZC0wNWMyYzU2NzcyNmYifQ=="
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"NodeInput": {
"type": "object",
"title": "NodeInput",
"description": "A node input object for customizing a Blueprint Execution",
"required": [
"nodeId",
"settingName",
"value"
],
"properties": {
"nodeId": {
"type": "string",
"format": "uuid",
"description": "The ID of the node in the Blueprint",
"example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"settingName": {
"type": "string",
"enum": [
"text",
"imageUrl",
"textVariables"
],
"description": "The type of setting to replace:\n- `text`: Direct text replacement (value is a string)\n- `imageUrl`: Image URL input (value is a URL string)\n- `textVariables`: Text with placeholder variables (value is an array of TextVariable)",
"example": "text"
},
"value": {
"oneOf": [
{
"type": "string",
"description": "String value. Use for settingName='text' (direct text) or settingName='imageUrl' (image URL)"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/TextVariable"
},
"description": "Array of TextVariable objects. Use only for settingName='textVariables' to replace {{placeholders}} in the Blueprint"
}
],
"description": "The replacement value. Type depends on settingName:\n- `text`: string (the full text)\n- `imageUrl`: string (the image URL)\n- `textVariables`: array of TextVariable objects",
"example": "A futuristic cityscape at sunset"
}
}
},
"TextVariable": {
"type": "object",
"title": "TextVariable",
"description": "A text variable for replacing placeholders in Blueprint templates",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the placeholder variable (without curly braces)",
"example": "characterName"
},
"value": {
"type": "string",
"description": "The value to replace the placeholder with",
"example": "Luna"
}
}
},
"ApiError": {
"type": "object",
"title": "ApiError",
"description": "API
# --- truncated at 32 KB (56 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/leonardo-ai/refs/heads/main/openapi/leonardo-ai-realtime-canvas-openapi.json