{"uid":"cap_ikAy9iZCWs20Yq04z2kp2","slug":"wealth-agent-text-diff-64115b4b","name":"Wealth Agent Text Diff","description":"Return the line-level diff between two texts as added/removed/unified hunks with counts. Use it to review a patch, compare two API responses, or decide whether two documents actually differ before spending tokens on them.","url":"https://wealth-agent.wealthagent-app.workers.dev/api/x402/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"],"type":"string"},"queryParams":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string","description":"Original text"},"b":{"type":"string","description":"Changed text"}}}}},"output":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"object","required":["ok","resource","status","deliverable"],"properties":{"ok":{"type":"boolean"},"tx":{"type":["string","null"]},"note":{"type":"string"},"error":{"type":["string","null"]},"job_id":{"type":["string","null"]},"status":{"enum":["delivered","paid_not_delivered"],"type":"string"},"resource":{"type":"string"},"receipt_id":{"type":["string","null"]},"deliverable":{"type":["object","null"],"required":["kind","summary"],"properties":{}}}}}}}},"responseSchema":{"type":"json","example":{"kind":"diff","added":2,"removed":1,"unified":"@@ -1,3 +1,4 @@","hunk_count":1}},"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_BQdQ-Uxce_sJsIBR8_4zr","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 unified diff between two text strings, returning added/removed line counts and a unified patch format","exampleAgentPrompt":"Show me the diff between these two texts — original: 'Hello world\\nLine two\\nLine three' and changed: 'Hello world\\nLine two modified\\nLine three\\nLine four' — tell me how many lines were added and removed and give me the unified patch.","exampleUseCases":[{"title":"Code review change summary","prompt":"Compare these two versions of my function and tell me exactly what lines changed, how many were added and removed, and show me the unified diff patch: original is 'def foo():\\n  return 1' and the new version is 'def foo():\\n  x = 2\\n  return x'."},{"title":"Document edit detection","prompt":"I have the original draft of my README and the updated version — can you diff them and show me a unified patch with the line counts for what was added and what was removed? Original: 'Install with npm\\nRun npm start' and updated: 'Install with npm\\nConfigure .env\\nRun npm start'."},{"title":"Config file comparison","prompt":"Tell me what changed between my old config 'host=localhost\\nport=8080\\ndebug=false' and the new one 'host=localhost\\nport=9090\\ndebug=true\\nlog=verbose' — give me the unified diff and the added/removed line counts."}],"resultDescription":"Returns a JSON object with kind set to 'diff', the count of added lines, the count of removed lines, a unified diff string in standard patch format, and the number of hunks.","failureModes":["Missing required query parameters 'a' or 'b' results in an error response","Payment not fulfilled (x402 protocol) causes a paid_not_delivered status","Very large text inputs may cause timeout or truncation","Identical strings return a diff with zero added and zero removed lines","Non-UTF8 or binary content may produce unexpected diff output"],"whenToPreferThis":"Choose this endpoint when you need a fast, pay-per-call line-level text diff without setting up a local diffing library or server. It is ideal for agents that need to detect and summarize textual changes on demand, especially in workflows where computing a unified patch programmatically would require additional dependencies. It suits lightweight comparison tasks on small to medium text snippets.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T12:35:18.557Z","isFirstParty":false,"canonicalSlug":"wealth-agent-text-diff-64115b4b"}