# Delx Object Size

> Delx Object Size is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Counts the number of top-level keys in a JSON object and returns that count as an integer

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/obj-size
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-object-size-67ab6eb0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_I540920jenurm3c7D_z3K

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability delx-object-size-67ab6eb0 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "object": {
   "type": "object",
   "description": "Input field: object."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "size": 2,
  "schema": "delx/util-obj-size/v1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-object-size-67ab6eb0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
