"method" : "POST" , "content_type" : "application/json" ,
"price_usd" : 0.003 , // 3000 atomic USDC (6 decimals)
"network" : "eip155:8453" , // Base mainnet
"asset" : "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" , // USDC
"payTo" : "0xc22f9CAEBAc37fE72D5142f35f21f6696Ea9Ef69" ,
"you_provide" : { // JSON body fields
"data" :
required
any JSON
★
Any JSON value. Object keys are sorted recursively; you also get canonical compact JSON.
Required · any JSON
Example: {"b": 1, "a": {"d": 2, "c": 3}}
"reverse" :
optional
boolean
★
true sorts keys Z->A, false (default) sorts A->Z.
Optional · boolean
default false
Example: false
<TRUE_OR_FALSE>
true false
use example values clear
},
"request_body" : // live, from your inputs
{
"data": {
"b": 1,
"a": {
"d": 2,
"c": 3
}
},
"reverse": false
}
"you_get" : { // HTTP 200 application/json after payment
"output_schema" :
{
"type": "object",
"properties": {
"skill": {
"type": "string"
},
"ok": {
"type": "boolean"
},
"sorted": {
"type": "object",
"properties": {
"a": {
"type": "object",
"properties": {
"c": {
"type": "integer"
},
"d": {
"type": "integer"
}
}
},
"b": {
"type": "integer"
}
}
},
"canonical": {
"type": "string"
},
"bytes": {
"type": "integer"
}
},
"required": [
"ok",
"skill"
]
}
"example" :
{
"skill": "json_sort",
"ok": true,
"sorted": {
"a": {
"c": 3,
"d": 2
},
"b": 1
},
"canonical": "{\"a\":{\"c\":3,\"d\":2},\"b\":1}",
"bytes": 25
}
},
"flow" : [
POST https://grokzilla.shop/api/skills/json-sort with the JSON body, no payment header
← 402 Payment Required + PAYMENT-REQUIRED header: base64 JSON {x402Version: 2, accepts: [{scheme: "exact", network: "eip155:8453", asset: USDC, amount: "3000", payTo}]} (same JSON in the body)
your x402 client checks amount ≤ $0.003 and signs a USDC transfer authorization to payTo with your wallet
retry the same POST with PAYMENT-SIGNATURE: <base64> (x402 v2) or X-PAYMENT (v1 clients)
← 200 OK with the result JSON + PAYMENT-RESPONSE header (base64 settlement receipt, tx hash on Base)
],
"copy" : { // fills in from your inputs as you type
"curl" // unpaid: shows the 402 copy
"agentcash" // pays from your AgentCash wallet copy
},
"try" : // POSTs unpaid to /api/skills/json-sort on this host and decodes the 402. Never pays.
Send unpaid request
}