{
  "openapi": "3.1.0",
  "info": {
    "title": "Leafmelt API",
    "version": "1.0.0",
    "summary": "Document to Markdown API and remote MCP server: converts PDF, Word (.docx), Excel (.xlsx/.xlsm/.xlsb/.xls), OpenDocument (.odt/.ods), Apple Numbers, CSV, HTML and XML into clean Markdown for LLMs and RAG, with headings and tables kept, character and approximate token counts and a preview. Up to 5 documents per call, 10 MB each, by URL or base64 upload. No install, no Python.",
    "description": "Send a PDF, Word, Excel, OpenDocument, Numbers, CSV or HTML file (by URL or upload, up to 5 per call) and get LLM-ready Markdown with headings and tables kept, plus a token count. For AI agents, RAG pipelines and no-code tools. Free tier, no key; plans from $19/month.\n\nFree tier: Up to 5 documents per call, 10 MB each; 10 calls a minute per IP on the free tier. Free tier: 50 calls a day per IP, no key. Paid keys from $19/month (see Get an API key). Formats: PDF, Word (.docx), Excel (.xlsx/.xlsm/.xlsb/.xls), OpenDocument (.odt/.ods), Apple Numbers, CSV, HTML and XML. Images and scanned PDFs without a text layer are not converted (no OCR); old Word .doc files need saving as .docx. PDF text keeps reading order, but lines inside a paragraph can run together; Word, Excel and OpenDocument tables come out as Markdown tables. Documents are converted in memory and never stored. Links must be public http(s) URLs. No key needed. Remote MCP server: https://leafmelt.cybermax-tools.workers.dev/mcp\n\nPricing: free tier 50 calls/day per IP, no key. Paid API keys: Solo $19/month = 3,000 calls/month; Team $49/month = 10,000 calls/month; Pipeline $99/month = 25,000 calls/month; Pay as you go $5 = 750 calls (one-time pack); Solo yearly $190/year = 3,000 calls/month; Team yearly $490/year = 10,000 calls/month; Pipeline yearly $990/year = 25,000 calls/month. Get a key: https://leafmelt.cybermax-tools.workers.dev/docs#pricing",
    "contact": {
      "name": "CyberMax",
      "url": "https://cybermax-tools-cybermax.static.hf.space/"
    },
    "license": {
      "name": "Proprietary (free tier + paid API keys)",
      "identifier": "LicenseRef-CyberMax"
    },
    "x-pricing": {
      "api": "Leafmelt API",
      "currency": "USD",
      "free": {
        "price": 0,
        "callsPerDayPerIp": 50,
        "perMinutePerIp": 10,
        "key": "none needed"
      },
      "plans": [
        {
          "id": "solo",
          "name": "Solo",
          "price": 19,
          "billing": "per month",
          "calls": 3000,
          "per": "calendar month (UTC)",
          "perMinute": 30,
          "buy": "https://leafmelt.cybermax-tools.workers.dev/buy/solo?s=openapi"
        },
        {
          "id": "team",
          "name": "Team",
          "price": 49,
          "billing": "per month",
          "calls": 10000,
          "per": "calendar month (UTC)",
          "perMinute": 60,
          "buy": "https://leafmelt.cybermax-tools.workers.dev/buy/team?s=openapi"
        },
        {
          "id": "pipeline",
          "name": "Pipeline",
          "price": 99,
          "billing": "per month",
          "calls": 25000,
          "per": "calendar month (UTC)",
          "perMinute": 120,
          "buy": "https://leafmelt.cybermax-tools.workers.dev/buy/pipeline?s=openapi"
        },
        {
          "id": "payg",
          "name": "Pay as you go",
          "price": 5,
          "billing": "one-time",
          "calls": 750,
          "per": "until used",
          "perMinute": 30,
          "buy": "https://leafmelt.cybermax-tools.workers.dev/buy/payg?s=openapi"
        },
        {
          "id": "solo-yearly",
          "name": "Solo yearly",
          "price": 190,
          "billing": "per year",
          "calls": 3000,
          "per": "calendar month (UTC)",
          "perMinute": 30,
          "buy": "https://leafmelt.cybermax-tools.workers.dev/buy/solo-yearly?s=openapi"
        },
        {
          "id": "team-yearly",
          "name": "Team yearly",
          "price": 490,
          "billing": "per year",
          "calls": 10000,
          "per": "calendar month (UTC)",
          "perMinute": 60,
          "buy": "https://leafmelt.cybermax-tools.workers.dev/buy/team-yearly?s=openapi"
        },
        {
          "id": "pipeline-yearly",
          "name": "Pipeline yearly",
          "price": 990,
          "billing": "per year",
          "calls": 25000,
          "per": "calendar month (UTC)",
          "perMinute": 120,
          "buy": "https://leafmelt.cybermax-tools.workers.dev/buy/pipeline-yearly?s=openapi"
        }
      ],
      "unit": "calls",
      "howToUse": {
        "header": "x-api-key: YOUR_KEY",
        "alt": [
          "Authorization: Bearer YOUR_KEY",
          "?key=YOUR_KEY"
        ],
        "mcp": "send the key as Authorization: Bearer YOUR_KEY",
        "usage": "https://leafmelt.cybermax-tools.workers.dev/key"
      },
      "manageKey": "https://leafmelt.cybermax-tools.workers.dev/manage",
      "allAccess": {
        "name": "CyberMax API All-Access",
        "apis": 9,
        "url": "https://api-all-access.cybermax-tools.workers.dev/?s=openapi-leafmelt",
        "plans": [
          {
            "id": "all-access",
            "price": 119,
            "billing": "per month",
            "callsHere": 3000,
            "per": "calendar month (UTC)"
          },
          {
            "id": "all-access-pack",
            "price": 32,
            "billing": "one-time",
            "callsHere": 750,
            "per": "until used"
          }
        ],
        "note": "One key for every CyberMax API; Leafmelt counts it separately."
      },
      "payments": "Stripe Checkout: card, Apple Pay, Google Pay, Link; sales tax/VAT handled by Stripe. Cancel any time at https://leafmelt.cybermax-tools.workers.dev/manage."
    }
  },
  "servers": [
    {
      "url": "https://leafmelt.cybermax-tools.workers.dev"
    }
  ],
  "paths": {
    "/api/convert": {
      "get": {
        "tags": [
          "Leafmelt"
        ],
        "summary": "Convert up to 5 documents (URL or upload) to Markdown",
        "description": "For each document: markdown, detected format, size, characters, approximate tokens (characters ÷ 4), a one-line preview, document metadata (title, author… when present), truncated (true when cut at maxChars), emptyText (true when almost no text came out, e.g. a scanned PDF) and the time taken. Failed documents come back with ok: false and the reason; the call only fails when none converted. Formats: PDF, Word (.docx), Excel (.xlsx/.xlsm/.xlsb/.xls), OpenDocument (.odt/.ods), Apple Numbers, CSV, HTML and XML.",
        "operationId": "convertToMarkdownGet",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "Document URL, or up to 5 separated by commas or spaces (or POST {\"urls\": [...]})",
            "schema": {
              "type": "string"
            },
            "example": "https://leafmelt.cybermax-tools.workers.dev/samples/quarterly-report.pdf"
          },
          {
            "name": "maxChars",
            "in": "query",
            "required": false,
            "description": "Cut each document's Markdown at this many characters (1,000 to 2,000,000; default 200,000)",
            "schema": {
              "type": "integer",
              "default": 200000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "converted": 1,
                  "failed": 0,
                  "documents": [
                    {
                      "ok": true,
                      "source": "https://leafmelt.cybermax-tools.workers.dev/samples/meeting-notes.docx",
                      "name": "meeting-notes.docx",
                      "format": "Word (.docx)",
                      "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                      "bytes": 37009,
                      "characters": 467,
                      "approxTokens": 117,
                      "truncated": false,
                      "emptyText": false,
                      "preview": "Meeting notes: product launch review A fictional sample document for testing Leafmelt. Decisions Launch date moves to 14 October. Pricing s…",
                      "ms": 1014,
                      "metadata": {},
                      "markdown": "# meeting-notes.docx\n\nMeeting notes: product launch review\n\nA fictional sample document for testing Leafmelt.\n\n# Decisions\n\n* Launch date moves to 14 October.\n* Pricing stays at $9 and $29 a month.\n* Support hours: 9 AM to 5 PM ET.\n\n# Owners\n\n| Task              | Owner       | Due    |\n| ----------------- | ----------- | ------ |\n| Landing page copy | Marketing   | 6 Oct  |\n| Billing tests     | Engineering | 8 Oct  |\n| Help centre       | Support     | 10 Oct |"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Leafmelt"
        ],
        "summary": "Convert up to 5 documents (URL or upload) to Markdown",
        "description": "For each document: markdown, detected format, size, characters, approximate tokens (characters ÷ 4), a one-line preview, document metadata (title, author… when present), truncated (true when cut at maxChars), emptyText (true when almost no text came out, e.g. a scanned PDF) and the time taken. Failed documents come back with ok: false and the reason; the call only fails when none converted. Formats: PDF, Word (.docx), Excel (.xlsx/.xlsm/.xlsb/.xls), OpenDocument (.odt/.ods), Apple Numbers, CSV, HTML and XML.",
        "operationId": "convertToMarkdownPost",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "urls": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "maxItems": 5
                  },
                  "files": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "file name with extension, e.g. report.pdf"
                        },
                        "base64": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "base64"
                      ]
                    }
                  },
                  "maxChars": {
                    "type": "integer"
                  }
                }
              },
              "example": {
                "urls": [
                  "https://leafmelt.cybermax-tools.workers.dev/samples/meeting-notes.docx",
                  "https://leafmelt.cybermax-tools.workers.dev/samples/orders.xlsx"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results (same field names as the bulk version's dataset records) plus the free-tier limits.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "converted": 1,
                  "failed": 0,
                  "documents": [
                    {
                      "ok": true,
                      "source": "https://leafmelt.cybermax-tools.workers.dev/samples/meeting-notes.docx",
                      "name": "meeting-notes.docx",
                      "format": "Word (.docx)",
                      "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                      "bytes": 37009,
                      "characters": 467,
                      "approxTokens": 117,
                      "truncated": false,
                      "emptyText": false,
                      "preview": "Meeting notes: product launch review A fictional sample document for testing Leafmelt. Decisions Launch date moves to 14 October. Pricing s…",
                      "ms": 1014,
                      "metadata": {},
                      "markdown": "# meeting-notes.docx\n\nMeeting notes: product launch review\n\nA fictional sample document for testing Leafmelt.\n\n# Decisions\n\n* Launch date moves to 14 October.\n* Pricing stays at $9 and $29 a month.\n* Support hours: 9 AM to 5 PM ET.\n\n# Owners\n\n| Task              | Owner       | Due    |\n| ----------------- | ----------- | ------ |\n| Landing page copy | Marketing   | 6 Oct  |\n| Billing tests     | Engineering | 8 Oct  |\n| Help centre       | Support     | 10 Oct |"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Free tier used up (50/day per IP) or rate/plan limit reached; the body has an upgrade link.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "Took too long; ask for fewer items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryAfterSeconds": {
            "type": "integer"
          },
          "limits": {
            "type": "object"
          }
        },
        "required": [
          "error",
          "message"
        ]
      }
    },
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Optional. Paid plan key from https://leafmelt.cybermax-tools.workers.dev/docs#pricing; leave out for the free tier."
      },
      "BearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Same key as a Bearer token."
      }
    }
  },
  "x-mcp-server": "https://leafmelt.cybermax-tools.workers.dev/mcp",
  "externalDocs": {
    "description": "Get an API key (pricing)",
    "url": "https://leafmelt.cybermax-tools.workers.dev/docs#pricing"
  },
  "security": [
    {},
    {
      "ApiKeyHeader": []
    },
    {
      "BearerKey": []
    }
  ]
}