# x402 Text Diff

> x402 Text Diff is a paid API for AI agents from x402-v2-mint-text-diff.vercel.app, paid per call via x402, $0.006/call, status unknown (last checked 2026-12-03).

Computes a deterministic line, word, or character-level diff between two text strings and returns a one-line delta summary, running fully offline.

## Facts

- Endpoint: POST https://x402-v2-mint-text-diff.vercel.app/v1/text-diff?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-12-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-text-diff-2cc85cff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IUGFRRhAHbwl4IWKiwHXI

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 x402-text-diff-2cc85cff -d '<json body>'
```

Example prompt: Compare these two paragraphs word by word and tell me what changed: original is 'The quick brown fox jumps over the lazy dog' and the new version is 'The quick red fox leaps over the sleepy dog' — use word-level diff mode.

## When to prefer this

Choose this endpoint when you need a deterministic, offline, reproducible diff between two text strings with an explicit diff granularity (lines, words, or chars). It is ideal when you want a concise one-line summary of changes rather than a verbose patch format, and when privacy matters since it runs offline without sending data to a third-party AI model. Prefer it over LLM-based comparison when you need exact, byte-level determinism rather than semantic approximation.

## Known failure modes

- Input text exceeds 200,000 character limit — request rejected
- Invalid or missing 'mode' enum value — validation error
- Either 'a' or 'b' field missing — schema validation failure
- Payment not processed via x402 protocol — 402 Payment Required response
- Network timeout or Vercel cold start delay on first request

## How this service works

Deterministic line/word/char diff with one-line delta summary. Offline. Amp port.

## Output

Returns a JSON object with an 'ok' boolean, the skill name ('text-diff'), a 'charged' flag indicating the payment was processed, and a 'summary' string providing a one-line delta summary of the differences found between the two input texts.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "maxLength": 200000
  },
  "b": {
   "type": "string",
   "maxLength": 200000
  },
  "mode": {
   "enum": [
    "lines",
    "words",
    "chars"
   ],
   "type": "string"
  },
  "options": {
   "type": "object",
   "properties": {
    "mode": {
     "enum": [
      "lines",
      "words",
      "chars"
     ],
     "type": "string",
     "default": "lines"
    }
   },
   "additionalProperties": false
  },
  "request_id": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "skill": "text-diff",
  "charged": true,
  "summary": "ok"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-text-diff-2cc85cff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-v2-mint-text-diff.vercel.app](https://www.zero.xyz/host/x402-v2-mint-text-diff.vercel.app/llms.txt)
