{"uid":"cap_BNMMCtUtgbK7u3RrhMfhL","slug":"relaystation-html-sanitizer-8ce5831a","name":"RelayStation HTML Sanitizer","description":"$0.0002/MB. Sanitize HTML against a safe whitelist — kill scripts and XSS before embedding. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny","url":"https://api.relaystation.ai/v1/text/sanitize-html","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_RgyMMrnYKmBwDZ6aC3Pf2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Sanitizes HTML against a safe whitelist by stripping scripts, event handlers, and XSS vectors before embedding user-generated content","exampleAgentPrompt":"Sanitize this HTML snippet I got from a user comment form before I embed it on the page — strip out any scripts, event handlers, or XSS payloads and give me back only safe, whitelisted markup: '<p onclick=\"alert(1)\">Hello <script>evil()</script> world</p>'","exampleUseCases":[{"title":"User comment XSS prevention","prompt":"A user just submitted this HTML in a comment box: '<b>Great post!</b><script>document.cookie</script><img src=x onerror=alert(1)>'. Can you sanitize it against a safe whitelist so I can safely render it on my site?"},{"title":"Rich text editor output cleanup","prompt":"My rich text editor produced this HTML and I need to store it in the database safely — please strip out any scripts, inline event handlers, or dangerous attributes before I save it: '<div style=\"color:red\" onmouseover=\"steal()\"><a href=\"javascript:void(0)\">Click</a></div>'"},{"title":"Email newsletter HTML hardening","prompt":"Before I inject this HTML block into the email template, sanitize it to kill any XSS vectors or unsafe tags — keep the formatting but remove anything that could be exploited: '<h2>Sale!</h2><iframe src=\"evil.com\"></iframe><p style=\"font-size:14px\">Shop now</p>'"}],"resultDescription":"Returns the sanitized HTML string with all unsafe elements removed — scripts, event handlers, javascript: URLs, iframes, and other XSS vectors stripped out, while preserving safe whitelisted tags and attributes for valid rendering.","failureModes":["Malformed or non-UTF-8 input HTML may cause parsing errors","Extremely large HTML payloads may exceed per-MB pricing thresholds or size limits","Overly aggressive sanitization may strip legitimate but edge-case safe tags not on the whitelist","Network timeout if payload is very large; retry recommended","Payment failure if insufficient USDC balance for x402 transaction"],"whenToPreferThis":"Choose this endpoint when you need to safely embed user-generated or third-party HTML content in a web page, database, or email and need server-side XSS stripping rather than a client-side library. Ideal for agents processing untrusted HTML at scale where a whitelist-based server sanitization step is required before storage or rendering, and per-MB micropayment pricing makes it cost-effective for variable payload sizes.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:48:31.176Z","isFirstParty":false}