{"uid":"cap_tiv8yj7rysECTK6pb1mHa","slug":"x402-utils-text-diff-4d32487d","name":"x402 Utils – Text Diff","description":"Compare two texts by lines, words or characters: what was added and removed, and a unified diff for lines.","url":"https://qcb7fnxsbd7fbhj4.68r.lambda-web.us-east-1.on.aws/v1/diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"a":{"type":"string","description":"the old text"},"b":{"type":"string","description":"the new text"},"mode":{"enum":["lines","words","chars"],"type":"string","description":"unit of comparison (default lines)"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_nqK7FZqCibRlv1yVFUBKf","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two texts by lines, words, or characters and returns what was added, removed, and a unified diff for line-mode comparisons.","exampleAgentPrompt":"Show me what changed between these two paragraphs word by word — here's the old version: 'The quick brown fox jumps over the lazy dog.' and the new version: 'The quick red fox leaped over the lazy cat.' Use word mode.","exampleUseCases":[{"title":"Code review change summary","prompt":"I have two versions of a config file — can you diff them line by line and tell me exactly what lines were added and removed? Old: 'timeout=30\nretries=3\nverbose=false' and new: 'timeout=60\nretries=5\nverbose=true\ndebug=true'"},{"title":"Proofreading document edits","prompt":"Compare these two draft paragraphs at the character level and tell me every single character that changed: old text is 'Acme Corp provides reliable services.' and new text is 'Acme Corp provides reliable, fast services.'"},{"title":"Content moderation change tracking","prompt":"Someone edited a user-submitted description — can you do a word-level diff to show exactly what words were added or removed? Before: 'Great product, highly recommend it to everyone.' After: 'Terrible product, do not recommend it to anyone.'"}],"resultDescription":"Returns a structured breakdown of what was added and removed between the two input texts at the specified granularity (lines, words, or characters), plus a unified diff string when comparing by lines.","failureModes":["Missing required fields 'a' or 'b' returns a validation error","Invalid 'mode' value (not lines/words/chars) returns an error","Very large texts may time out or exceed payload limits","Payment not provided or insufficient USDC balance results in 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need a programmatic, structured diff between two text strings with explicit granularity control (lines, words, or characters) and a unified diff output, rather than a human-readable summary or semantic similarity score. Ideal for change tracking, document versioning, audit trails, and content moderation workflows where exact edits matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:35:25.438Z","isFirstParty":false,"canonicalSlug":"x402-utils-text-diff-4d32487d"}