{"uid":"cap_yUGDZBBTtmRqs0W6Z2OZ7","slug":"agent-payload-tools-base64-encode-decode-3cd5562c","name":"Agent Payload Tools – Base64 Encode/Decode","description":"Encode UTF-8 text to Base64 or decode Base64 to UTF-8 text.","url":"https://api.agent-payload-tools.workers.dev/base64","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"mode":{"enum":["encode","decode"],"type":"string","description":"Whether to encode or decode the input."},"input":{"type":"string","default":"","description":"UTF-8 text or Base64 text, according to mode."}}},"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_oSrBI7L4CcIL5xq2NNfrw","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 UTF-8 text to Base64 or decodes Base64 back to UTF-8 text, deterministically, for AI agents.","exampleAgentPrompt":"Can you base64-encode this string for me: 'Hello, World! This is my API payload.' — use encode mode.","exampleUseCases":[{"title":"Encode credentials for HTTP Basic Auth","prompt":"I need to base64-encode 'myUsername:mySecretPassword' so I can use it in an HTTP Authorization header — can you encode that string for me?"},{"title":"Decode a JWT payload segment","prompt":"Can you base64-decode this string for me so I can read what's inside it: 'eyJ1c2VySWQiOiAxMjM0NSwgInJvbGUiOiAiYWRtaW4ifQ=='?"},{"title":"Encode binary-safe data for JSON embedding","prompt":"I'm building a JSON payload and need to safely embed this raw text as a base64 value — please encode 'user:token=abc123&scope=read,write' for me."}],"resultDescription":"Returns a JSON object containing the transformed string — either the Base64-encoded representation of the input UTF-8 text, or the decoded UTF-8 plaintext from the input Base64 string, depending on the mode specified.","failureModes":["Invalid Base64 input when mode is 'decode' — returns an error indicating malformed input","Missing or empty 'input' field — may return an empty result or validation error","Unsupported mode value other than 'encode' or 'decode' — returns a schema validation error","Payment failure via x402 — returns 402 Payment Required if USDC payment is not attached or insufficient"],"whenToPreferThis":"Prefer this endpoint when an AI agent pipeline needs a deterministic, stateless, pay-per-call Base64 encode or decode operation without provisioning any infrastructure. Especially useful when the agent already operates within the x402 micropayment ecosystem on Base or Solana and needs a reliable utility function for payload construction or parsing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:32:58.950Z","isFirstParty":false}