# capi2 JSON Canonicalize & SHA-256 Hash

> capi2 JSON Canonicalize & SHA-256 Hash is a paid API for AI agents from capi2-demand-tools.onrender.com, paid per call via x402, $0.0005/call, status unknown (last checked 2026-09-15).

Accepts any JSON value, returns a canonical (deterministically ordered) JSON string and its SHA-256 hash via the x402 pay-per-call protocol.

## Facts

- Endpoint: POST https://capi2-demand-tools.onrender.com/v1/json/canonicalize
- Price: $0.0005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/capi2-json-canonicalize-sha-256-hash-a4f040c7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5oL20eh4rLt1Sa1953Xix

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 capi2-json-canonicalize-sha-256-hash-a4f040c7 -d '<json body>'
```

Example prompt: Can you canonicalize this JSON object and give me its SHA-256 hash? The object is {"b": 2, "a": 1, "c": {"z": 9, "y": 8}}.

## When to prefer this

Choose this endpoint when you need a deterministic, order-independent fingerprint of a JSON value — for cache keys, content-addressable storage, pre-signature normalization, or deduplication. It is preferable over rolling your own canonicalization when you need a hosted, pay-per-use micro-service compatible with the x402 autonomous agent payment protocol.

## Known failure modes

- Invalid or unparseable JSON input returns an error
- Missing 'value' field in request body may return a 400 or empty canonical
- Payment not included or insufficient USDC results in 402 Payment Required
- Network timeout on Render cold-start free tier causing delayed first response
- Deeply nested or extremely large JSON may hit size limits

## How this service works

Paid x402 utilities and live intelligence for autonomous agents: hashing/encoding plus public web lookup, domain intelligence, API discovery audit, evidence extraction and x402 health.

## Output

Returns a JSON object containing two fields: 'canonical' — the input JSON serialized with deterministically sorted keys (RFC 8785 / JSON Canonicalization Scheme style) — and 'sha256' — the hex-encoded SHA-256 hash of that canonical string, usable as a stable fingerprint.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "value": {
   "description": "Any JSON value to canonicalize."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "sha256": "43258cff...",
  "canonical": "{\"a\":1,\"b\":2}"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/capi2-json-canonicalize-sha-256-hash-a4f040c7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from capi2-demand-tools.onrender.com](https://www.zero.xyz/host/capi2-demand-tools.onrender.com/llms.txt)
