# agent402.tools Base64 Encode/Decode

> agent402.tools Base64 Encode/Decode is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Encodes or decodes text using Base64 (including URL-safe Base64 on decode), accepting up to 100KB of input.

## Facts

- Endpoint: POST https://agent402.tools/api/base64
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-base64-encode-decode-aca22d03
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iJEcSHp0yTvK2LWAJIaBs

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 agent402-tools-base64-encode-decode-aca22d03 -d '<json body>'
```

Example prompt: Can you Base64-encode this text for me: 'Hello, World! This is my secret payload' — use encode mode.

## When to prefer this

Use this endpoint when an agent needs a quick, stateless Base64 encode or decode operation without setting up a local utility, especially when working inside an x402 payment-enabled workflow and the input is under 100KB. Handles URL-safe Base64 decode automatically, which is useful for JWT or OAuth token inspection.

## Known failure modes

- Input text exceeds 100KB limit — request rejected
- Invalid mode value (not 'encode' or 'decode') — may default to encode or return error
- Malformed Base64 input on decode — returns error or garbled output
- Missing 'text' field in request body — returns validation error

## How this service works

Base64 encode or decode text. mode: encode (default) or decode. Handles URL-safe base64 on decode.

## Output

Returns the Base64-encoded or decoded string corresponding to the input text, with URL-safe Base64 handling applied automatically on decode operations.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "type": "string",
   "description": "encode | decode"
  },
  "text": {
   "type": "string",
   "description": "Input text (max 100KB)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "encode",
  "result": "aGVsbG8="
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-base64-encode-decode-aca22d03/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
