# Wealth Agent Text Diff

> Wealth Agent Text Diff is a paid API for AI agents from wealth-agent.wealthagent-app.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Computes a unified diff between two text strings, returning added/removed line counts and a unified patch format

## Facts

- Endpoint: GET https://wealth-agent.wealthagent-app.workers.dev/api/x402/diff?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/wealth-agent-text-diff-64115b4b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ikAy9iZCWs20Yq04z2kp2

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 wealth-agent-text-diff-64115b4b
```

Example prompt: Show me the diff between these two texts — original: 'Hello world\nLine two\nLine three' and changed: 'Hello world\nLine two modified\nLine three\nLine four' — tell me how many lines were added and removed and give me the unified patch.

## When to prefer this

Choose this endpoint when you need a fast, pay-per-call line-level text diff without setting up a local diffing library or server. It is ideal for agents that need to detect and summarize textual changes on demand, especially in workflows where computing a unified patch programmatically would require additional dependencies. It suits lightweight comparison tasks on small to medium text snippets.

## Known failure modes

- Missing required query parameters 'a' or 'b' results in an error response
- Payment not fulfilled (x402 protocol) causes a paid_not_delivered status
- Very large text inputs may cause timeout or truncation
- Identical strings return a diff with zero added and zero removed lines
- Non-UTF8 or binary content may produce unexpected diff output

## How this service works

Return the line-level diff between two texts as added/removed/unified hunks with counts. Use it to review a patch, compare two API responses, or decide whether two documents actually differ before spending tokens on them.

## Output

Returns a JSON object with kind set to 'diff', the count of added lines, the count of removed lines, a unified diff string in standard patch format, and the number of hunks.

## 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": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "Original text"
      },
      "b": {
       "type": "string",
       "description": "Changed text"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "resource",
      "status",
      "deliverable"
     ],
     "properties": {
      "ok": {
       "type": "boolean"
      },
      "tx": {
       "type": [
        "string",
        "null"
       ]
      },
      "note": {
       "type": "string"
      },
      "error": {
       "type": [
        "string",
        "null"
       ]
      },
      "job_id": {
       "type": [
        "string",
        "null"
       ]
      },
      "status": {
       "enum": [
        "delivered",
        "paid_not_delivered"
       ],
       "type": "string"
      },
      "resource": {
       "type": "string"
      },
      "receipt_id": {
       "type": [
        "string",
        "null"
       ]
      },
      "deliverable": {
       "type": [
        "object",
        "null"
       ],
       "required": [
        "kind",
        "summary"
       ],
       "properties": {}
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "kind": "diff",
  "added": 2,
  "removed": 1,
  "unified": "@@ -1,3 +1,4 @@",
  "hunk_count": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wealth-agent-text-diff-64115b4b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from wealth-agent.wealthagent-app.workers.dev](https://www.zero.xyz/host/wealth-agent.wealthagent-app.workers.dev/llms.txt)
