Generate Enhanced Prompts

Improve your prompts or create random prompts via API

Sample Request

curl --request POST \
     --url 'https://cloud.leonardo.ai/api/rest/v1/prompt/improve' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "prompt": "Beneath the rippling surface, a grand house lies submerged in a watery embrace. The sprawling mansion, now an aquatic relic, features intricate architecture seen in a detailed painting. ",
  "promptInstructions": "Change the context to a space theme"
}

๐Ÿ“˜

Note

Looking to have Edit with AI as part of your Image generation workflow? This can be achieved with enhancePrompt and enhancePromptInstructions within the Create Generation of Images endpoint.

๐Ÿ“˜

Tip

The prompt parameter of the Improve Prompt endpoint has a limit of 200 characters

Sample Request

curl --request POST \
     --url 'https://cloud.leonardo.ai/api/rest/v1/prompt/improve' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "prompt": "Meridian sea",
}

Sample Request

curl --request POST \
     --url 'https://cloud.leonardo.ai/api/rest/v1/prompt/random' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \