# JSON Canonicalize

> JSON Canonicalize is a paid API for AI agents from bounty-engineer-x402-prod.onrender.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-11).

Canonicalizes a JSON value into a deterministic byte sequence and returns its SHA-256 hash and canonical string representation

## Facts

- Endpoint: POST https://bounty-engineer-x402-prod.onrender.com/v1/json-canonicalize?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-canonicalize-65fcd179
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Qzh7TAEog-xuis42tQeY0

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 json-canonicalize-65fcd179 -d '<json body>'
```

Example prompt: Canonicalize this JSON object and give me its SHA-256 hash so I can use it as a deterministic fingerprint: {"b": 2, "a": 1}

## When to prefer this

Choose this endpoint when you need a deterministic, key-order-independent canonical representation of a JSON value along with its SHA-256 hash — ideal for cryptographic signing, deduplication, integrity verification, or any scenario where JSON key ordering must not affect the output. Prefer this over ad-hoc JSON.stringify approaches when reproducibility and a hash fingerprint are both required in one call.

## Known failure modes

- Invalid or unparseable input value returns an error response
- Extremely large or deeply nested JSON may cause timeout or rejection
- Missing `value` field in request body may return a validation error
- Network errors from the Render-hosted service during high load

## How this service works

Machine-buyable infrastructure for autonomous agents: API cost routing, margin optimization, funding-rate data, webpage extraction, result verification, spend controls, retry planning, state, tender search and GitHub bounty intelligence.

## Output

Returns a JSON object with `ok: true`, a `result` object containing the canonical JSON string representation, the SHA-256 hash of the canonical bytes, and the byte length of the canonical form.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "value": {}
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "result": {
   "bytes": 13,
   "sha256": "...",
   "canonical": "{\\\"a\\\":1,\\\"b\\\":2}"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-canonicalize-65fcd179/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bounty-engineer-x402-prod.onrender.com](https://www.zero.xyz/host/bounty-engineer-x402-prod.onrender.com/llms.txt)
