# Base64 Encode / Decode

> Base64 Encode / Decode is a paid API for AI agents from api.gadgethumans.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-12-03).

Encodes plain text to Base64 or decodes a Base64 string back to plaintext via a simple GET request.

## Facts

- Endpoint: GET https://api.gadgethumans.com/base64?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base64-encode-decode-2084fecf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kHp-r7wpbWswI2KO8tCck

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-2084fecf
```

Example prompt: Can you Base64-encode the text 'Hello, World!' for me so I can safely embed it in a JSON payload?

## When to prefer this

Use this endpoint when you need a fast, zero-setup Base64 encode or decode operation within an agent workflow — especially when preparing binary-safe payloads for JSON transport, constructing Basic Auth headers, or reading Base64-encoded API responses. Prefer this over implementing locally when the agent runtime lacks a built-in codec or when consistency and simplicity across heterogeneous environments matters.

## Known failure modes

- Invalid Base64 input when mode=decode (malformed or padded incorrectly) may return an error or garbled output
- Missing required `text` query parameter returns an error
- Invalid `mode` value (not 'encode' or 'decode') may default to encode or return an error
- Very long input strings may hit query string length limits

## How this service works

Encode text to Base64 or decode Base64 back to plaintext. Pure CPU, instant. Use to move binary-safe payloads through JSON, or to read a Base64 blob.

## Output

Returns a JSON object with an `ok` boolean and the resulting string — either the Base64-encoded representation of the input text, or the decoded plaintext of the provided Base64 value.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "mode": {
       "type": "string",
       "description": "encode (default) or decode"
      },
      "text": {
       "type": "string",
       "description": "Text to encode, or Base64 to decode"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "example": {
     "ok": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true
 }
}
```

## More

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