# Base64 Encode/Decode Utility

> Base64 Encode/Decode Utility is a paid API for AI agents from agent-chain-kit-solana.vercel.app, paid per call via x402, $0.0005/call, status unknown (last checked 2026-10-09).

Encodes or decodes a string using Base64 (standard or URL-safe variant), returning the transformed result and byte count.

## Facts

- Endpoint: POST https://agent-chain-kit-solana.vercel.app/v1/base64?utm_source=zero.xyz
- Price: $0.0005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-09
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base64-encode-decode-utility-04d32d15
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_r-SMAuj21DHDe-JXKcHIq

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-utility-04d32d15 -d '<json body>'
```

Example prompt: Can you base64 encode the string 'hello world' for me, using the standard (not URL-safe) format?

## When to prefer this

Use this endpoint when you need a quick, keyless Base64 encode or decode operation within an agent workflow that already uses x402 micropayment infrastructure — especially useful when you want URL-safe vs standard base64 control and a byte count returned alongside the result.

## Known failure modes

- Missing required 'data' query parameter returns an error
- Invalid operation enum value (not 'encode' or 'decode') causes a validation error
- Malformed or non-base64 input when decoding may return an error or garbage output
- Payment failure via MPP/x402 results in 402 status before processing occurs

## How this service works

Global current weather, hourly forecasts, foreign-exchange rates, EVM reads, and deterministic utilities for AI agents. Pay per call with MPP or x402; no API key.

## Output

Returns a JSON object containing the Base64-encoded or decoded result string, the number of bytes in the result, the operation performed (encode/decode), and whether URL-safe mode was used.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "data"
     ],
     "properties": {
      "data": {
       "type": "string"
      },
      "urlsafe": {
       "type": "boolean"
      },
      "operation": {
       "enum": [
        "encode",
        "decode"
       ],
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "bytes": 5,
  "result": "aGVsbG8=",
  "urlsafe": false,
  "operation": "encode"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base64-encode-decode-utility-04d32d15/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-chain-kit-solana.vercel.app](https://www.zero.xyz/host/agent-chain-kit-solana.vercel.app/llms.txt)
