# Base64 Encode/Decode API (x402-v2-mint)

> Base64 Encode/Decode API (x402-v2-mint) is a paid API for AI agents from x402-v2-mint-base64.vercel.app, paid per call via x402, $0.003/call, status unknown (last checked 2026-12-01).

Encodes or decodes UTF-8 text using standard or URL-safe Base64, running fully offline as a paid micropayment endpoint.

## Facts

- Endpoint: POST https://x402-v2-mint-base64.vercel.app/v1/base64?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base64-encode-decode-api-x402-v2-mint-20f61b1f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3I3wujnraeBHnHW4_Q22x

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 base64-encode-decode-api-x402-v2-mint-20f61b1f -d '<json body>'
```

Example prompt: Can you base64-encode this text for me: 'Hello, World! This is my secret message' — use URL-safe mode so it's safe to put in a URL query string.

## When to prefer this

Choose this endpoint when you need a reliable, offline (no external dependency) Base64 encode/decode operation accessible via a paid micropayment API. Ideal for agents that require deterministic, stateless text encoding within an x402 payment workflow. Supports both standard and URL-safe Base64 variants and handles large payloads up to 400KB.

## Known failure modes

- Text exceeds 400,000 character limit — request rejected
- Invalid base64 input when decoding (malformed characters) — decode error returned
- Invalid mode value (neither 'encode' nor 'decode') — validation error
- Empty or missing text field — may return error or empty result
- Payment failure via x402 protocol — charged field false, operation not performed

## How this service works

Base64 encode/decode UTF-8 text (standard or URL-safe). Offline. Amp port.

## Output

Returns a JSON object with 'ok' (boolean success flag), 'skill' (always 'base64'), 'charged' (whether the micropayment was processed), and 'summary' (short status string). The encoded or decoded result text is included in the response body.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "encode",
    "decode"
   ],
   "type": "string"
  },
  "text": {
   "type": "string",
   "maxLength": 400000,
   "minLength": 0
  },
  "url_safe": {
   "type": "boolean",
   "default": false
  },
  "request_id": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "skill": "base64",
  "charged": true,
  "summary": "ok"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base64-encode-decode-api-x402-v2-mint-20f61b1f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-v2-mint-base64.vercel.app](https://www.zero.xyz/host/x402-v2-mint-base64.vercel.app/llms.txt)
