POST
/api/v1/compute-tools/cube-solution$0.03 USDCSolve a Rubik's Cube from 54 facelets or a WCA face-turn scramble with the Kociemba two-phase algorithm.
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/cube-solution" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"scramble": "R U R' U' F2"
}
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."
]
}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.