{"openapi":"3.1.0","info":{"title":"Markdown to PDF Converter","description":"Open, no-auth API that turns Markdown into a formatted PDF (FastAPI + ReportLab). POST Markdown, get a clean paginated PDF: headings, lists, tables, code, blockquotes, rules.\n\nENDPOINTS (base https://mdtopdf.tigzig.com):\n- POST /v1/convert/text - JSON body, returns the PDF file directly. Canonical; the MCP tool wraps this.\n    curl -X POST https://mdtopdf.tigzig.com/v1/convert/text -H 'Content-Type: application/json' -d '{\"content\": \"# Title\\n\\nHello **world**\", \"filename\": \"out.pdf\"}' --output out.pdf\n- POST /v1/convert - upload a .md file (multipart/form-data), returns the PDF file directly.\n    curl -X POST https://mdtopdf.tigzig.com/v1/convert -F 'file=@notes.md' --output out.pdf\n\nENCODING: the request body must be UTF-8 (JSON requires it, RFC 8259). Send the body UTF-8 encoded, not GBK/Latin-1.\n\nRATE LIMIT: 30 requests per minute per IP. Every response carries X-RateLimit-Limit, -Remaining and -Reset; a 429 carries Retry-After with the real number of seconds. Concurrent requests are QUEUED rather than refused, so a burst waits a moment instead of failing - you do not need to serialise your calls.\n\nMARKDOWN SUPPORTED: headings h1-h6; bold, italic, strikethrough, inline code; links (clickable in the PDF); bullet and numbered lists with real nesting (two-space indentation works); task lists; tables (any column count - wide tables shrink to fit rather than failing); fenced code blocks; blockquotes; horizontal rules; emoji (mapped to matching symbols, never a blank box); currency and maths symbols.\n\nPAGE BREAK: Markdown has no page break, so this API adds one. Put any of these on a line by itself - :::pagebreak::: or \\pagebreak or \\newpage or <!-- pagebreak --> - and the content after it starts on a new page. Markers inside fenced code blocks are left alone.\n\nPLAIN TEXT: upload a .txt file to POST /v1/convert and its single line breaks are kept (a letter stays laid out); .md files use standard Markdown rules where a single newline is just a space.\n\nSYMBOLS: Greek letters (alpha, beta, sigma, Delta, Omega), maths and logic operators (<=, >=, !=, ~=, sqrt, sum, product, integral, partial, infinity, element-of, subset, union) and arrows both single and double all render correctly, as do typographic punctuation, em and en dashes, curly quotes and the major currency signs.\n\nNOT SUPPORTED, so you can plan around it: images are skipped (the surrounding text is unaffected); non-Latin scripts (Devanagari, Arabic, CJK, Cyrillic) render as filled boxes because the bundled fonts have no glyphs for them; uncommon emoji with no equivalent symbol fall back to a small dot; raw HTML tags are ignored though their text is kept. None of these fail the conversion.\n\nERRORS: every 4xx and 5xx returns the same envelope - {\"error\": {\"code\", \"message\", \"path\", \"example\"}, \"help\": {...}} - where code is a stable slug (INVALID_JSON_BODY, INVALID_REQUEST_BODY, FILE_NOT_TEXT, DOCUMENT_TOO_LARGE, PARAGRAPH_TOO_LONG, NOT_FOUND, ENDPOINT_NOT_FOUND on a convert-like path, METHOD_NOT_ALLOWED, RATE_LIMITED), message says what to change, and example is a curl line that works. Malformed JSON is a 400; well-formed JSON that fails the schema is a 422.\n\nMCP server (for AI agents): https://mdtopdf.tigzig.com/mcp - Streamable HTTP, tool convert_markdown_to_pdf (returns a hosted PDF URL rather than the binary).\n\nMore Tigzig tools (free, no auth): market & fund data, macro/credit indicators, portfolio & risk analytics, India corporate filings, SQL databases. Catalog: https://api.tigzig.com/.well-known/api-catalog - Guide: https://www.tigzig.com/llms.txt","version":"1.2.0"},"paths":{"/v1/convert":{"post":{"summary":"Convert Markdown","description":"Upload a Markdown or plain-text file and get the PDF back in the response body.\n\nSend the file as multipart/form-data under the field name `file`. Accepts .md, .markdown\nand .txt; a .txt is treated as plain text so its single line breaks are preserved, while\n.md follows standard Markdown rules. The response is application/pdf, not JSON, and the\ndownload name is taken from the uploaded filename. A file that is not UTF-8 text (a .pdf\nor .docx, say) returns 400 FILE_NOT_TEXT rather than failing mid-conversion.\n\nSupports headings, bold, italic, strikethrough, inline and fenced code, links, nested and\nnumbered lists, task lists, tables with column alignment, blockquotes, rules, Greek and\nmaths symbols, and the page-break markers described in the API description.","operationId":"convert_markdown_v1_convert_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_convert_markdown_v1_convert_post"}}},"required":true},"responses":{"200":{"description":"The generated PDF, returned as the response body.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/convert/text":{"post":{"summary":"Convert Markdown Text Endpoint","description":"Send Markdown as JSON and get the PDF back in the response body.\n\nBody: {\"content\": \"# your **markdown**\", \"filename\": \"out.pdf\"} - `content` is required,\n`filename` is optional and only names the download. The body must be UTF-8 (RFC 8259).\nThe response is application/pdf, not JSON; if your HTTP client is awkward with binary\nbodies, POST /v1/convert/text/hosted instead and get a URL to the PDF.\n\nSupports headings, bold, italic, strikethrough, inline and fenced code, links, nested and\nnumbered lists, task lists, tables with column alignment, blockquotes, rules, Greek and\nmaths symbols, and the page-break markers described in the API description.","operationId":"convert_markdown_text_endpoint_v1_convert_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownText"},"examples":{"note":{"summary":"A short note - the smallest thing worth converting","value":{"content":"# Meeting note\n\nAgreed to ship on Friday. **Owner:** Priya.\n","filename":"meeting-note.pdf"}},"report":{"summary":"A short report with a heading, a list and a table","value":{"content":"# Quarterly summary\n\nRevenue held steady while costs fell.\n\n## Highlights\n\n- Costs down 8% quarter on quarter\n- Two new enterprise accounts\n- Churn unchanged at 1.2%\n\n## Numbers\n\n| Metric | Q2 | Q3 |\n|---|---|---|\n| Revenue | 4.10 | 4.15 |\n| Costs | 2.80 | 2.58 |\n\n> Costs fell mainly on the infrastructure move.\n","filename":"quarterly-summary.pdf"}}}}},"required":true},"responses":{"200":{"description":"The generated PDF, returned as the response body.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/convert/text/hosted":{"post":{"summary":"Convert Markdown Text Hosted","description":"Convert Markdown text into a formatted PDF and return a hosted URL to it.\n\nGive it Markdown (including AI-generated Markdown) and get back a URL to a cleanly\nformatted PDF: headings, lists, tables, code, blockquotes, rules. Send a JSON body\n{\"content\": \"# your **markdown**\", \"filename\": \"out.pdf\"} - the text must be UTF-8.\nReturns {\"pdf_url\": \"...\"}. Generated files are served from /static/pdfs and cleaned\nup after 24h. (This is the hosted variant of POST /v1/convert/text - a URL instead of\nthe binary - because an MCP tool result is text and cannot carry a PDF payload.)","operationId":"convert_markdown_to_pdf","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownText"},"examples":{"note":{"summary":"A short note - the smallest thing worth converting","value":{"content":"# Meeting note\n\nAgreed to ship on Friday. **Owner:** Priya.\n","filename":"meeting-note.pdf"}},"report":{"summary":"A short report with a heading, a list and a table","value":{"content":"# Quarterly summary\n\nRevenue held steady while costs fell.\n\n## Highlights\n\n- Costs down 8% quarter on quarter\n- Two new enterprise accounts\n- Churn unchanged at 1.2%\n\n## Numbers\n\n| Metric | Q2 | Q3 |\n|---|---|---|\n| Revenue | 4.10 | 4.15 |\n| Costs | 2.80 | 2.58 |\n\n> Costs fell mainly on the infrastructure move.\n","filename":"quarterly-summary.pdf"}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_convert_markdown_v1_convert_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_convert_markdown_v1_convert_post"},"ConversionResponse":{"properties":{"pdf_url":{"type":"string","title":"Pdf Url"}},"type":"object","required":["pdf_url"],"title":"ConversionResponse","description":"Response for the hosted (URL-returning) conversion."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MarkdownText":{"properties":{"content":{"type":"string","title":"Content"},"filename":{"type":"string","title":"Filename","default":"document.pdf"}},"type":"object","required":["content"],"title":"MarkdownText","example":{"content":"# Title\n\nHello world","filename":"out.pdf"}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}