# Delx Commerce — Hex Canonicalize

> Delx Commerce — Hex Canonicalize is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-01).

Validates and canonicalizes a hex string, returning its normalized form with optional 0x prefix, byte length, and validity status.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/hex-canonicalize?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-hex-canonicalize-a7713920
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6t6xZ28bPxNjuPHAY0qLt

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 delx-commerce-hex-canonicalize-a7713920 -d '<json body>'
```

Example prompt: Check if '0xabcd1' is a valid hex string and give me its canonical form with the 0x prefix and byte length — I want to make sure it's well-formed before passing it to a smart contract.

## When to prefer this

Choose this endpoint when you need a quick, authoritative, pay-per-result check that a hex string is well-formed and to retrieve its normalized representation — especially in blockchain, cryptography, or data-pipeline contexts where hex validity is a hard prerequisite. Prefer this over writing your own regex when you need a verifiable, auditable result with a defined schema version.

## Known failure modes

- Odd-length hex (after stripping 0x) results in valid=false with no canonical form
- Non-hex characters cause valid=false response
- Empty input may return an error or valid=false
- Malformed JSON body returns a 4xx error
- Payment not included or insufficient USDC triggers 402 Payment Required

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object indicating whether the hex string is valid (boolean), the canonical hex string in the requested prefix style, the byte length of the encoded data, the input string length, and a schema version identifier (e.g. delx/util-hex-canonicalize/v1).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "hex": {
   "type": "string",
   "description": "Hex string with or without 0x; must be even-length for valid=true."
  },
  "prefer_0x": {
   "type": "boolean",
   "description": "When true, canonicalize with a 0x prefix."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": true,
  "schema": "delx/util-hex-canonicalize/v1",
  "canonical": "0xabcd",
  "byte_length": 2,
  "input_length": 6
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-hex-canonicalize-a7713920/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
