Server402 marketplace

Paid API service

PDF to Markdown

Convert a public http or https pdfUrl into Markdown from the first OCR-rendered pages. The service renders up to three pages with pdftoppm, uploads page images through the configured OSS image proxy, runs multilingual OCR, and returns combined markdown plus per-page OCR content. Unpaid calls return HTTP 402 before provider execution.

Invocation

Service ID
pdf-to-markdown
Method
POST
Endpoint
/api/tools/pdf-to-markdown
Legacy Endpoint
/api/tools/aliyun-pdf-to-markdown
MCP Tool
pdf_to_markdown
Price
USD 0.03

Payment

Call the endpoint without payment to receive HTTP 402 metadata. After payment is complete, retry with X-Payment-Token, an x402 payment signature, or MCP paymentToken.

Call POST /api/tools/pdf-to-markdown once to receive HTTP 402 with accepts[] requirements, or create a payment with POST /api/payments using serviceId="pdf-to-markdown". Pay Base USDC with PAYMENT-SIGNATURE or pay XIAO with X402-Guarantee, then retry the same request.

Schema And Examples

{
  "exampleRequest": {
    "language": "eng",
    "maxPages": 3,
    "needRotate": true,
    "outputTable": true,
    "pdfUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  },
  "exampleResponse": {
    "content": "Dummy PDF file",
    "markdown": "Dummy PDF file",
    "max_pages": 3,
    "ocr_service_id": "multilingual-ocr",
    "page_count": 1,
    "pages": [
      {
        "content": "Dummy PDF file",
        "markdown": "\u003c!-- page: 1 --\u003e\n\nDummy PDF file",
        "page": 1
      }
    ],
    "processed_pages": 1,
    "renderer": "pdftoppm",
    "service_id": "pdf-to-markdown",
    "source_pdf_url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  },
  "inputSchema": {
    "additionalProperties": false,
    "properties": {
      "dpi": {
        "default": 180,
        "maximum": 240,
        "minimum": 72,
        "type": "integer"
      },
      "language": {
        "default": "auto",
        "description": "OCR language hint such as auto, eng, or chn.",
        "type": "string"
      },
      "maxPages": {
        "default": 3,
        "maximum": 3,
        "minimum": 1,
        "type": "integer"
      },
      "needRotate": {
        "default": true,
        "type": "boolean"
      },
      "outputTable": {
        "default": true,
        "type": "boolean"
      },
      "pdfUrl": {
        "description": "Public http or https PDF URL.",
        "format": "uri",
        "type": "string"
      }
    },
    "required": [
      "pdfUrl"
    ],
    "type": "object"
  },
  "outputSchema": {
    "properties": {
      "content": {
        "type": "string"
      },
      "markdown": {
        "type": "string"
      },
      "max_pages": {
        "type": "integer"
      },
      "ocr_service_id": {
        "type": "string"
      },
      "page_count": {
        "type": "integer"
      },
      "pages": {
        "items": {
          "type": "object"
        },
        "type": "array"
      },
      "processed_pages": {
        "type": "integer"
      },
      "renderer": {
        "type": "string"
      },
      "service_id": {
        "type": "string"
      },
      "source_pdf_url": {
        "type": "string"
      }
    },
    "required": [
      "service_id",
      "markdown",
      "pages",
      "page_count",
      "processed_pages",
      "max_pages"
    ],
    "type": "object"
  }
}