# Coinslot Text Diff

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

Computes a unified line-based diff of two text strings, returning the unified diff output plus structured change statistics (added/removed/unchanged line counts and hunks).

## Facts

- Endpoint: POST https://coinslot.dev/api/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/coinslot-text-diff-6f0f4c6e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ifMyO9CiSW9ZHkra0Ogyz

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 coinslot-text-diff-6f0f4c6e -d '<json body>'
```

Example prompt: Show me what changed between these two versions of my config file — here's the original text and the new text, and give me 5 lines of context around each change.

## When to prefer this

Use this endpoint when you need a programmatic, structured diff of two text blobs without setting up a local diff tool — especially useful in agent workflows where you need both the human-readable unified diff and machine-readable change counts in one call. Prefer it over shell-based diff when operating in a serverless or sandboxed environment, or when you need the structured hunk data for downstream processing.

## Known failure modes

- Input text exceeds 200KB limit — request rejected with payload-too-large error
- Missing required field 'a' or 'b' — returns validation error
- Context value outside 0-10 range — returns parameter validation error
- Non-string values for 'a' or 'b' — returns type error

## How this service works

Line-based diff of two texts. Returns unified diff plus structured changes (added/removed/unchanged counts and hunks). POST { a, b, context? } (max 200KB each).

## Output

Returns a unified diff string (patch format) plus a structured object with counts of added lines, removed lines, and unchanged lines, along with an array of diff hunks each containing the changed and surrounding context lines.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "string"
  },
  "b": {
   "type": "string"
  },
  "context": {
   "type": "integer",
   "default": 3,
   "maximum": 10,
   "minimum": 0
  }
 }
}
```

## More

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