Leonardo.AI Prompt API

The Prompt API from Leonardo.AI — 2 operation(s) for prompt.

Operations 2

POST /prompt/random Generate a Random prompt #
POST /prompt/improve Improve a Prompt #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/leonardo-ai-prompt-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

leonardo-ai-prompt-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Leonardo.AI 3D Model Assets Prompt API
  description: Upload, retrieve, and delete 3D model assets for use with Rodin and other 3D-capable 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
security:
- bearerAuth: []
tags:
- name: Prompt
paths:
  /prompt/random:
    post:
      tags:
      - Prompt
      summary: Generate a Random prompt
      description: This endpoint returns a random prompt
      operationId: promptRandom
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  promptGeneration:
                    properties:
                      prompt:
                        title: String
                        type: string
                        description: The random prompt generated.
                        default: The random prompt generated.
                      apiCreditCost:
                        type: integer
                        description: 'API Credits Cost for Random Prompt Generation. Available for Production API Users. Note: it will be deprecated. Please use the cost instead.'
                        default: 4
                        deprecated: true
                      cost:
                        $ref: '#/components/schemas/cost'
                    title: promptGenerationOutput
                    type: object
              example:
                promptGeneration:
                  prompt: A majestic dragon soaring through stormy clouds
                  apiCreditCost: null
                  cost:
                    amount: '0.0147'
                    unit: DOLLARS
          description: Responses for POST /prompt/random
  /prompt/improve:
    post:
      tags:
      - Prompt
      summary: Improve a Prompt
      description: This endpoint returns a improved prompt
      operationId: promptImprove
      requestBody:
        content:
          application/json:
            schema:
              properties:
                prompt:
                  title: String
                  type: string
                  description: The prompt to improve.
                promptInstructions:
                  title: String
                  type:
                  - string
                  - 'null'
                  description: The prompt is improved based on the given instructions.
                isVideo:
                  type:
                  - boolean
                  - 'null'
                  description: Specifies whether the prompt is for a video generation. Defaults to false (image prompt).
                  example: true
              required:
              - prompt
              type: object
        description: Query parameters to be provided in the request body as a JSON object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  promptGeneration:
                    properties:
                      prompt:
                        title: String
                        type: string
                        description: The improved prompt.
                        default: The improved prompt.
                      apiCreditCost:
                        type: integer
                        description: 'API Credits Cost for Random Prompt Generation. Available for Production API Users. Note: it will be deprecated. Please use the cost instead.'
                        default: 4
                        deprecated: true
                      cost:
                        $ref: '#/components/schemas/cost'
                    title: promptGenerationOutput
                    type: object
              example:
                promptGeneration:
                  prompt: A majestic dragon soaring through dramatic stormy clouds, photorealistic, cinematic lighting, 8k ultra detailed
                  apiCreditCost: null
                  cost:
                    amount: '0.0147'
                    unit: DOLLARS
          description: Responses for POST /prompt/improve
components:
  schemas:
    cost:
      type:
      - object
      - 'null'
      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.'
  securitySchemes:
    bearerAuth:
      type: http
      bearerFormat: auth-scheme
      description: 'Bearer HTTP authentication. Allowed headers `Authorization: Bearer <api_key>`'
      scheme: bearer