# PennyRail JSON Sort Keys (Stable)

> PennyRail JSON Sort Keys (Stable) 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).

Sorts the keys of a JSON object into a stable, deterministic order and returns the canonicalized result

## Facts

- Endpoint: POST https://pennyrail.vercel.app/api/p/nano/json.sort-keys--stable-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-json-sort-keys-stable-38243c54
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Gg-SAcW1G2zY2dANum5Z6

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-json-sort-keys-stable-38243c54 -d '<json body>'
```

Example prompt: Sort all the keys in this JSON object into stable alphabetical order and give me back the canonicalized version: {"zebra": 1, "apple": 2, "mango": 3}.

## When to prefer this

Choose this endpoint when you need a paid, on-demand, machine-readable service to produce stable, canonically key-sorted JSON — particularly useful in pipelines requiring deterministic serialization before hashing, signing, or deduplication. Prefer it over local sorting when operating in an agent or serverless context without access to a local runtime, or when you need a neutral third-party canonical form for auditability.

## Known failure modes

- Missing or malformed 'input' field returns a validation error
- Non-object input (e.g. array or primitive) may return an error or unexpected result
- Deeply nested structures may not have nested keys sorted if only top-level sorting is supported
- Payment failure or insufficient USDC balance results in HTTP 402 and no transformation
- Network timeout on the Vercel edge function returns 5xx

## How this service works

Machine-readable settlement service

## Output

Returns the input JSON object with all keys (including nested keys, depending on implementation) sorted into stable alphabetical order. The response is a JSON object with the same values but deterministically ordered keys, 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-json-sort-keys-stable-38243c54/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)
