# FastX402 Lab – Base64 / Base64url Encode & Decode

> FastX402 Lab – Base64 / Base64url Encode & Decode is a paid API for AI agents from fastx402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-17).

Encodes UTF-8 text to standard Base64 or Base64url, or decodes Base64/Base64url back to UTF-8 text, returning exact results safe for HTTP headers, data URLs, and API payloads.

## Facts

- Endpoint: GET https://fastx402.tools/base64-convert?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-lab-base64-base64url-encode-decode-dc2fd8d3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1C3-le9hnUJrpLfBftFIf

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 fastx402-lab-base64-base64url-encode-decode-dc2fd8d3
```

Example prompt: Can you encode the string 'Hello, world! 🌍' to standard Base64 for me so I can use it in an HTTP Authorization header?

## When to prefer this

Choose this endpoint when you need deterministic, exact Base64 or Base64url encoding/decoding with correct padding and alphabet selection — particularly when you have encountered issues with wrong padding or alphabet mismatches in other tools. It is ideal for AI agents that need to construct HTTP Authorization headers, data URLs, or prepare API payloads without a local runtime capable of running encoding functions.

## Known failure modes

- Invalid Base64 input when decoding (malformed padding or illegal characters) may return an error or garbled output
- Missing required 'text' or 'mode' query parameters returns a 4xx error
- Passing binary non-UTF-8 content as the text field may produce incorrect decode results since the service targets UTF-8
- Payment failure (x402) blocks the request before encoding occurs

## How this service works

146 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.

## Output

A JSON object with two fields: 'mode' (the operation performed: encode, decode, encode_url, or decode_url) and 'result' (the converted string — Base64, Base64url, or decoded UTF-8 text as appropriate).

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text",
      "mode"
     ],
     "properties": {
      "mode": {
       "enum": [
        "encode",
        "decode",
        "encode_url",
        "decode_url"
       ],
       "type": "string",
       "description": "encode, decode, encode_url or decode_url"
      },
      "text": {
       "type": "string",
       "description": "Text to encode, or Base64 to decode"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "mode": {
       "type": "string"
      },
      "result": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

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