# Agent402 UK Hex Encode/Decode

> Agent402 UK Hex 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).

Encodes UTF-8 text to hexadecimal or decodes hex strings back to UTF-8 text

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/hex
- 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-hex-encode-decode-35de6156
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_A8tdNyk7eB5ved4eeFtFV

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-hex-encode-decode-35de6156 -d '<json body>'
```

Example prompt: Hex encode the text 'Hello, World!' for me so I can safely pass it through an agent pipeline.

## When to prefer this

Choose this endpoint when you need a lightweight, stateless hex encode/decode utility without spinning up a local library — especially useful in agent pipelines where binary-safe text transport is needed and base64 is not available or not preferred. Ideal for converting strings to hex for embedding in URLs, headers, or structured payloads, or for decoding hex values received from external systems.

## Known failure modes

- Invalid action value (not 'encode' or 'decode') may return an error or unexpected result
- Malformed hex input (odd-length or non-hex characters) during decode may cause parsing failure
- Missing 'text' or 'action' fields in request body likely returns a 400-style error
- Non-UTF-8 byte sequences in hex may fail to decode cleanly

## 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

Returns a JSON object containing the resulting hex string (for encode) or decoded UTF-8 text (for decode), along with an echo of the action performed.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hex": "68656c6c6f",
  "action": "encode"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-hex-encode-decode-35de6156/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)
