{"uid":"cap_1UdVmcqYQzcWzw7QJFN6G","slug":"24k-labs-json-formatter-bd711350","name":"24K Labs JSON Formatter","description":"Pretty-print, minify, or sort-keys a JSON string; reports validity and size delta.","url":"https://api.24klabs.ai/api/v1/json-format","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"json":{"type":"string"},"indent":{"type":"number"},"sort_keys":{"type":"boolean"}}},"responseSchema":{"type":"json","example":{"result":"{\n  \"a\": 2,\n  \"b\": 1\n}"}},"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_9uYv9xX-_OqLpzLquBLYc","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":"Pretty-print, minify, or sort keys of a JSON string while reporting validity and size delta","exampleAgentPrompt":"Can you pretty-print this JSON for me so it's readable, and tell me how much bigger it gets: {\"name\":\"Alice\",\"age\":30,\"city\":\"NYC\"}?","exampleUseCases":[{"title":"Minify JSON for API payload","prompt":"I need to minify this JSON before sending it in a request — strip all the whitespace and tell me how many bytes I save: {\"user\": {\"id\": 42, \"name\": \"Bob\", \"active\": true}}."},{"title":"Sort JSON keys for diffing","prompt":"Sort all the keys in this JSON alphabetically so I can diff it against another config file more easily: {\"zebra\": 1, \"apple\": 2, \"mango\": 3}."},{"title":"Validate and pretty-print config JSON","prompt":"Check if this JSON is valid and pretty-print it with indentation so I can review it: {\"host\":\"localhost\",\"port\":8080,\"debug\":false}."}],"resultDescription":"Returns the transformed JSON string (pretty-printed, minified, or key-sorted), a validity flag indicating whether the input was well-formed JSON, the original size in bytes, the output size in bytes, and the size delta showing the difference between them.","failureModes":["Invalid JSON input returns a validation error with position or description of the syntax error","Empty or missing JSON body returns a 400 bad request","Unsupported mode value returns an error listing valid options","Extremely large JSON payloads may be rejected or time out","Malformed request body (non-JSON content type) returns a parsing error"],"whenToPreferThis":"Choose this endpoint when you need a quick, cheap ($0.001) serverless JSON formatting operation without standing up your own parser — especially useful in agent pipelines where JSON needs to be normalized before storage, diffing, or display. Prefer it over general-purpose code execution when you want a dedicated, reliable JSON tool with built-in validity reporting and size analytics in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:37.537Z","isFirstParty":false}