Skip to content
Fourohtwo

agent402.tools/api/json-format

Validate, pretty-print (any indentation, 0-8 spaces), or minify JSON, optionally with object keys sorted. canonical: true returns the RFC 8785 (JCS) canonical form - keys sorted, no whitespace, ECMAScript number and string serialization - plus its SHA-256, for hashing and signing. Numbers are read as IEEE-754 doubles and a duplicate key keeps its last value. Returns parse errors with position when

BasePolygonArbitrumMonadAvalancheSei+5Unchecked
POSThttps://agent402.tools/api/json-format

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://agent402.tools/api/json-format", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"indent":2,"json":"{\"b\":2,\"a\":1}","sortKeys":true}),
});
console.log(await res.json());

Example input

{
  "indent": 2,
  "json": "{\"b\":2,\"a\":1}",
  "sortKeys": true
}