# Text Diff — Word-Level Change Analysis

> Text Diff — Word-Level Change Analysis is a paid API for AI agents from text-metrics.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Computes a word-level diff of two texts, returning counts of added, removed, and kept words, changed spans, and a percentage-changed score.

## Facts

- Endpoint: GET https://text-metrics.x402tookit.com/text-diff?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/text-diff-word-level-change-analysis-f7d85e1f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z7jRfWLv78evvd4Adhpeb

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 text-diff-word-level-change-analysis-f7d85e1f
```

Example prompt: Compare these two paragraphs word by word and tell me what was added, removed, and kept, and what percentage changed — original: 'The quick brown fox jumps over the lazy dog', new: 'The quick red fox leaps over the sleeping cat'.

## When to prefer this

Choose this endpoint when you need a structured, machine-readable word-level diff with explicit counts and changed spans — not just a similarity score. It is ideal when you need to know exactly which words were added or removed and by how much the text changed, rather than just whether two texts are similar (use the similarity endpoint for that). Best for revision tracking, audit trails, and change detection workflows.

## Known failure modes

- Missing 'old' or 'new' query parameter returns an error
- Input text exceeding 1500 characters for the old text may be rejected or truncated
- Empty strings may return zero changes with 0% changed
- Non-text or binary content passed as strings may produce unexpected token counts

## How this service works

Word-level diff of two texts: words added, removed and kept, the changed spans, and a percent changed.

## Output

Returns counts of added, removed, and kept words; an array of changed spans each with the added and removed text; total word counts for both texts; and a changedPct value representing the proportion of the text that was modified.

## 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": [
      "old",
      "new"
     ],
     "properties": {
      "new": {
       "type": "string",
       "description": "New text"
      },
      "old": {
       "type": "string",
       "description": "Original text (up to 1500 characters)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "kept": {
       "type": [
        "null",
        "number"
       ]
      },
      "added": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "changes": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "added": {
          "type": [
           "null",
           "string"
          ]
         },
         "removed": {
          "type": [
           "null",
           "string"
          ]
         }
        }
       }
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "removed": {
       "type": [
        "null",
        "number"
       ]
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "wordsNew": {
       "type": [
        "null",
        "number"
       ]
      },
      "wordsOld": {
       "type": [
        "null",
        "number"
       ]
      },
      "changedPct": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
    
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/text-diff-word-level-change-analysis-f7d85e1f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from text-metrics.x402tookit.com](https://www.zero.xyz/host/text-metrics.x402tookit.com/llms.txt)
