> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iotools.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Merkle Tree Generator

> Build a Merkle tree from a list of leaves and compute its Merkle root using SHA-256, SHA-1 or Keccak-256. Choose UTF-8 or hex leaf encoding, the Bitcoin duplicate-last or promote odd-node rule, and raw or OpenZeppelin sorted pair concatenation.

[Try Merkle Tree Generator in your browser →](https://iotools.cloud/tool/merkle-tree-generator/)



## OpenAPI

````yaml https://api.iotools.cloud/v1/openapi post /v1/tool/merkle-tree-generator
openapi: 3.1.0
info:
  title: iotools.cloud API
  version: 1.0.0
  description: >-
    Run any iotools.cloud tool over HTTP.


    Authenticate with `Authorization: Bearer iot_live_…`.


    **Only `POST /v1/tool/{slug}` costs credits.** Every GET here — the catalog,
    a tool's schema, your balance — is free. A tool call is charged its own
    weight or your plan's per-call minimum, whichever is larger;
    `x-iotools-credit-cost` on each operation is quoted at the free-tier
    minimum, and `GET /v1/tools/list` returns the exact figure for your key.
    `GET /v1/me/credits` reports what you have left, and `GET /v1/me/usage`
    reports what it went on.


    Failures are RFC 9457 problem documents — branch on `code`.
servers:
  - url: https://api.iotools.cloud
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Catalog
    description: Find a tool and read its contract. Free.
  - name: Converters
    description: >-
      Convert between formats, encodings, and units — Base64, CSV and JSON,
      timestamps, and more. Fast, free, and processed right in your browser.
  - name: Formatters
    description: >-
      Format, beautify, minify, and validate code and data — JSON, HTML, CSS,
      SQL, and regex. Clean up messy input in one click, with nothing to upload.
  - name: Generators
    description: >-
      Generate exactly what you need and on demand — passwords, UUIDs, QR codes,
      hashes, random numbers, and more. Secure, instant, and free.
  - name: Calculators
    description: >-
      Crunch the numbers fast — from everyday math to specialized conversions
      and unit work. Free online calculators that run entirely in your browser.
  - name: Editors
    description: >-
      Edit and transform text, code, and images with quick, focused editors that
      run entirely in your browser — nothing to install, and no sign-up needed.
  - name: Utilities
    description: >-
      Everyday developer and web utilities — DNS and IP lookups, redirect and
      certificate checkers, and other quick diagnostics. Free and
      privacy-friendly.
  - name: Account
    description: Your key's allowance, limits and usage history.
paths:
  /v1/tool/merkle-tree-generator:
    post:
      tags:
        - Generators
      summary: Merkle Tree Generator
      description: >-
        Build a Merkle tree from a list of leaves and compute its Merkle root
        using SHA-256, SHA-1 or Keccak-256. Choose UTF-8 or hex leaf encoding,
        the Bitcoin duplicate-last or promote odd-node rule, and raw or
        OpenZeppelin sorted pair concatenation.


        [Try Merkle Tree Generator in your browser
        →](https://iotools.cloud/tool/merkle-tree-generator/)
      operationId: run_merkle_tree_generator
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                merkleLeaves:
                  type: string
                  description: Leaves (one per line)
                merkleHash:
                  enum:
                    - sha-256
                    - sha-1
                    - keccak-256
                  description: Hash function
                merkleLeafEncoding:
                  enum:
                    - utf8
                    - hex
                  description: Leaf encoding
                merkleOddRule:
                  enum:
                    - duplicate
                    - promote
                  description: Odd-leaf rule
                merkleConcat:
                  enum:
                    - bytes
                    - sorted
                  description: Pair concatenation
              required: []
            examples:
              4_leaves_sha_256_power_of_two:
                summary: 4 leaves, SHA-256 (power of two)
                value:
                  merkleLeaves: |-
                    a
                    b
                    c
                    d
                  merkleHash: sha-256
                  merkleLeafEncoding: utf8
                  merkleOddRule: duplicate
                  merkleConcat: bytes
              3_leaves_duplicate_last_bitcoin:
                summary: 3 leaves, duplicate-last (Bitcoin)
                value:
                  merkleLeaves: |-
                    a
                    b
                    c
                  merkleHash: sha-256
                  merkleLeafEncoding: utf8
                  merkleOddRule: duplicate
                  merkleConcat: bytes
              3_leaves_promote_last_carry_up:
                summary: 3 leaves, promote-last (carry up)
                value:
                  merkleLeaves: |-
                    a
                    b
                    c
                  merkleHash: sha-256
                  merkleLeafEncoding: utf8
                  merkleOddRule: promote
                  merkleConcat: bytes
              3_leaves_keccak_256_ethereum:
                summary: 3 leaves, Keccak-256 (Ethereum)
                value:
                  merkleLeaves: |-
                    alice
                    bob
                    carol
                  merkleHash: keccak-256
                  merkleLeafEncoding: utf8
                  merkleOddRule: duplicate
                  merkleConcat: bytes
              sorted_pairs_openzeppelin:
                summary: Sorted pairs (OpenZeppelin)
                value:
                  merkleLeaves: |-
                    a
                    b
                  merkleHash: sha-256
                  merkleLeafEncoding: utf8
                  merkleOddRule: duplicate
                  merkleConcat: sorted
      responses:
        '200':
          description: Tool output
          content:
            application/json:
              examples:
                4_leaves_sha_256_power_of_two:
                  summary: 4 leaves, SHA-256 (power of two)
                  value:
                    tool: merkle-tree-generator
                    tool_version: 1.0.1
                    outputs:
                      merkleRoot: >-
                        0x14ede5e8e97ad9372327728f5099b95604a39593cac3bd38a343ad76205213e7
                      merkleLevels:
                        - node: Leaf 0
                          leaf-input: a
                          hash-hex: >-
                            ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb
                        - node: Leaf 1
                          leaf-input: b
                          hash-hex: >-
                            3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d
                        - node: Leaf 2
                          leaf-input: c
                          hash-hex: >-
                            2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6
                        - node: Leaf 3
                          leaf-input: d
                          hash-hex: >-
                            18ac3e7343f016890c510e93f935261169d9e3f565436429830faf0934f4f8e4
                        - node: L1 · 0
                          leaf-input: —
                          hash-hex: >-
                            e5a01fee14e0ed5c48714f22180f25ad8365b53f9779f79dc4a3d7e93963f94a
                        - node: L1 · 1
                          leaf-input: —
                          hash-hex: >-
                            bffe0b34dba16bc6fac17c08bac55d676cded5a4ade41fe2c9924a5dde8f3e5b
                        - node: Root
                          leaf-input: —
                          hash-hex: >-
                            14ede5e8e97ad9372327728f5099b95604a39593cac3bd38a343ad76205213e7
                    credits_used: 3
                    credits_remaining: null
                3_leaves_duplicate_last_bitcoin:
                  summary: 3 leaves, duplicate-last (Bitcoin)
                  value:
                    tool: merkle-tree-generator
                    tool_version: 1.0.1
                    outputs:
                      merkleRoot: >-
                        0xd31a37ef6ac14a2db1470c4316beb5592e6afd4465022339adafda76a18ffabe
                      merkleLevels:
                        - node: Leaf 0
                          leaf-input: a
                          hash-hex: >-
                            ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb
                        - node: Leaf 1
                          leaf-input: b
                          hash-hex: >-
                            3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d
                        - node: Leaf 2
                          leaf-input: c
                          hash-hex: >-
                            2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6
                        - node: Leaf 3 (dup)
                          leaf-input: (duplicated)
                          hash-hex: >-
                            2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6
                        - node: L1 · 0
                          leaf-input: —
                          hash-hex: >-
                            e5a01fee14e0ed5c48714f22180f25ad8365b53f9779f79dc4a3d7e93963f94a
                        - node: L1 · 1
                          leaf-input: —
                          hash-hex: >-
                            a3e333fbee455b9a054cf05077f0f9d45b91bd13db4cd4a3681ec47455af085c
                        - node: Root
                          leaf-input: —
                          hash-hex: >-
                            d31a37ef6ac14a2db1470c4316beb5592e6afd4465022339adafda76a18ffabe
                    credits_used: 3
                    credits_remaining: null
                3_leaves_promote_last_carry_up:
                  summary: 3 leaves, promote-last (carry up)
                  value:
                    tool: merkle-tree-generator
                    tool_version: 1.0.1
                    outputs:
                      merkleRoot: >-
                        0x7075152d03a5cd92104887b476862778ec0c87be5c2fa1c0a90f87c49fad6eff
                      merkleLevels:
                        - node: Leaf 0
                          leaf-input: a
                          hash-hex: >-
                            ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb
                        - node: Leaf 1
                          leaf-input: b
                          hash-hex: >-
                            3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d
                        - node: Leaf 2
                          leaf-input: c
                          hash-hex: >-
                            2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6
                        - node: L1 · 0
                          leaf-input: —
                          hash-hex: >-
                            e5a01fee14e0ed5c48714f22180f25ad8365b53f9779f79dc4a3d7e93963f94a
                        - node: L1 · 1
                          leaf-input: —
                          hash-hex: >-
                            2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6
                        - node: Root
                          leaf-input: —
                          hash-hex: >-
                            7075152d03a5cd92104887b476862778ec0c87be5c2fa1c0a90f87c49fad6eff
                    credits_used: 3
                    credits_remaining: null
                3_leaves_keccak_256_ethereum:
                  summary: 3 leaves, Keccak-256 (Ethereum)
                  value:
                    tool: merkle-tree-generator
                    tool_version: 1.0.1
                    outputs:
                      merkleRoot: >-
                        0x4769804fb84fce618ce591bf18060dc48c34d27b99315b49bff3514b6168b6d1
                      merkleLevels:
                        - node: Leaf 0
                          leaf-input: alice
                          hash-hex: >-
                            9c0257114eb9399a2985f8e75dad7600c5d89fe3824ffa99ec1c3eb8bf3b0501
                        - node: Leaf 1
                          leaf-input: bob
                          hash-hex: >-
                            38e47a7b719dce63662aeaf43440326f551b8a7ee198cee35cb5d517f2d296a2
                        - node: Leaf 2
                          leaf-input: carol
                          hash-hex: >-
                            2c52130a69b3254240c961f6acfb09713f4f9cc14aa498cbf844b94a27da64ff
                        - node: Leaf 3 (dup)
                          leaf-input: (duplicated)
                          hash-hex: >-
                            2c52130a69b3254240c961f6acfb09713f4f9cc14aa498cbf844b94a27da64ff
                        - node: L1 · 0
                          leaf-input: —
                          hash-hex: >-
                            2bdf15e9913a52d9f36bb7e62634a6079cc32fc2fe975aadfcbc67b7e3a8a61b
                        - node: L1 · 1
                          leaf-input: —
                          hash-hex: >-
                            8181fb138cf8aa0e3b49d266c25cedb60be447dfd4ba6bac0087cf0fa65a65c6
                        - node: Root
                          leaf-input: —
                          hash-hex: >-
                            4769804fb84fce618ce591bf18060dc48c34d27b99315b49bff3514b6168b6d1
                    credits_used: 3
                    credits_remaining: null
                sorted_pairs_openzeppelin:
                  summary: Sorted pairs (OpenZeppelin)
                  value:
                    tool: merkle-tree-generator
                    tool_version: 1.0.1
                    outputs:
                      merkleRoot: >-
                        0x18d79cb747ea174c59f3a3b41768672526d56fecc58360a99d283d0f9b0a3cc0
                      merkleLevels:
                        - node: Leaf 0
                          leaf-input: a
                          hash-hex: >-
                            ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb
                        - node: Leaf 1
                          leaf-input: b
                          hash-hex: >-
                            3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d
                        - node: Root
                          leaf-input: —
                          hash-hex: >-
                            18d79cb747ea174c59f3a3b41768672526d56fecc58360a99d283d0f9b0a3cc0
                    credits_used: 3
                    credits_remaining: null
              schema:
                type: object
                required:
                  - tool
                  - tool_version
                  - outputs
                  - credits_used
                  - credits_remaining
                properties:
                  outputs:
                    type: object
                    properties:
                      merkleRoot:
                        type: string
                        description: Merkle root
                      merkleLevels:
                        type: array
                        description: Tree nodes
                        items:
                          type: object
                          properties:
                            node:
                              type: string
                              description: Node
                            leaf-input:
                              type: string
                              description: Leaf / input
                            hash-hex:
                              type: string
                              description: Hash (hex)
                        x-iotools-columns:
                          - node
                          - leaf-input
                          - hash-hex
                  tool:
                    type: string
                    description: The tool's slug, echoing the {slug} in the request path.
                  tool_version:
                    type: string
                    description: Output-contract version for this tool.
                  credits_used:
                    type: integer
                    description: >-
                      Credits this call consumed, after any settlement refund. 0
                      when metering is disabled.
                  credits_remaining:
                    type:
                      - integer
                      - 'null'
                    description: >-
                      Credits left in the current monthly allowance, or null
                      when metering is disabled.
                  request_id:
                    type: string
                    description: Correlation id, also sent as x-request-id.
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/ToolNotAllowed'
        '404':
          $ref: '#/components/responses/ToolNotFound'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ToolFailed'
        '503':
          $ref: '#/components/responses/ToolDisabled'
      security:
        - bearerAuth: []
components:
  responses:
    ValidationError:
      description: Invalid request.
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/validation_error
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Invalid request
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - validation_error
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
              fields:
                type:
                  - object
                  - string
                additionalProperties:
                  type: string
                description: >-
                  What failed: a map of field name → message. Absent when the
                  body itself is malformed; a single string when the failure
                  isn't tied to one field.
          example:
            type: https://iotools.cloud/docs/errors/validation_error
            title: Invalid request
            status: 400
            code: validation_error
            detail: One or more inputs are invalid — see `fields`.
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
            fields:
              inputString: Required
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/invalid_api_key
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Invalid API key
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - invalid_api_key
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
          example:
            type: https://iotools.cloud/docs/errors/invalid_api_key
            title: Invalid API key
            status: 401
            code: invalid_api_key
            detail: 'Provide ''Authorization: Bearer <key>''.'
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
    InsufficientCredits:
      description: Monthly credit allowance exhausted.
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/insufficient_credits
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Insufficient credits
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - insufficient_credits
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
              credits_used:
                type: integer
                description: Always 0 — a refused call charges nothing.
              credits_remaining:
                type: integer
                description: Credits left in the allowance — fewer than this call costs.
          example:
            type: https://iotools.cloud/docs/errors/insufficient_credits
            title: Insufficient credits
            status: 402
            code: insufficient_credits
            detail: This call costs 1 credit and 0 remain in this month's allowance.
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
            credits_used: 0
            credits_remaining: 0
    ToolNotAllowed:
      description: Tool exists but has no API surface.
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/tool_not_allowed
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Tool not available over the API
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - tool_not_allowed
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
          example:
            type: https://iotools.cloud/docs/errors/tool_not_allowed
            title: Tool not available over the API
            status: 403
            code: tool_not_allowed
            detail: >-
              "Background Remover" is available on iotools.cloud but has no API
              endpoint.
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
    ToolNotFound:
      description: No such tool.
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/tool_not_found
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Tool not found
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - tool_not_found
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
          example:
            type: https://iotools.cloud/docs/errors/tool_not_found
            title: Tool not found
            status: 404
            code: tool_not_found
            detail: No tool with that slug. See GET /v1/tools/list.
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
    PayloadTooLarge:
      description: Body too large.
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/payload_too_large
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Payload too large
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - payload_too_large
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
          example:
            type: https://iotools.cloud/docs/errors/payload_too_large
            title: Payload too large
            status: 413
            code: payload_too_large
            detail: Request body exceeds this tool's size limit.
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
    RateLimited:
      description: Per-minute rate limit exceeded.
      headers:
        Retry-After:
          description: Seconds to wait before retrying (RFC 9110 delta-seconds).
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/rate_limited
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Rate limit exceeded
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - rate_limited
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
              retry_after:
                type: integer
                description: >-
                  Seconds until the window resets — the same value as the
                  `Retry-After` header.
          example:
            type: https://iotools.cloud/docs/errors/rate_limited
            title: Rate limit exceeded
            status: 429
            code: rate_limited
            detail: Too many requests. Retry in 30s.
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
            retry_after: 30
    ToolFailed:
      description: Tool failed to run.
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/processing_error
                  - https://iotools.cloud/docs/errors/internal_error
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Tool failed to run
                  - Internal error
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - processing_error
                  - internal_error
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
              credits_used:
                type: integer
                description: >-
                  Always 0 on `processing_error` — a failed run is refunded,
                  floor included.
              credits_remaining:
                type: integer
                description: >-
                  Credits left after the refund. Absent when metering is
                  disabled.
          example:
            type: https://iotools.cloud/docs/errors/processing_error
            title: Tool failed to run
            status: 500
            code: processing_error
            detail: The tool failed to run. Please try again.
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
            credits_used: 0
    ToolDisabled:
      description: Tool temporarily disabled.
      content:
        application/problem+json:
          schema:
            type: object
            description: >-
              RFC 9457 problem document, served as application/problem+json.
              Branch on `code`; `title` is human prose and may be reworded
              without notice. Some failures add extension members — `fields` on
              validation errors, `retry_after` on 429s,
              `credits_used`/`credits_remaining` on billing-adjacent failures —
              documented on the responses that carry them.
            required:
              - type
              - title
              - status
              - code
            properties:
              type:
                type: string
                format: uri
                description: Stable documentation URI for this failure.
                examples:
                  - https://iotools.cloud/docs/errors/tool_disabled
                  - https://iotools.cloud/docs/errors/api_unconfigured
              title:
                type: string
                description: Short human-readable summary of the failure.
                examples:
                  - Tool temporarily disabled
                  - API not configured
              status:
                type: integer
                description: HTTP status code, matching the response's own status.
              code:
                type: string
                description: >-
                  Stable machine-readable error code — branch on this, not
                  `title`.
                enum:
                  - tool_disabled
                  - api_unconfigured
              detail:
                type: string
                description: Human explanation of this occurrence.
              request_id:
                type: string
                description: Correlation id, also sent as x-request-id.
          example:
            type: https://iotools.cloud/docs/errors/tool_disabled
            title: Tool temporarily disabled
            status: 503
            code: tool_disabled
            detail: This tool is temporarily unavailable. Try again shortly.
            request_id: e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: iot_live_…

````