# Agent Prep – JSON Structural Diff

> Agent Prep – JSON Structural Diff is a paid API for AI agents from agent-prep.annushka1190.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-13).

Computes a structural diff between two JSON objects, returning added, removed, and changed fields with before/after values.

## Facts

- Endpoint: POST https://agent-prep.annushka1190.workers.dev/v1/json/diff
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-prep-json-structural-diff-ab365405
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1rSV17OpVKCO8H61raaKg

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 agent-prep-json-structural-diff-ab365405 -d '<json body>'
```

Example prompt: Can you diff these two JSON objects and tell me exactly which fields were added, removed, or changed — I want to see the before and after values for anything that shifted?

## When to prefer this

Choose this endpoint when you need a lightweight, pre-LLM structural diff of two JSON objects without writing custom comparison logic — especially useful in agentic pipelines where you want to understand what changed between two API responses, config states, or data snapshots before passing the delta to an LLM. It's pay-per-call with no API key required, making it easy to integrate into ephemeral agent workflows.

## Known failure modes

- Missing or malformed input body returns a validation error
- Non-JSON body types are rejected (bodyType must be 'json')
- Payment not included or insufficient USDC causes a 402 Payment Required response
- Deeply nested or extremely large JSON objects may hit size/timeout limits
- Method other than POST returns 405

## How this service works

Pre-LLM utilities for AI agents: structural JSON diff, JSON path listing, token estimation, text chunking, and truncation. Pay with USDC via x402 — no API keys.

## Output

A JSON object with three arrays: 'added' (fields present only in the new object), 'removed' (fields present only in the old object), and 'changed' (fields present in both but with different values, each entry showing the path, before value, and after value).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object"
    },
    "type": {
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "const": "json"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "added": [],
  "changed": [
   {
    "path": "a",
    "after": 2,
    "before": 1
   }
  ],
  "removed": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-prep-json-structural-diff-ab365405/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-prep.annushka1190.workers.dev](https://www.zero.xyz/host/agent-prep.annushka1190.workers.dev/llms.txt)
