{"uid":"cap_i7BDTd8uuAtMePweUzgKM","slug":"24klabs-text-diff-5ffe70bf","name":"24KLabs Text Diff","description":"Unified diff between two texts, plus added/removed line counts and a similarity ratio.","url":"https://api.24klabs.ai/api/v1/text-diff","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"a":{"type":"string"},"b":{"type":"string"}}},"responseSchema":{"type":"json","example":{"similarity":0.8}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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_-ap50jyR_MuONjaOlbKSP","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":"Computes a unified diff between two text strings, returning added/removed line counts and a similarity ratio.","exampleAgentPrompt":"Can you diff these two versions of my README and tell me what lines were added, what was removed, and how similar they are overall? Here's the original: 'Welcome to MyApp. Install with npm install.' And here's the new version: 'Welcome to MyApp v2. Install with npm install myapp. See docs for more.'","exampleUseCases":[{"title":"Code review change summary","prompt":"I have two versions of a Python function — the original and the one my teammate edited. Can you diff them and tell me exactly what lines changed, how many lines were added or removed, and give me a similarity score?"},{"title":"Document revision tracking","prompt":"Compare these two drafts of my blog post introduction and show me a unified diff with the line-level changes, plus tell me the similarity ratio so I know how much it changed."},{"title":"Automated config change detection","prompt":"I need to diff my old nginx config against the new one and get back a unified diff along with counts of added and removed lines — can you do that for me?"}],"resultDescription":"Returns a unified diff string showing line-level changes between the two input texts, a count of added lines, a count of removed lines, and a floating-point similarity ratio (0–1) indicating how alike the two texts are.","failureModes":["Missing or empty input texts return a 400 error","Extremely large texts may time out or be rejected","Non-UTF-8 encoded content may cause parsing errors","Both texts identical returns zero diff with similarity ratio of 1.0"],"whenToPreferThis":"Choose this endpoint when you need a structured, machine-readable diff with similarity scoring between two arbitrary text strings — particularly when you need both the unified diff format and quantitative change metrics (line counts + ratio) in a single call, without setting up a local diff library.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:44:53.278Z","isFirstParty":false}