{"uid":"cap_9mZk8hF4LSPDUiwC_vzq8","slug":"text-diff-api-f4794764","name":"Text Diff API","description":"Pure computation endpoints paid per call via x402 ($0.001 USDC on Base).","url":"https://compute-api-production-245d.up.railway.app/diff?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["newText","oldText"],"properties":{"newText":{"type":"string"},"oldText":{"type":"string"}}},"responseSchema":{"type":"object","properties":{"patch":{"type":"string"},"additions":{"type":"integer"},"deletions":{"type":"integer"}}},"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_2me5nx4rMpyvyU4E2rL25","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":"Computes a diff patch between two text strings, returning the patch and counts of additions and deletions.","exampleAgentPrompt":"Can you compute the diff between this old text: 'Hello world, this is version one.' and this new text: 'Hello world, this is version two with more content.' — I need the patch and the number of lines added and deleted.","exampleUseCases":[{"title":"Code review change summary","prompt":"I have two versions of a Python function — the old one and the new one after my colleague's edits. Can you diff them and tell me how many lines were added, how many were deleted, and show me the patch?"},{"title":"Document revision tracking","prompt":"Here's the original draft of my article and the revised version. Can you compare them and give me a diff patch so I know exactly what changed, plus the total additions and deletions?"},{"title":"Config file change detection","prompt":"I have the old nginx config and the new one we're about to deploy. Can you run a diff between them and show me the patch with counts of what was added and removed?"}],"resultDescription":"Returns a JSON object containing: `patch` (a string representing the unified diff patch between oldText and newText), `additions` (integer count of added lines), and `deletions` (integer count of deleted lines).","failureModes":["Missing required fields (oldText or newText) returns a validation error","Payment failure via x402 returns a 402 Payment Required response","Very large text inputs may cause timeouts or memory errors","Identical texts return an empty patch with zero additions and deletions"],"whenToPreferThis":"Choose this endpoint when you need a programmatic, pay-per-call text diff computation without setting up your own diff library or infrastructure — especially in agent pipelines where you want to compare two text versions on demand and receive a structured patch with line-level addition/deletion counts. Ideal for lightweight, one-off diff operations billed at $0.001 USDC per call via x402.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T18:38:10.850Z","isFirstParty":false,"canonicalSlug":"text-diff-api-f4794764"}