{"uid":"cap_exW6X_kdFVS7RqC7d6D7m","slug":"delx-sort-keys-3eb1c839","name":"Delx Sort Keys","description":"Return object keys sorted lexicographically for stable hashes — first-party local utility for agent preflight and proven micro-utils expansion. Returns deterministic machine-readable JSON for $0.001 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, no web search, no live RPC, and no mediagen. Results are advisory; the caller owns authorization, budgets, and production controls. Sibling of Delx routes that already c…","url":"https://api.delx.ai/api/v1/x402/sort-keys","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"object":{"type":"object","description":"Input field: object."}}},"responseSchema":{"type":"json","example":{"keys":["a","b"],"count":2,"object":{"a":2,"b":1},"schema":"delx/util-sort-keys/v1"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_wZOR2e3Rr3RZ2p8sMgN95","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the keys of a JSON object sorted lexicographically, enabling deterministic/stable JSON key ordering for hashing and fingerprinting pipelines.","exampleAgentPrompt":"Sort the keys of this JSON object lexicographically so I can use it for stable hashing: {\"zebra\": 1, \"apple\": 2, \"mango\": 3}.","exampleUseCases":[{"title":"Stable hash preflight for agent objects","prompt":"Before I compute the SHA-256 fingerprint of this config object, sort its keys alphabetically so the hash is consistent regardless of insertion order: {\"timeout\": 30, \"endpoint\": \"https://api.example.com\", \"retries\": 3}."},{"title":"Idempotency key generation pipeline","prompt":"I need to generate a stable idempotency key from this request payload — first sort its keys lexicographically so the JSON is canonical before I hash it: {\"userId\": \"u_123\", \"amount\": 50, \"currency\": \"USD\"}."},{"title":"Cache key normalization for API responses","prompt":"Normalize this object's key order alphabetically so I can use it as a deterministic cache key — the same object keeps arriving with shuffled keys: {\"region\": \"us-east\", \"model\": \"gpt-4\", \"temperature\": 0.7}."}],"resultDescription":"Returns the input object's keys sorted in lexicographic (alphabetical) order as a deterministic, machine-readable JSON structure. The response enables downstream steps — such as stable hashing, signature computation, or cache key generation — to operate on a predictable, canonical key sequence regardless of the original insertion order.","failureModes":["Missing or null 'object' field returns a validation error","Non-object input (e.g. array or primitive) returns a type error","Malformed JSON body returns a parse error","Payment not provided or insufficient USDC balance returns a 402 Payment Required","Empty object returns an empty key array (valid but trivial result)"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, stateless, first-party utility to canonicalize JSON key order before hashing, signing, or cache-keying — especially as a preflight step in an agent pipeline that already uses other Delx micro-utils. Prefer it over custom sorting logic when you want a guaranteed lexicographic sort with no side effects, no data retention, and a predictable $0.001 USDC cost per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:57:21.414Z","isFirstParty":false}