{"uid":"cap_2LTny0w12eMxTECHuE_52","slug":"x402-utils-encode-decode-text-2920b7ac","name":"x402 Utils — Encode/Decode Text","description":"Encode or decode text: base64, base64url, hex, URL (percent) encoding and HTML escaping.","url":"https://utils.kagurazaka.dev/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":{"type":"json","example":{"op":"base64-encode","result":"aGVsbG8gd29ybGQ="}},"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_6MZAiDRnhewVhU6iz2MqX","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":"Encode or decode text using base64, base64url, hex, URL (percent) encoding, or HTML escaping.","exampleAgentPrompt":"Can you base64-encode the text 'hello world' for me?","exampleUseCases":[{"title":"Encoding payload for API auth","prompt":"I need to base64-encode my API credentials string 'myuser:mypassword' so I can put it in an Authorization header."},{"title":"Decoding a received JWT claim","prompt":"Can you base64url-decode this string for me: 'eyJzdWIiOiIxMjM0NTY3ODkwIn0' — I want to see what's inside?"},{"title":"Percent-encoding a URL query parameter","prompt":"I need to URL-encode this text so it's safe to use as a query parameter: 'hello world & goodbye world!'"}],"resultDescription":"A JSON object containing the operation name (op) and the resulting transformed string (result), e.g. {\"op\":\"base64-encode\",\"result\":\"aGVsbG8gd29ybGQ=\"}.","failureModes":["Input text exceeds 1 MB limit — request rejected","Invalid or missing 'op' enum value — validation error","Malformed base64/hex/URL input when decoding — error or garbled output","Missing 'text' field in request body — validation error"],"whenToPreferThis":"Choose this endpoint when you need a fast, reliable, pay-per-call text encoding or decoding operation without setting up any libraries or runtime — especially for base64, base64url (JWT-safe), hex, percent-encoding, or HTML escaping. Ideal for agents that need to encode/decode strings on the fly within a workflow without depending on execution environments.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:36:32.863Z","isFirstParty":false,"canonicalSlug":"x402-utils-encode-decode-text-2920b7ac"}