{"uid":"cap_61pDQWZHQGVWGCLP79TPB","slug":"scanpay-agent-sanitize-4e6d5ddc","name":"ScanPay Agent Sanitize","description":"Pay-per-call x402 APIs for AI agents: OpenAI-compatible LLM chat, perp funding and arbitrage spreads, crypto prices, gas, FX, Solana SPL mint audit, token price by contract, x402 delivery-receipt verification, web search, clean page extraction, batch tools and deterministic code-security scanning. USDC on Base or Solana, no signup, no API key, from $0.0001 a call.","url":"https://scanpay-edge.alextaghiashvili.workers.dev/api/v1/agent-sanitize?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","title":"AgentSanitizeRequest","required":["text"],"properties":{"text":{"type":"string","title":"Text","maxLength":200000,"minLength":1},"max_chars":{"anyOf":[{"type":"integer","maximum":200000,"minimum":1},{"type":"null"}],"title":"Max Chars","default":null}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"flags":[],"product":"scanpay.agent_sanitize","removed":{"bidi":0,"controls":0,"zero_width":1,"html_comments":1},"clean_len":11,"clean_text":"Hello world","original_len":27,"tokens_saved_est":4}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_WjS5e2g-E2zp5RAjS_OCq","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Strips invisible characters and HTML comments from text and returns injection flags and a sanitized string","exampleAgentPrompt":"Can you sanitize this text for me — strip out any invisible characters, zero-width chars, HTML comments, and bidi overrides, and tell me if there are any injection flags: 'Hello\rzero\ffffwidthworld'?","exampleUseCases":[{"title":"Sanitize untrusted user input before LLM prompt","prompt":"Before I feed this user-submitted comment to my LLM, can you clean it of all invisible characters, HTML comments, and bidi overrides and tell me if anything suspicious was flagged? Here's the text: '<!-- hidden --> Hello\ffffworld\rtest'."},{"title":"Detect prompt injection in scraped web content","prompt":"I just scraped this webpage snippet and I want to pass it to an AI agent — can you first sanitize it and flag any zero-width or bidirectional injection characters so I know if someone embedded hidden instructions in it?"},{"title":"Estimate token savings from stripping hidden chars","prompt":"Strip all invisible characters and HTML comments from this blob of text and tell me how many tokens I'll save by cleaning it up before sending it to an LLM."}],"resultDescription":"Returns a JSON object with: the cleaned text string, original and cleaned character lengths, a breakdown of removed character types (bidi, controls, zero_width, html_comments), an array of injection flags if suspicious patterns were detected, and an estimated token savings count.","failureModes":["Empty or missing 'text' query parameter returns validation error","Text exceeding 200,000 character limit is rejected","Network timeout on Cloudflare Workers edge","Payment failure via x402 protocol results in 402 response before sanitization occurs","Non-UTF-8 encoded text may cause unexpected behavior"],"whenToPreferThis":"Choose this endpoint when you need a deterministic, lightweight sanitizer focused specifically on invisible Unicode characters (zero-width, bidi overrides, control characters) and HTML comments — especially before passing untrusted text to an LLM or AI agent. It is purpose-built for prompt-injection defense and AI pipeline hygiene, unlike general-purpose HTML sanitizers or DOMPurify which focus on tag-based XSS. Prefer it when you also need explicit injection flags and token-savings estimates as structured output.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-02T18:33:14.679Z","isFirstParty":false,"canonicalSlug":"scanpay-agent-sanitize-4e6d5ddc"}