# Agent Payload Tools – Base64 Encode/Decode

> Agent Payload Tools – Base64 Encode/Decode is a paid API for AI agents from api.agent-payload-tools.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Encodes UTF-8 text to Base64 or decodes Base64 back to UTF-8 text, deterministically, for AI agents.

## Facts

- Endpoint: POST https://api.agent-payload-tools.workers.dev/base64
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-payload-tools-base64-encode-decode-3cd5562c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yUGDZBBTtmRqs0W6Z2OZ7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent-payload-tools-base64-encode-decode-3cd5562c -d '<json body>'
```

Example prompt: Can you base64-encode this string for me: 'Hello, World! This is my API payload.' — use encode mode.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Encode UTF-8 text to Base64 or decode Base64 to UTF-8 text.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-payload-tools-base64-encode-decode-3cd5562c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agent-payload-tools.workers.dev](https://www.zero.xyz/host/api.agent-payload-tools.workers.dev/llms.txt)
