# Compute Tools API > Run real jq 1.8.2 filters, batch-grade jq conformance cases, solve or validate Rubik's Cube states, and produce RFC 6902 JSON or text diffs from caller input. No account or API key needed for pay-as-you-go calls; sign in for a monthly free quota. Free and monthly plans use an account API key with prepaid credits. Pay as you go is optional: each operation lists a fixed USDC price on Base with the x402 exact scheme. Unpaid pay-as-you-go GET, HEAD, and POST return 402 payment terms (POST validates the body only after payment terms are satisfied). A request that carries payment-signature is not yet charged: settlement happens only after a successful (2xx) result that returns real data (status complete or partial). HTTP 4xx/5xx and coverage status failed or empty payloads are not charged. Settled 2xx responses include a payment-response header; uncharged responses do not. Follow https://www.brainiac.software/agent-instructions.txt for install, payment pins, idempotency, and billing rules. - Product: https://www.brainiac.software/api/compute-tools - Docs: https://www.brainiac.software/api/compute-tools/docs - OpenAPI: https://www.brainiac.software/api/compute-tools/openapi.json - Contact: support@brainiac.software (https://www.brainiac.software/contact) ## Operations ### POST /api/v1/compute-tools/jq-output $0.01 USDC. Run a caller-supplied jq filter against JSON input with real jq 1.8.2 compiled to WebAssembly. Keywords: when grading filters or transforming payloads, filter, input, options, jq 1.8.2, jq-wasm, stdout, outputs, exitCode, Run a jq filter, jq output Inputs: filter, input, options? Docs: https://www.brainiac.software/api/compute-tools/jq-output Example request: ```json { "filter": ".items[] | select(.qty > 1) | .sku", "input": { "items": [ { "sku": "A-1", "qty": 2 }, { "sku": "B-2", "qty": 1 } ] }, "options": { "compact": true } } ``` Example response: ```json { "status": "complete", "stdout": "\"A-1\"", "outputs": [ "A-1" ], "exitCode": 0, "error": null, "elapsedMs": 7, "truncated": false, "overdue": false, "jqVersion": "1.8.2", "sources": [ { "source": "jq 1.8.2 via jq-wasm 3.0.0-jq-1.8.2", "url": "https://github.com/jqlang/jq", "licence": "MIT", "retrievedAt": "2026-07-05", "status": "ok" } ], "limitations": [ "No $ENV, input_filename, module loading, or filesystem access.", "The 2 s wall budget is measured, not pre-emptive; a pathological filter can run longer." ] } ``` ### POST /api/v1/compute-tools/jq-outputs $0.03 USDC. Run up to 100 jq filter cases against real jq 1.8.2, compare each result with an expected value, and return an RFC 6902 patch for every mismatch. Keywords: when grading filter conformance, cases, expected, matches, diff, jq 1.8.2, Batch-grade jq filters, jq outputs Inputs: cases Docs: https://www.brainiac.software/api/compute-tools/jq-outputs Example request: ```json { "cases": [ { "id": "sku", "filter": ".items[] | select(.qty > 1) | .sku", "input": { "items": [ { "sku": "A-1", "qty": 2 }, { "sku": "B-2", "qty": 1 } ] }, "expected": "A-1" } ] } ``` Example response: ```json { "status": "complete", "jqVersion": "1.8.2", "cases": [ { "id": "sku", "status": "complete", "stdout": "\"A-1\"", "outputs": [ "A-1" ], "exitCode": 0, "error": null, "elapsedMs": 4, "truncated": false, "overdue": false, "matches": true } ], "summary": { "total": 1, "passed": 1, "failed": 0, "errored": 0 }, "sources": [ { "source": "jq 1.8.2 via jq-wasm 3.0.0-jq-1.8.2", "url": "https://github.com/jqlang/jq", "licence": "MIT", "retrievedAt": "2026-07-05", "status": "ok" } ], "limitations": [ "No $ENV, input_filename, module loading, or filesystem access.", "The 2 s wall budget is measured, not pre-emptive; a pathological filter can run longer." ] } ``` ### POST /api/v1/compute-tools/cube-solution $0.03 USDC. Solve a Rubik's Cube from 54 facelets or a WCA face-turn scramble with the Kociemba two-phase algorithm. Keywords: when testing a solver or grading scramble solutions, facelets, scramble, maxLength, Kociemba, HTM, verified, Solve a Rubik's Cube, cube solution Inputs: facelets?, scramble?, maxLength? Docs: https://www.brainiac.software/api/compute-tools/cube-solution Example request: ```json { "scramble": "R U R' U' F2" } ``` Example response: ```json { "status": "complete", "solution": "F2 U R U' R U2 D2 R2 L2 U2 D2 L2", "moves": 12, "verified": true, "startFacelets": "UULUUFRDDLRULRRLRRFFFUFFDFFFUUDDDDDDBLULLBLLRBRRBBBBBB", "metric": "HTM", "errors": [], "sources": [ { "source": "cubejs 1.3.2 (Kociemba two-phase solver)", "url": "https://github.com/ldez/cubejs", "licence": "MIT", "retrievedAt": "2019-04-27", "status": "ok" } ], "limitations": [ "Half-turn metric face-turn solution from the Kociemba two-phase solver.", "Wide, slice, and rotation moves are not accepted in scrambles." ] } ``` ### POST /api/v1/compute-tools/cube-state $0.005 USDC. Validate a 54-facelet Rubik's Cube state or WCA scramble before solving. Keywords: when checking impossible cubes, facelets, scramble, corner twist, edge flip, permutation parity, Validate Rubik's Cube state, cube state Inputs: facelets?, scramble? Docs: https://www.brainiac.software/api/compute-tools/cube-state Example request: ```json { "facelets": "UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB" } ``` Example response: ```json { "status": "complete", "valid": true, "errors": [], "facelets": "UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB", "solved": true, "sources": [ { "source": "cubejs 1.3.2 (Kociemba two-phase solver)", "url": "https://github.com/ldez/cubejs", "licence": "MIT", "retrievedAt": "2019-04-27", "status": "ok" } ], "limitations": [ "Checks piece counts, centre count, corner twist, edge flip, and permutation parity.", "A scramble is applied to a standard solved cube first; wide, slice, and rotation moves are not accepted." ] } ``` ### POST /api/v1/compute-tools/json-diff $0.005 USDC. Compare two JSON values and return an RFC 6902 patch, equality, and operation counts. Keywords: when grading outputs or reviewing payload changes, from, to, arrayMode, RFC 6902, patch, Diff two JSON values, json diff Inputs: from, to, arrayMode? Docs: https://www.brainiac.software/api/compute-tools/json-diff Example request: ```json { "from": { "a": 1, "b": [ 1, 2 ] }, "to": { "a": 2, "b": [ 1, 2, 3 ] } } ``` Example response: ```json { "status": "complete", "equal": false, "patch": [ { "op": "add", "path": "/b/2", "value": 3 }, { "op": "replace", "path": "/a", "value": 2 } ], "stats": { "add": 1, "remove": 0, "replace": 1, "move": 0 }, "sources": [ { "source": "fast-json-patch 3.1.1 (RFC 6902)", "url": "https://github.com/Starcounter-Jack/JSON-Patch", "licence": "MIT", "retrievedAt": "2022-03-24", "status": "ok" } ], "limitations": [ "RFC 6902 patches are computed in-process; move operations are not emitted.", "lcs mode aligns array elements by value and emits remove/add instead of move." ] } ``` ### POST /api/v1/compute-tools/text-diff $0.005 USDC. Produce a unified diff and per-hunk stats for two texts in line, word, or character mode with configurable context lines. Keywords: when comparing grader outputs or source snippets, from, to, mode, context, unified diff, Diff two texts, text diff Inputs: from, to, mode?, context? Docs: https://www.brainiac.software/api/compute-tools/text-diff Example request: ```json { "from": "a\nb\nc\n", "to": "a\nB\nc\n", "mode": "line" } ``` Example response: ```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." ] } ```