# fastapi.online — Text Diff (diff-text)

> fastapi.online — Text Diff (diff-text) is a paid API for AI agents from api.fastapi.online, paid per call via x402, $0.0005/call, status unknown (last checked 2026-09-15).

Computes a character or line-level diff between two text strings, returning the differences between them.

## Facts

- Endpoint: POST https://api.fastapi.online/diff-text
- Price: $0.0005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastapi-online-text-diff-diff-text-e84fcacb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0LbG2-7cGUpkV7V-pMRtp

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 fastapi-online-text-diff-diff-text-e84fcacb -d '<json body>'
```

Example prompt: Can you diff these two versions of my paragraph and show me exactly what changed? Original: 'The quick brown fox jumps over the lazy dog.' Revised: 'The quick red fox leaped over the sleepy dog.'

## When to prefer this

Use this endpoint when you need a quick, cheap ($0.0005 USDC), no-signup text diff between two strings of up to 50,000 characters each, especially in agent workflows that already pay per call with crypto via x402. Prefer it over building your own diff logic or spinning up a full document comparison service for lightweight, inline comparisons.

## Known failure modes

- Input strings exceed 50,000 character limit — request rejected
- Missing one or both input fields — returns validation error
- Identical strings — returns empty diff or no-change indicator
- Network or server error — returns 5xx status

## How this service works

Chat, embeddings, OCR, speech-to-text, image editing, image understanding (captioning/Q&amp;A), text-to-speech, translation, writing tools, classification tools, developer tools, local utilities, format/checksum validators, encoding &amp; crypto utilities, date/time calculators, geo/coordinate math, math &amp; finance calculators, novelty tools, and business/social writing generators — 179 endpoints in all, across multiple specialized self-hosted models. Pay per call with crypto — no signup — or get an API key.

## Output

Returns a structured or formatted diff showing the differences between the two input strings, including inserted, deleted, and unchanged sections — similar to a standard unified diff output.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string",
   "maxLength": 50000
  },
  "b": {
   "type": "string",
   "maxLength": 50000
  }
 }
}
```

## More

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