# HTTPay Text Diff API

> HTTPay Text Diff API is a paid API for AI agents from httpay.xyz, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Computes the character, word, or line-level diff between two text strings, returning added/removed counts and a structured patch.

## Facts

- Endpoint: POST https://httpay.xyz/api/text-diff
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/httpay-text-diff-api-5a2fb467
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KxEa0bzTGYLZRRIzNoL1e

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 httpay-text-diff-api-5a2fb467 -d '<json body>'
```

Example prompt: Compare these two paragraphs word by word and tell me what was added and removed: text1 is 'The quick brown fox jumps over the lazy dog' and text2 is 'The quick red fox leaps over the sleepy cat' — use words mode.

## When to prefer this

Use this endpoint when you need a quick, pay-per-call text diff without managing API keys or subscriptions — ideal for agents that occasionally need to compare text snippets, detect changes between document versions, or compute edit distances without spinning up a dedicated diff service.

## Known failure modes

- Missing text1 or text2 body fields — likely returns 400 or validation error
- Invalid type value (not chars/words/lines) — may default to lines or return error
- Payment not included or insufficient USDC — returns 402 Payment Required
- Very large text inputs may time out or be rejected
- Malformed JSON body — returns 400 Bad Request

## How this service works

307 pay-per-call APIs (287 native + Universal Gateway proxying 37 services) powered by x402 and USDC on Base. Token intelligence, DeFi yields, MEV risk, AI tools, web scraping. No API keys, no subscriptions — pay $0.001–$0.05 per call.

## Output

Returns a JSON object with counts of added and removed tokens (chars, words, or lines depending on the type parameter) and a structured patch array describing each change, produced by the npm diff library.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "description": "Compute the diff between two text strings. POST JSON body: {text1, text2, type}. 'type' can be 'chars', 'words', or 'lines' (default: lines). Returns added/removed counts and a structured patch. Uses the 'diff' npm package."
 }
}
```

## More

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