{"uid":"cap_aP4CH6pXRdUZVsoiTdl_n","slug":"x402-utils-text-encoding-decoding-bb246970","name":"x402 Utils – Text Encoding & Decoding","description":"Encode or decode text: base64, base64url, hex, URL (percent) encoding and HTML escaping.","url":"https://qcb7fnxsbd7fbhj4.68r.lambda-web.us-east-1.on.aws/v1/encode?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"op":{"enum":["base64-encode","base64-decode","base64url-encode","base64url-decode","hex-encode","hex-decode","url-encode","url-decode","html-escape","html-unescape"],"type":"string","description":"what to do"},"text":{"type":"string","description":"the text (up to 1 MB)"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_48kIfR0v2HQgw_iY9kyka","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Encodes or decodes text using base64, base64url, hex, URL percent-encoding, or HTML escaping.","exampleAgentPrompt":"Can you base64-encode this string for me: 'Hello, World! This is my API key payload'?","exampleUseCases":[{"title":"Encode API payload for transmission","prompt":"Base64-encode this JSON string so I can embed it in a header: '{\"userId\":\"abc123\",\"role\":\"admin\"}'"},{"title":"Decode a percent-encoded URL parameter","prompt":"URL-decode this percent-encoded string I pulled from a query parameter: 'Hello%20World%21%20How%20are%20you%3F'"},{"title":"Escape user content for safe HTML rendering","prompt":"HTML-escape this user-submitted comment before I put it in a webpage: '<script>alert(\"xss\")</script> — visit our site & win!'"}],"resultDescription":"Returns the transformed text as output — the encoded, decoded, escaped, or unescaped version of the input string, corresponding to the chosen operation.","failureModes":["Invalid or unsupported operation enum value returns an error","Input text exceeding 1 MB limit is rejected","Malformed base64 or hex input passed to a decode operation may return a decoding error","Missing required fields (op or text) result in a validation error"],"whenToPreferThis":"Choose this endpoint when you need a quick, reliable, stateless text encoding or decoding operation (base64, base64url, hex, URL percent-encoding, or HTML escaping) without setting up a local library or runtime. Ideal for AI agents that need to prepare text for HTTP transmission, safely embed user content in HTML, or interpret encoded values from APIs and tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T07:05:08.925Z","isFirstParty":false,"canonicalSlug":"x402-utils-text-encoding-decoding-bb246970"}