Leonardo.AI · API Governance Rules

Leonardo.AI API Rules

Spectral linting rules defining API design standards and conventions for Leonardo.AI.

9 Rules error 4 warn 4
Authorship not recorded No authorship marker is recorded for this file. It is not presented as the provider's; it was most likely written by an API Evangelist pass before outputs were stamped.
View Rules File View on GitHub

Rule Categories

bearer id no operation resource server tag

Rules

error
operation-id-pattern
Leonardo.AI uses lowerCamelCase operationIds (e.g. createGeneration, getGenerationById).
$.paths.*[get,post,put,delete,patch].operationId
warn
resource-path-kebab-or-camel
Leonardo.AI paths use kebab-case segments and lowerCamelCase parameter names (e.g. /init-image, /platformModels, /generations-image-to-video).
$.paths
error
tag-required
Every operation must declare at least one tag.
$.paths.*[get,post,put,delete,patch]
error
bearer-security
Leonardo.AI requires HTTP bearer authentication on every operation.
$
warn
operation-summary-required
Every operation should have a non-empty summary.
$.paths.*[get,post,put,delete,patch]
warn
operation-summary-title-case
Operation summaries should use Title Case.
$.paths.*[get,post,put,delete,patch].summary
error
no-trailing-slash
Leonardo.AI paths do not end with a trailing slash.
$.paths
hint
id-path-uuid
Path parameters named {id} are UUIDs and should declare format: uuid where present.
$.paths.*.parameters[?(@.in=='path' && @.name=='id')].schema
warn
server-leonardo
The canonical Leonardo.AI server URL is https://cloud.leonardo.ai/api/rest/v1.
$.servers[*].url

Spectral Ruleset

Raw ↑
extends: spectral:oas
documentationUrl: https://docs.leonardo.ai/
rules:
  # Naming & casing
  operation-id-pattern:
    description: Leonardo.AI uses lowerCamelCase operationIds (e.g. createGeneration, getGenerationById).
    severity: error
    given: "$.paths.*[get,post,put,delete,patch].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"

  resource-path-kebab-or-camel:
    description: Leonardo.AI paths use kebab-case segments and lowerCamelCase parameter names (e.g. /init-image, /platformModels, /generations-image-to-video).
    severity: warn
    given: "$.paths"
    then:
      field: "@key"
      function: pattern
      functionOptions:
        match: "^(/[a-z0-9][a-z0-9-]*(/\\{[a-zA-Z]+\\})?)+$"

  tag-required:
    description: Every operation must declare at least one tag.
    severity: error
    given: "$.paths.*[get,post,put,delete,patch]"
    then:
      field: tags
      function: truthy

  bearer-security:
    description: Leonardo.AI requires HTTP bearer authentication on every operation.
    severity: error
    given: "$"
    then:
      field: "components.securitySchemes.bearerAuth"
      function: truthy

  # Documentation
  operation-summary-required:
    description: Every operation should have a non-empty summary.
    severity: warn
    given: "$.paths.*[get,post,put,delete,patch]"
    then:
      field: summary
      function: truthy

  operation-summary-title-case:
    description: Operation summaries should use Title Case.
    severity: warn
    given: "$.paths.*[get,post,put,delete,patch].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  # Conventions
  no-trailing-slash:
    description: Leonardo.AI paths do not end with a trailing slash.
    severity: error
    given: "$.paths"
    then:
      field: "@key"
      function: pattern
      functionOptions:
        notMatch: "/$"

  id-path-uuid:
    description: "Path parameters named {id} are UUIDs and should declare format: uuid where present."
    severity: hint
    given: "$.paths.*.parameters[?(@.in=='path' && @.name=='id')].schema"
    then:
      field: format
      function: enumeration
      functionOptions:
        values: ["uuid"]

  server-leonardo:
    description: The canonical Leonardo.AI server URL is https://cloud.leonardo.ai/api/rest/v1.
    severity: warn
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://cloud\\.leonardo\\.ai/api/rest/v1$"

Work with this as data

Every ruleset 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 spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • 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 ruleset
curl "https://apis.io/api/v1/rules/leonardo-ai-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?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.