Markdown to PDF API

Convert Markdown text to a beautifully formatted PDF document. Send raw markdown, get back a downloadable PDF.

POST https://pylon-md-to-pdf-api.fly.dev/convert

Endpoint

Base URL:

https://pylon-md-to-pdf-api.fly.dev

Parameters

ParameterTypeRequiredDescription
markdownstring (JSON body)YesMarkdown text to convert

Response

Returns a PDF document (200 OK with Content-Type: application/pdf).

StatusDescription
200PDF document returned
402Payment required — x402 challenge returned
400Missing or invalid markdown
500Conversion failed

Pricing

$0.01 USDC per request — paid via x402 on Base Sepolia. No API key. No subscription. Pay per call.

Code Examples

curl -X POST "https://pylon-md-to-pdf-api.fly.dev/convert" \
  -H "Content-Type: application/json" \
  -d '{"markdown": "# Hello World\n\nThis is **bold** text."}' \
  --output output.pdf

x402 Setup

To use Pylon APIs, you need an x402-compatible client with a funded wallet on Base Sepolia. Here's the quick setup:

  1. Get a wallet with USDC on Base Sepolia (testnet)
  2. Install an x402 client library (x402.org Status Terms Privacy for options)
  3. Configure it with your private key
  4. Make requests — the client handles the 402 payment flow automatically

The x402 flow: your first request returns 402 Payment Required with payment details in headers. The x402 client signs a USDC payment, then retries with payment proof attached. All automatic, all in milliseconds.