# PennyRail Canonical JSON Sorter

> PennyRail Canonical JSON Sorter is a paid API for AI agents from pennyrail.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Converts an arbitrary JSON object into canonical form with deterministically sorted keys

## Facts

- Endpoint: POST https://pennyrail.vercel.app/api/p/nano/json.sort-keys--canonical-json
- 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/pennyrail-canonical-json-sorter-823df9d9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tJ36gH827LPMGfcPreas3

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 pennyrail-canonical-json-sorter-823df9d9 -d '<json body>'
```

Example prompt: Take this JSON object and return a canonical version with all keys sorted alphabetically: {"zebra": 1, "apple": {"mango": 2, "banana": 3}, "cherry": true}.

## When to prefer this

Choose this endpoint when you need a deterministic, canonically sorted JSON output for use cases like cryptographic signing, payload hashing, cache key generation, or structural diffing. It is a paid micro-service ($0.001 USDC via x402) so prefer it in automated pipelines where consistent JSON serialization is a hard requirement and a free local sort is unavailable or undesired.

## Known failure modes

- Input is not a valid JSON object — returns an error response
- Deeply nested structures with circular references may cause failures
- Missing required 'input' field returns a validation error
- Network timeout on the paid endpoint if the service is unavailable
- Payment failure (x402) if USDC balance is insufficient

## How this service works

Machine-readable settlement service

## Output

A JSON object identical in content to the input but with all keys sorted alphabetically in a deterministic, canonical order, suitable for hashing, signing, diffing, or caching.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pennyrail-canonical-json-sorter-823df9d9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyrail.vercel.app](https://www.zero.xyz/host/pennyrail.vercel.app/llms.txt)
