# Agent402 UK Base64 Encode/Decode

> Agent402 UK Base64 Encode/Decode is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Deterministically encodes text to Base64 or decodes Base64 strings back to text, safe for headers, JWT fragments, and binary transport.

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/base64
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-base64-encode-decode-a9ab543d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oPHAdx_mEHu1Sf4KsU_FU

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 agent402-uk-base64-encode-decode-a9ab543d -d '<json body>'
```

Example prompt: Base64-encode the string 'Authorization: Bearer my-secret-token' so I can safely include it in an HTTP header without padding errors.

## When to prefer this

Use this endpoint when an agent must not guess or hallucinate Base64 padding, especially mid-task with JWT fragments, HTTP Authorization headers, or binary-safe transport payloads. Prefer over LLM-generated Base64 for any production scenario where byte-perfect correctness is required. Priced at $0.001 USDC per call via x402 protocol.

## Known failure modes

- Invalid base64 string passed for decode action (malformed padding or illegal characters)
- Missing required 'action' field returns an error
- Missing required 'text' field returns an error
- Non-UTF-8 binary content may not round-trip cleanly through the text field

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

A JSON object containing the original input text, the action performed (encode or decode), and the resulting encoded or decoded string — e.g. {"text":"hello","action":"encode","encoded":"aGVsbG8="}.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Input text or base64 string"
  },
  "action": {
   "type": "string",
   "description": "encode | decode"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "text": "hello",
  "action": "encode",
  "encoded": "aGVsbG8="
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-base64-encode-decode-a9ab543d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
