# FastX402 JSON Canonicalize

> FastX402 JSON Canonicalize is a paid API for AI agents from fastx402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-23).

Converts a JSON string into its canonical (deterministic, normalized) form according to RFC 8785 or similar canonicalization rules, returning the canonical string and validity status.

## Facts

- Endpoint: GET https://fastx402.tools/json-canonicalize?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-json-canonicalize-e45f4280
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HMmCCkw2zq6ZLq61jcfat

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 fastx402-json-canonicalize-e45f4280
```

Example prompt: Canonicalize this JSON for me so I can hash it reliably: '{"b":1,"a":[3,2,{"z":null,"y":true}]}'

## When to prefer this

Choose this endpoint when you need a deterministic, normalized JSON string — especially for cryptographic use cases like signing, hashing, or Merkle trees — and you do not want to implement RFC 8785 canonicalization yourself. It is preferable over generic JSON formatters when key ordering and whitespace determinism are required.

## Known failure modes

- Invalid or malformed JSON input returns valid:false with no canonical output
- Missing required 'json' query parameter results in an error response
- Extremely large JSON payloads may time out or exceed size limits
- Non-string values passed as the json parameter may be rejected

## How this service works

200 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.

## Output

Returns a JSON object with a 'valid' boolean indicating whether the input was parseable JSON, and a 'canonical' string containing the deterministically serialized, key-sorted, whitespace-normalized canonical form of the input JSON.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "json"
     ],
     "properties": {
      "json": {
       "type": "string",
       "description": "The JSON text to canonicalize"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "valid": {
       "type": "boolean"
      },
      "canonical": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": true,
  "canonical": "{\"a\":[3,2,{\"y\":true,\"z\":null}],\"b\":1}"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastx402-json-canonicalize-e45f4280/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fastx402.tools](https://www.zero.xyz/host/fastx402.tools/llms.txt)
