naftiko: 1.0.0-alpha2 info: label: Leonardo.AI Elements description: 'Leonardo.AI Elements. 5 operations. Lead operation: Get a Single Custom Element by ID. Self-contained Naftiko capability covering the Leonardo.AI Elements business surface.' tags: - Leonardo.AI - Elements created: '2026-05-25' modified: '2026-05-25' binds: - namespace: env keys: LEONARDO_AI_API_KEY: LEONARDO_AI_API_KEY capability: consumes: - type: http namespace: elements baseUri: https://cloud.leonardo.ai/api/rest/v1 description: Leonardo.AI Elements business capability. Self-contained, no shared references. resources: - name: elements-id path: /elements/{id} operations: - name: get-element-by-id method: GET description: This endpoint gets the specific custom element. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: integer description: The ID of the custom element to return. required: true - name: delete-element-by-id method: DELETE description: This endpoint will delete a specific custom model. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: integer description: The ID of the element to delete. required: true - name: elements-user-user-id path: /elements/user/{userId} operations: - name: get-custom-elements-by-user-id method: GET description: This endpoint gets the list of custom elements belongs to the user. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: userId in: path type: string description: The ID of the user to return. required: true - name: elements path: /elements operations: - name: create-element method: POST description: This endpoint will train a new custom element. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: list-elements method: GET description: Get a list of public Elements available for use with generations. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: [] authentication: type: bearer value: '{{env.LEONARDO_AI_API_KEY}}' placement: header exposes: - type: rest namespace: elements-rest port: 8080 description: REST adapter for Leonardo.AI Elements. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/elements/{id} name: elements-id description: REST surface for elements-id. operations: - method: GET name: get-element-by-id description: This endpoint gets the specific custom element. call: elements.get-element-by-id with: id: rest.id outputParameters: - type: object mapping: $. - method: DELETE name: delete-element-by-id description: This endpoint will delete a specific custom model. call: elements.delete-element-by-id with: id: rest.id outputParameters: - type: object mapping: $. - path: /v1/elements/user/{userId} name: elements-user-user-id description: REST surface for elements-user-user-id. operations: - method: GET name: get-custom-elements-by-user-id description: This endpoint gets the list of custom elements belongs to the user. call: elements.get-custom-elements-by-user-id with: userId: rest.userId outputParameters: - type: object mapping: $. - path: /v1/elements name: elements description: REST surface for elements. operations: - method: POST name: create-element description: This endpoint will train a new custom element. call: elements.create-element with: body: rest.body outputParameters: - type: object mapping: $. - method: GET name: list-elements description: Get a list of public Elements available for use with generations. call: elements.list-elements with: {} outputParameters: - type: object mapping: $. - type: mcp namespace: elements-mcp port: 9090 transport: http description: MCP adapter for Leonardo.AI Elements. One tool per consumed operation, routed through this capability's consumes block. tools: - name: leonardo-ai-get-element-by-id description: This endpoint gets the specific custom element. hints: readOnly: true destructive: false idempotent: true call: elements.get-element-by-id with: id: tools.id outputParameters: - type: object mapping: $. - name: leonardo-ai-delete-element-by-id description: This endpoint will delete a specific custom model. hints: readOnly: false destructive: true idempotent: true call: elements.delete-element-by-id with: id: tools.id outputParameters: - type: object mapping: $. - name: leonardo-ai-get-custom-elements-by-user-id description: This endpoint gets the list of custom elements belongs to the user. hints: readOnly: true destructive: false idempotent: true call: elements.get-custom-elements-by-user-id with: userId: tools.userId outputParameters: - type: object mapping: $. - name: leonardo-ai-create-element description: This endpoint will train a new custom element. hints: readOnly: false destructive: false idempotent: false call: elements.create-element with: body: tools.body outputParameters: - type: object mapping: $. - name: leonardo-ai-list-elements description: Get a list of public Elements available for use with generations. hints: readOnly: true destructive: false idempotent: true call: elements.list-elements with: {} outputParameters: - type: object mapping: $.