# Text Diff

> Text Diff is a paid API for AI agents from bess-x402.onrender.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-30).

Compares two texts line by line, returning a unified diff, added/removed/changed lines, and line and character similarity metrics.

## Facts

- Endpoint: GET https://bess-x402.onrender.com/v1/util/diff?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/text-diff-c852f7ff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LlCFnAMYuFtrzejL5LT-a

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-c852f7ff
```

Example prompt: Can you diff these two config file versions for me and show what lines were added, removed, or changed — ignore any whitespace differences: [text A] vs [text B]?

## When to prefer this

Choose this endpoint when you need a structured, machine-readable diff of two text strings with quantified similarity scores, especially when you also want to isolate added, removed, and changed lines separately rather than just a raw patch. Ideal for comparing configs, documents, or model outputs programmatically inside an agent pipeline.

## Known failure modes

- Missing required parameters 'a' or 'b' returns an error
- Very large texts may exceed query string limits
- context parameter outside 0-20 range may be rejected
- Non-text binary content passed as strings will produce unpredictable diffs

## How this service works

Compare two texts line by line: unified diff, list of added, removed and changed lines, line and character similarity, optionally ignoring whitespace and case. Use to compare documents, configs or model outputs.

## Output

Returns a unified diff string, separate lists of added, removed, and changed lines, plus a line-level similarity score and a character-level similarity score between the two texts.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "First text"
      },
      "b": {
       "type": "string",
       "description": "Second text"
      },
      "context": {
       "type": "integer",
       "description": "Context lines in the unified diff (0-20)"
      },
      "ignore_case": {
       "type": "boolean",
       "description": "Ignore case"
      },
      "ignore_whitespace": {
       "type": "boolean",
       "description": "Ignore whitespace changes"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/text-diff-c852f7ff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from bess-x402.onrender.com](https://www.zero.xyz/host/bess-x402.onrender.com/llms.txt)
