# SignalHarness Structured Diff

> SignalHarness Structured Diff is a paid API for AI agents from signalharness.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Computes a structured semantic diff between two arbitrary JSON values, returning added, changed, and removed fields with a summary.

## Facts

- Endpoint: POST https://signalharness.ai/api/agent/services/structured_diff/invoke
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/signalharness-structured-diff-4cf495c1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xBY2CvLjFpEFDhjqpulhD

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 signalharness-structured-diff-4cf495c1 -d '<json body>'
```

Example prompt: Can you diff these two JSON objects for me and tell me exactly what was added, changed, or removed? Before: {"status":"active","score":10} and after: {"status":"inactive","score":10,"tier":"gold"}.

## When to prefer this

Choose this endpoint when you need a deterministic, structured breakdown of differences between two arbitrary JSON values — objects, arrays, or primitives — especially when you need machine-readable output (added/changed/removed arrays) rather than a human-readable text diff. Prefer it over generic LLM-based comparison when you need reliable counts, field-level granularity, and a verifiable result hash. Best for auditing, change detection pipelines, and automated monitoring scenarios.

## Known failure modes

- Malformed or unparseable JSON in before/after fields returns an error
- Both inputs being identical returns empty diff arrays with zero counts
- Missing required before or after fields may result in a 400 error
- Network timeout or service unavailability returns a failure status
- Payment failure via x402 protocol prevents execution

## How this service works

Explore 330 pay-per-call x402 API services and 27 agent-native digital products, with Base USDC pricing, secure Polar checkout, and free discovery.

## Output

Returns a structured diff object with three arrays — added, changed, and removed — listing affected fields and their values, plus a summary object with counts for each category and an unchanged count. Also includes execution metadata such as payment receipt, request ID, and a SHA-256 hash of the result for verification.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "after": {
   "type": [
    "object",
    "array",
    "string",
    "number",
    "boolean",
    "null"
   ]
  },
  "before": {
   "type": [
    "object",
    "array",
    "string",
    "number",
    "boolean",
    "null"
   ]
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "replay": false,
  "result": {
   "added": [
    {
     "path": "example",
     "value": {}
    }
   ],
   "changed": [
    {
     "path": "example",
     "after": {},
     "before": {}
    }
   ],
   "removed": [
    {
     "path": "example",
     "value": {}
    }
   ],
   "summary": {
    "added": 0,
    "total": 0,
    "changed": 0,
    "removed": 0
   },
   "unchangedCount": 0
  },
  "status": "succeeded",
  "receipt": {
   "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
   "usage": [],
   "status": "succeeded",
   "network": "eip155:8453",
   "artifacts": [],
   "endedAtMs": 0,
   "latencyMs": 0,
   "paymentId": "example-payment",
   "receiptId": "example-receipt",
   "requestId": "example-request",
   "serviceId": "structured_diff",
   "executionId": "example-execution",
   "startedAtMs": 0,
   "amountAtomic": "10000",
   "resultSha256": "eef31d0cecdd1ad7e4ac279ba4b65b39356fb5a7ebc208786b5441e79bdf9c88",
   "serviceVersion": "1.0.0",
   "settlementReference": "0x0000000000000000000000000000000000000000000000000000000000000000"
  },
  "artifacts": [],
  "requestId": "example-request",
  "executionId": "example-execution"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/signalharness-structured-diff-4cf495c1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from signalharness.ai](https://www.zero.xyz/host/signalharness.ai/llms.txt)
