{"uid":"cap_FSZFJHgYaubvmcDIKsHAH","slug":"base64-and-base64url-encoding-of-text-or-bytes-a5852927","name":"Base64 and Base64URL Encoding of Text or Bytes","description":"Base64 and base64url encoding of text or bytes — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/encode-base64?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"hex":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"},"text":{"type":"string","maxLength":49152}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"encode-base64","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.001,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"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_j0Tn01-J7tJtyT-ams_eU","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 a text string or raw hex bytes into standard base64 or base64url format via a paid API endpoint.","exampleAgentPrompt":"Encode the text 'Hello, World!' into base64 for me.","exampleUseCases":[{"title":"Encoding credentials for HTTP Basic Auth","prompt":"I need to base64-encode the string 'myuser:mypassword' so I can use it in an HTTP Authorization header."},{"title":"Encoding raw hex bytes from a transaction","prompt":"Can you base64-encode this hex data: 0xdeadbeefcafe0123 so I can embed it in a JSON payload?"},{"title":"Preparing binary blob for API submission","prompt":"I have this hex-encoded binary blob 0x4865 6c6c6f and I need it as a base64 string to pass to another service."}],"resultDescription":"Returns a JSON object with ok:true, the encoding type ('encode-base64'), the base64 or base64url-encoded output string, and a payment receipt containing a transaction hash, USD amount, and receipt ID.","failureModes":["Invalid hex string format (must start with 0x and contain valid hex characters)","Text input exceeds 49152 character limit","Malformed request body missing both hex and text params","Payment failure causing 402 response","Network timeout on the twin.unykorn.org host"],"whenToPreferThis":"Choose this endpoint when you need a simple, deterministic base64 or base64url encoding of either a UTF-8 text string or raw hex-encoded bytes, especially in an agentic or automated pipeline where you are already working within the x402 payment protocol ecosystem and need a reliable, low-latency utility call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:54.468Z","isFirstParty":false,"canonicalSlug":"base64-and-base64url-encoding-of-text-or-bytes-a5852927"}