# Base64 Encode

> Base64 Encode is a paid API for AI agents from x402-gateway-production-1f21.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Encodes arbitrary text input into its Base64 representation via a machine-payable HTTP endpoint.

## Facts

- Endpoint: POST https://x402-gateway-production-1f21.up.railway.app/base64/encode?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base64-encode-42dc47c8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_okq7cYt7wXIMldd9hBfRw

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-42dc47c8 -d '<json body>'
```

Example prompt: Can you base64 encode this text for me: 'Hello, world! This is my secret payload to embed in a JSON field.'

## When to prefer this

Choose this endpoint when you need a quick, machine-payable, on-demand Base64 encoding operation without standing up your own encoding service, especially in agentic pipelines already using the x402 payment protocol on this platform that also need checksums, crypto data, or web extraction from the same gateway.

## Known failure modes

- Input text exceeds 250,000 character limit — request rejected
- Missing required 'text' field in request body — validation error
- Invalid bodyType enum value — request rejected
- Payment failure or insufficient USDC balance — 402 response blocking execution
- Network timeout on Railway-hosted service — connection error

## How this service works

Machine-payable x402 utilities for hashing, Base64, UUID generation, unit and timezone conversion, realtime crypto market data, webpage/document extraction, URL-to-Markdown, metadata, RAG ingestion and deterministic website change detection.

## Output

Returns a JSON response containing the Base64-encoded representation of the submitted text string, ready for use in headers, URIs, or any context requiring Base64 encoding.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "maxLength": 250000
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "ready"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base64-encode-42dc47c8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production-1f21.up.railway.app](https://www.zero.xyz/host/x402-gateway-production-1f21.up.railway.app/llms.txt)
