{"success":true,"data":{"id":"svc_htmlpdf_04","slug":"html-to-pdf","name":"HTML to PDF","description":"Render a URL or raw HTML string to PDF. Returns pdf_base64 (base64 PDF — decode to get raw bytes) and page_count. Provide url OR html — never both. Supports format (A4/Letter/Legal), landscape boolean, and margin settings (top/bottom/left/right in CSS units). Use for invoices, reports, or printable document generation.","category":"visual","endpoint":"https://agentsvc.io/api/v1/proxy/html-to-pdf","price_usdc":0.008,"latency_p99_ms":3500,"input_schema":{"description":"Provide either 'url' OR 'html' (not both). Common fields (format, landscape, margin) apply to both.","oneOf":[{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"URL to render as PDF (must be publicly accessible)"},"format":{"type":"string","enum":["A4","Letter","Legal"],"default":"A4","description":"Page format"},"landscape":{"type":"boolean","default":false,"description":"Landscape orientation"},"margin":{"type":"object","description":"Page margins (CSS units, e.g. '1cm', '10mm', '0.5in')","properties":{"top":{"type":"string","default":"1cm"},"bottom":{"type":"string","default":"1cm"},"left":{"type":"string","default":"1cm"},"right":{"type":"string","default":"1cm"}}}}},{"type":"object","required":["html"],"properties":{"html":{"type":"string","description":"Raw HTML string to render as PDF"},"format":{"type":"string","enum":["A4","Letter","Legal"],"default":"A4","description":"Page format"},"landscape":{"type":"boolean","default":false,"description":"Landscape orientation"},"margin":{"type":"object","description":"Page margins (CSS units, e.g. '1cm', '10mm', '0.5in')","properties":{"top":{"type":"string","default":"1cm"},"bottom":{"type":"string","default":"1cm"},"left":{"type":"string","default":"1cm"},"right":{"type":"string","default":"1cm"}}}}}]},"output_schema":{"type":"object","required":["pdf_base64","page_count","file_size_bytes","generated_at"],"properties":{"pdf_base64":{"type":"string","description":"Base64-encoded PDF bytes (decode to get raw PDF file)"},"page_count":{"type":"integer","description":"Number of pages in the generated PDF"},"file_size_bytes":{"type":"integer","description":"Size of the PDF in bytes"},"generated_at":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of generation"}},"example":{"pdf_base64":"JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9...","page_count":2,"file_size_bytes":14867,"generated_at":"2026-04-07T12:00:00.000Z"}},"is_active":true,"provider":"agentsvc.io","tags":["pdf","browser","document","playwright","convert"],"method":"POST","example_input":{"html":"<h1>Invoice #123</h1><p>Total: $42.00</p>"},"price_atomic":"8000","price_display":"$0.008 USDC","try_url":"https://agentsvc.io/api/v1/try/html-to-pdf","try_limit_per_day":1,"info_url":"https://agentsvc.io/api/v1/services/html-to-pdf","page_url":"https://agentsvc.io/services/html-to-pdf","curl_example":"curl -X POST https://agentsvc.io/api/v1/proxy/html-to-pdf -H \"Content-Type: application/json\" -d '{\"html\":\"<h1>Invoice #123</h1><p>Total: $42.00</p>\"}'","status":{"ok":true,"latency_ms":1058,"checked_at":"2026-10-05T09:35:08.761Z"}},"payment":{"protocol":"x402","x402_versions_accepted":[1,2],"scheme":"exact","network":"eip155:8453","network_v1":"base","chain_id":8453,"asset":"USDC","asset_contract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","asset_decimals":6,"eip712_domain":{"name":"USD Coin","version":"2","chainId":8453,"verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"pay_to":"0x622efA6Ceb83a5b6EdBC931332f4db68B7f74F27","facilitator":"https://facilitator.payai.network","request_header_v2":"PAYMENT-SIGNATURE","request_header_v1":"X-PAYMENT","requirements_v2":"base64 JSON in the PAYMENT-REQUIRED response header of the 402","requirements_v1":"JSON body of the 402 (accepts[0])","receipt_header":"PAYMENT-RESPONSE (and X-PAYMENT-RESPONSE): base64 JSON with transaction hash","accounts_required":false,"api_keys_required":false,"settlement":"per call, on-chain, after the service succeeded. Failed calls are never charged."},"links":{"catalog":"https://agentsvc.io/api/v1/services","openapi":"https://agentsvc.io/openapi.json","llms_txt":"https://agentsvc.io/llms.txt","llms_full_txt":"https://agentsvc.io/llms-full.txt","agents_md":"https://agentsvc.io/AGENTS.md","skill_md":"https://agentsvc.io/SKILL.md","status":"https://agentsvc.io/api/v1/status","docs":"https://agentsvc.io/docs","mcp_server":"https://agentsvc.io/mcp-server.mjs","discovery":"https://agentsvc.io/.well-known/x402","agent_card":"https://agentsvc.io/.well-known/agent-card.json"}}