{"uid":"cap_I540920jenurm3c7D_z3K","slug":"delx-object-size-67ab6eb0","name":"Delx Object Size","description":"Count object keys. Call when you size agent payloads before paying. Returns size integer for $0.001 USDC via x402 on Base. No network, no keys, no retention; first-party local JSON only. Results are advisory; the caller owns budgets, auth, and production controls.","url":"https://api.delx.ai/api/v1/x402/obj-size","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"object":{"type":"object","description":"Input field: object."}}},"responseSchema":{"type":"json","example":{"size":2,"schema":"delx/util-obj-size/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_CfsnKFzd2qAVIfRJI3-SS","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":"Counts the number of top-level keys in a JSON object and returns that count as an integer","exampleAgentPrompt":"How many top-level keys does this JSON object have? {\"name\": \"Alice\", \"age\": 30, \"role\": \"admin\"} — I want to size it before deciding whether to process it.","exampleUseCases":[{"title":"Pre-payment payload size check","prompt":"Before I submit this agent payload for processing, can you tell me how many keys it has so I know if it's within the budget limit? Here's the object: {\"user_id\": \"u123\", \"action\": \"purchase\", \"amount\": 50, \"currency\": \"USD\", \"timestamp\": \"2024-01-15\"}."},{"title":"Dynamic form field count","prompt":"I'm generating a form from a config object and need to know how many fields it defines before rendering. Count the keys in this object: {\"firstName\": \"\", \"lastName\": \"\", \"email\": \"\", \"phone\": \"\", \"address\": \"\", \"city\": \"\", \"zip\": \"\"}."},{"title":"Agent response complexity guard","prompt":"My agent just built a response payload and I want to make sure it's not too bloated — can you count how many top-level keys are in this object before I pass it downstream? {\"summary\": \"done\", \"status\": \"ok\", \"errors\": [], \"metadata\": {}, \"result\": null}."}],"resultDescription":"Returns a single integer representing the number of top-level keys in the submitted JSON object. The result is advisory and does not reflect nested depth or total byte size.","failureModes":["Non-object input (array, string, number) may return an error or unexpected result","Empty object returns 0","Deeply nested objects only count top-level keys — callers expecting total field counts may be surprised","Payment failure via x402 if USDC balance is insufficient","Malformed JSON in request body causes a parsing error"],"whenToPreferThis":"Use this endpoint when you need a fast, cheap, local count of top-level keys in a JSON object — especially before making budgeting decisions about downstream API calls or payload processing. Prefer it over writing inline code when you want a stateless, auditable utility call that doesn't retain data. Not suitable if you need recursive/deep key counts or byte-size measurements.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:44:59.038Z","isFirstParty":false}