{"uid":"cap_LlCFnAMYuFtrzejL5LT-a","slug":"text-diff-c852f7ff","name":"Text Diff","description":"Compare two texts line by line: unified diff, list of added, removed and changed lines, line and character similarity, optionally ignoring whitespace and case. Use to compare documents, configs or model outputs.","url":"https://bess-x402.onrender.com/v1/util/diff?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string","description":"First text"},"b":{"type":"string","description":"Second text"},"context":{"type":"integer","description":"Context lines in the unified diff (0-20)"},"ignore_case":{"type":"boolean","description":"Ignore case"},"ignore_whitespace":{"type":"boolean","description":"Ignore whitespace changes"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_WSjwA5_NRTADU0vpZS0Zg","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two texts line by line, returning a unified diff, added/removed/changed lines, and line and character similarity metrics.","exampleAgentPrompt":"Can you diff these two config file versions for me and show what lines were added, removed, or changed — ignore any whitespace differences: [text A] vs [text B]?","exampleUseCases":[{"title":"Config file change review","prompt":"I have two versions of my nginx.conf — the old one and the new one. Can you compare them line by line, ignore whitespace, and show me a unified diff with 3 lines of context so I can see exactly what changed?"},{"title":"Model output comparison","prompt":"Compare these two LLM responses to the same prompt and tell me which lines differ, which were added or removed, and how similar they are overall — I want to see the line-by-line breakdown."},{"title":"Document revision audit","prompt":"I need to audit the changes between the original contract draft and the revised version. Can you diff them and list every line that was added, removed, or modified, treating case as significant?"}],"resultDescription":"Returns a unified diff string, separate lists of added, removed, and changed lines, plus a line-level similarity score and a character-level similarity score between the two texts.","failureModes":["Missing required parameters 'a' or 'b' returns an error","Very large texts may exceed query string limits","context parameter outside 0-20 range may be rejected","Non-text binary content passed as strings will produce unpredictable diffs"],"whenToPreferThis":"Choose this endpoint when you need a structured, machine-readable diff of two text strings with quantified similarity scores, especially when you also want to isolate added, removed, and changed lines separately rather than just a raw patch. Ideal for comparing configs, documents, or model outputs programmatically inside an agent pipeline.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T12:34:47.400Z","isFirstParty":false,"canonicalSlug":"text-diff-c852f7ff"}