# OpenVerbs Text Diff

> OpenVerbs Text Diff is a paid API for AI agents from text.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-13).

Compares two text strings and returns either a unified-diff patch string or a structured array of added/removed/unchanged segments at line, word, or character granularity.

## Facts

- Endpoint: POST https://text.openverbs.com/v1/diff
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openverbs-text-diff-112a46c6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JI3VKZQDbSg0qw89vC_Jr

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 openverbs-text-diff-112a46c6 -d '<json body>'
```

Example prompt: Can you diff these two versions of my README — show me exactly what lines were added or removed? Here's the original: 'Hello world. This is v1.' and the updated version: 'Hello world. This is v2. Added new features.' Use lines mode so I get a structured breakdown.

## When to prefer this

Choose this endpoint when you need a precise, programmatic text diff — either a ready-to-apply unified patch string or a structured segment array for downstream processing. Prefer it over LLM-based change summarization when you need exact diff semantics, reproducibility, or machine-readable output at line/word/character granularity.

## Known failure modes

- Missing required fields 'a' or 'b' returns a validation error
- Text exceeding 1,000,000 characters per field may be rejected
- Invalid 'mode' value outside the enum returns a validation error
- Empty strings for both inputs return an empty diff with no changes
- Payment failure via x402 protocol returns a 402 response before processing

## How this service works

Diff two texts. The default `unified` mode returns a unified-diff patch string; `lines`, `words`, and `chars` modes return a structured array of added/removed/unchanged parts.

## Output

For 'unified' mode (default): a unified-diff patch string showing hunks of added (+) and removed (-) lines with context. For 'lines', 'words', or 'chars' modes: a structured JSON array where each element represents a segment tagged as added, removed, or unchanged, allowing programmatic processing of the differences.

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "type": "object",
     "properties": {
      "a": {
       "type": "string",
       "maxLength": 1000000,
       "description": "The original text."
      },
      "b": {
       "type": "string",
       "maxLength": 1000000,
       "description": "The changed text."
      },
      "mode": {
       "type": "string",
       "enum": [
        "unified",
        "lines",
        "words",
        "chars"
       ],
       "description": "Diff granularity, one of unified, lines, words, chars. Default unified."
      }
     },
     "required": [
      "a",
      "b"
     ],
     "additionalProperties": false
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  }
 },
 "required": [
  "input"
 ]
}
```

## More

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