# Base64 and Base64URL Encoding of Text or Bytes

> Base64 and Base64URL Encoding of Text or Bytes is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Encodes a text string or raw hex bytes into standard base64 or base64url format via a paid API endpoint.

## Facts

- Endpoint: POST https://twin.unykorn.org/encode-base64?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base64-and-base64url-encoding-of-text-or-bytes-a5852927
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FSZFJHgYaubvmcDIKsHAH

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-and-base64url-encoding-of-text-or-bytes-a5852927 -d '<json body>'
```

Example prompt: Encode the text 'Hello, World!' into base64 for me.

## When to prefer this

Choose this endpoint when you need a simple, deterministic base64 or base64url encoding of either a UTF-8 text string or raw hex-encoded bytes, especially in an agentic or automated pipeline where you are already working within the x402 payment protocol ecosystem and need a reliable, low-latency utility call.

## Known failure modes

- Invalid hex string format (must start with 0x and contain valid hex characters)
- Text input exceeds 49152 character limit
- Malformed request body missing both hex and text params
- Payment failure causing 402 response
- Network timeout on the twin.unykorn.org host

## How this service works

Base64 and base64url encoding of text or bytes — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object with ok:true, the encoding type ('encode-base64'), the base64 or base64url-encoded output string, and a payment receipt containing a transaction hash, USD amount, and receipt ID.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "hex": {
     "type": "string",
     "pattern": "^0x[0-9a-fA-F]*$"
    },
    "text": {
     "type": "string",
     "maxLength": 49152
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "encode-base64",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.001,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base64-and-base64url-encoding-of-text-or-bytes-a5852927/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
