POST
/api/v1/compute-tools/text-diff$0.005 USDCProduce a unified diff and per-hunk stats for two texts in line, word, or character mode with configurable context lines.
An unpaid probe returns HTTP 402 with x402 payment requirements. After paying the exact USDC amount on Base, retry the identical request with a payment-signature header.
curl -i -X POST "https://www.brainiac.software/api/v1/compute-tools/text-diff" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"from": "a\nb\nc\n",
"to": "a\nB\nc\n",
"mode": "line"
}
JSON{
"status": "complete",
"equal": false,
"unified": "===================================================================\n--- from\n+++ to\n@@ -1,3 +1,3 @@\n a\n-b\n+B\n c",
"hunks": [
{
"removed": true,
"value": "b",
"count": 1
},
{
"added": true,
"value": "B",
"count": 1
}
],
"stats": {
"added": 1,
"removed": 1,
"unchanged": 2
},
"mode": "line",
"sources": [
{
"source": "jsdiff 9.0.0 (Myers diff)",
"url": "https://github.com/kpdecker/jsdiff",
"licence": "BSD-3-Clause",
"retrievedAt": "2026-04-13",
"status": "ok"
}
],
"limitations": [
"Unified output is line-oriented even when mode is word or character.",
"Hunks and stats follow the selected line, word, or character mode."
]
}HTTP 4xx/5xx are not charged. HTTP 2xx with status complete or partial and real data is charged; status failed or empty payloads return non-2xx and are not charged.
All six endpoints are pure in-process computation on the request; no filesystem, network, or database access. jq runs with a measured 2 s budget and a 4 MB output cap; a pathological filter can exceed the budget before it returns. The cube solver accepts face turns only and reports half-turn-metric solutions.