# x402 Hash API – Base64 Encode/Decode

> x402 Hash API – Base64 Encode/Decode is a paid API for AI agents from x402-hash-api.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-28).

Encodes or decodes a string using Base64, billed per call at $0.001 USDC via the x402 micropayment protocol on Base

## Facts

- Endpoint: POST https://x402-hash-api.vercel.app/api/v1/base64?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-hash-api-base64-encode-decode-1c806543
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WoNM6XErGyualddfpNuzT

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 x402-hash-api-base64-encode-decode-1c806543 -d '<json body>'
```

Example prompt: Base64-encode the string 'Hello, World!' for me using the x402 pay-per-call hash API.

## When to prefer this

Choose this endpoint when you need a simple, pay-per-call Base64 encode or decode operation within an x402-compatible agentic workflow and want to avoid setting up a local encoding library. Ideal for AI agents operating on Base/USDC that need occasional encoding without bundling dependencies. Not ideal if you need bulk/batch encoding, symmetric encryption, hashing (SHA/MD5), or other encoding formats beyond Base64.

## Known failure modes

- Missing or invalid 'op' field — only 'encode' or 'decode' are accepted; returns error if omitted or misspelled
- Missing 'data' field — request must include the string to process
- Invalid Base64 input when decoding — malformed or non-Base64 data will cause a decoding error
- Payment failure — x402 micropayment of $0.001 USDC on Base may fail if wallet has insufficient funds or payment header is malformed
- Rate limiting or cold-start latency on Vercel serverless deployment

## How this service works

Pay-per-call hashing and encoding for AI agents (USDC on Base)

## Output

A JSON object with a single 'result' field containing the Base64-encoded or decoded string, e.g. {"result": "aGVsbG8="}

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "op": {
   "type": "string",
   "description": "encode or decode"
  },
  "data": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

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