{"openapi":"3.0.3","info":{"title":"LLM HTML-to-Markdown Cleaner API","version":"1.0.0","description":"Fetches a web page via private fetcher (or accepts raw HTML), strips navigation/script/footer boilerplate, converts content to clean Markdown, and estimates LLM token count."},"servers":[{"url":"https://api.tinplate.dev","description":"Production Edge Gateway"}],"components":{"schemas":{"HtmlToMarkdownResponse":{"type":"object","properties":{"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source_url":{"type":"string","nullable":true},"markdown":{"type":"string"},"estimated_tokens":{"type":"integer","minimum":0},"html_chars":{"type":"integer","minimum":0},"markdown_chars":{"type":"integer","minimum":0},"cached":{"type":"boolean"}},"required":["title","description","source_url","markdown","estimated_tokens","html_chars","markdown_chars","cached"]},"HtmlToMarkdownRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri","example":"https://example.com","description":"Public URL to fetch via private fetcher and convert to Markdown."},"html":{"type":"string","minLength":1,"maxLength":262144,"example":"<html><head><title>Hello</title></head><body><h1>Docs</h1><p>Clean <strong>Markdown</strong>.</p></body></html>","description":"Raw HTML string to convert directly without fetching."},"base_url":{"type":"string","maxLength":2048,"format":"uri","description":"Optional base URL for resolving relative links when passing raw html."},"include_links":{"type":"boolean","example":true,"description":"Preserve hyperlinks as [text](url) (default true)."}}},"ResponseMeta":{"type":"object","required":["request_id"],"properties":{"request_id":{"type":"string","format":"uuid"},"ms":{"type":"integer","minimum":0},"version":{"type":"string","example":"1.0.0"}}},"ErrorEnvelope":{"type":"object","required":["ok","error","meta"],"properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"invalid_input"},"message":{"type":"string","example":"Request body failed validation"}}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}},"parameters":{}},"paths":{"/v1/html-to-markdown":{"post":{"tags":["04_HTML_TO_MARKDOWN"],"summary":"Convert a URL or raw HTML into clean LLM-ready Markdown","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlToMarkdownRequest"}}}},"responses":{"200":{"description":"Clean Markdown and token estimate","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/HtmlToMarkdownResponse"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["ok","data","meta"]}}}},"400":{"description":"Invalid input or malformed JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid authentication credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Request payload exceeds subscribed plan byte cap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}}}