# JSON Array Group By Key

> JSON Array Group By Key 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-15).

Groups an array of JSON objects by a specified top-level key, returning counts and grouped results as deterministic versioned JSON.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/json-array-group-by-key
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-array-group-by-key-b26d627c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rDiaWHRve7FOFebfFHXK6

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 json-array-group-by-key-b26d627c -d '<json body>'
```

Example prompt: Group this list of order records by their 'status' field and tell me how many are in each group: [{"status":"pending","id":1},{"status":"shipped","id":2},{"status":"pending","id":3}].

## When to prefer this

Use this endpoint when an agent needs to group or partition a bounded in-memory JSON array by a known top-level key without setting up a database query or external aggregation service. Ideal for preprocessing structured data before handing it to a downstream tool with a stricter contract, or when you need deterministic versioned output for reproducibility. Best for arrays up to 256 objects with up to 128 properties each.

## Known failure modes

- Key not found at top level of objects — returns empty groups or error indicating missing key
- Array exceeds 256 items limit — request rejected
- Object in array exceeds 128 properties limit — request rejected
- Key string exceeds 8192 character limit — request rejected
- Malformed JSON input — parsing error returned
- Payment failure via x402 — 402 response before processing

## How this service works

JSON Array Group By Key: JSON Array Group By Key groups object rows by a selected top-level key from bounded caller-supplied values without an external provider. Call JSON Array Group By Key before an agent hands structured data or a batch plan to a downstream tool with a stricter contract. Returns the bounded transformation or validation finding with counts, normalized values, and a versioned result contract for JSON Array Group By Key as versioned deterministic JSON. Price: $0.001 USDC via x4…

## Output

A versioned deterministic JSON object containing the grouped data as a map from each unique key value to its array of matching records, along with per-group counts and normalized values. The response adheres to a versioned result contract for reproducibility.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "key": {
   "type": "string",
   "maxLength": 8192,
   "description": "Key supplied to JSON Array Group By Key; used only for this bounded calculation and processed in memory without retention."
  },
  "items": {
   "type": "array",
   "items": {
    "type": "object",
    "maxProperties": 128,
    "additionalProperties": true
   },
   "maxItems": 256,
   "description": "Items supplied to JSON Array Group By Key; used only for this bounded calculation and processed in memory without retention."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "groups": [
    {
     "items": [
      {
       "id": 1,
       "team": "a"
      },
      {
       "id": 3,
       "team": "a"
      }
     ],
     "value": "a"
    },
    {
     "items": [
      {
       "id": 2,
       "team": "b"
      }
     ],
     "value": "b"
    }
   ],
   "group_count": 2
  },
  "schema": "delx/util-json-array-group-by-key/v1",
  "status": "pass",
  "evidence": {
   "retained": false,
   "input_sha256": "e13f35d5b81a3f1808078d9bbb061844639be95ac142b8481906eb21ac179980",
   "external_calls": 0
  },
  "operation": "data_batch:json_array_group_by_key"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-array-group-by-key-b26d627c/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)
