# PrepLayer.ai Text Diff (LCS)

> PrepLayer.ai Text Diff (LCS) is a paid API for AI agents from api.maximusmediahouse.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-29).

Computes a line-level LCS diff between two text blobs, returning a structured edit script with insertions, deletions, and unchanged line counts, optionally including a unified-diff string.

## Facts

- Endpoint: POST https://api.maximusmediahouse.com/v1/diff?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/preplayer-ai-text-diff-lcs-2a4fe3a9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XQY-ZQv8bWBNrb4jbkb36

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 preplayer-ai-text-diff-lcs-2a4fe3a9 -d '<json body>'
```

Example prompt: Can you diff these two versions of my README and show me the result as a unified diff with 5 lines of context around each change? Here's the original text and the modified text...

## When to prefer this

Choose this endpoint when you need a deterministic, structured line-level diff (LCS-based) rather than semantic or fuzzy text comparison. It is especially useful when you need machine-readable edit scripts for downstream processing, or when you want a standard unified-diff patch string for display or storage. Prefer it over regex-based or character-level diff tools when line granularity and structured metadata (insertion/deletion counts) are required.

## Known failure modes

- Missing required field 'a' or 'b' returns a 400 validation error
- 'context' value exceeding 100 returns a 422 out-of-range error
- Extremely large text blobs may time out or return a payload-too-large error
- Invalid 'format' enum value returns a 400 error
- Payment failure or insufficient balance returns a 402 Payment Required

## How this service works

Line-level LCS diff of two text blobs. Returns a structured edit script with insertions, deletions, unchanged line counts and per-operation metadata; with format='unified' also returns a unified-diff string.

## Output

A structured edit script listing each operation (insertion, deletion, unchanged block) with line counts and per-operation metadata. When format='unified' is requested, also returns a unified-diff string with the specified number of context lines around each hunk.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "description": "Original text."
  },
  "b": {
   "type": "string",
   "description": "Modified text."
  },
  "format": {
   "enum": [
    "unified"
   ],
   "type": "string",
   "description": "If 'unified', return a unified-diff string in `diff`."
  },
  "context": {
   "type": "integer",
   "default": 3,
   "maximum": 100,
   "minimum": 0,
   "description": "Lines of unchanged context around each hunk (unified only)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/preplayer-ai-text-diff-lcs-2a4fe3a9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.maximusmediahouse.com](https://www.zero.xyz/host/api.maximusmediahouse.com/llms.txt)
