# agent402.tools Hex Encoder/Decoder

> agent402.tools Hex Encoder/Decoder is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Encodes plain text to hexadecimal or decodes hexadecimal back to plain text

## Facts

- Endpoint: POST https://agent402.tools/api/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-tools-hex-encoder-decoder-68a84b07
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RVf2nIhkPXH8xPBo3I0PS

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-tools-hex-encoder-decoder-68a84b07 -d '<json body>'
```

Example prompt: Can you hex-encode this string for me: 'Hello, World!' — use encode mode.

## When to prefer this

Use this endpoint when you need a simple, reliable hex encode or decode operation on a text payload up to 100KB, especially within an x402 micropayment workflow where the cost per call is known ($0.001 USDC). Prefer this over rolling your own conversion when you need a quick remote utility call.

## Known failure modes

- Input text exceeds 100KB limit — request rejected
- Invalid mode value (not 'encode' or 'decode') — may default to encode or return error
- Malformed hex string passed in decode mode — returns error or garbled output
- Missing text field — returns validation error
- Payment not included or insufficient — 402 Payment Required response

## How this service works

Hex encode or decode text. mode: encode (default) or decode.

## Output

Returns the hex-encoded or hex-decoded result string corresponding to the input text, depending on the selected mode (encode or decode).

## Example request

```json
{
 "mode": "encode",
 "text": "Hello, World!"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "type": "string",
   "description": "encode | decode"
  },
  "text": {
   "type": "string",
   "description": "Input text (max 100KB)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "encode",
  "result": "6869"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-hex-encoder-decoder-68a84b07/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
