Spoolis docs
Quickstart
Run one acceptance in the sandbox, read the Outcome, and verify its signed receipt.
1. Mint a sandbox session
Run one request and keep the returned token.
curl -sS -X POST https://spoolis.com/api/sandbox/session > session.jsonExpected checkpoint: session.json contains token, expires_at, and limits.
Keep: token.
2. Run one acceptance
Send the criteria, evidence, and deterministic check in one request.
TOKEN=$(node -p 'require("./session.json").token')
curl -sS -X POST https://spoolis.com/api/v1/verify -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{
"conditions": [{
"description": "Every row includes status",
"deterministic_check": {
"checker": "completeness",
"required_fields": ["status"]
}
}],
"max_amount_cents": 3,
"unit": { "total_units": 3, "unit_amount_cents": 1 },
"evidence": {
"type": "dataset",
"rows": [
{ "id": 1, "status": "complete" },
{ "id": 2, "status": "complete" },
{ "id": 3 }
],
"provenance": "api_response"
}
}' > verify.jsonExpected checkpoint: earned_cents is 2, accepted is 2, and rejected is 1. The one rejected unit includes its verifier reason.
3. Read the Outcome
The response reports accepted, rejected, rejections with reasons, earned_cents, the signed receipt, and its receipt_url.
4. Verify the Outcome
Save the returned receipt, then verify schema spoolis/outcome-receipt@1 with the CLI or @spoolis/receipt-verifier. The CLI automatically selects the demo trust set.
node -e 'const x=require("./verify.json");require("node:fs").writeFileSync("outcome-receipt.json",JSON.stringify(x.receipt,null,2)+"
")'
npx -y @spoolis/cli verify outcome-receipt.jsonExpected checkpoint: the CLI reports a valid demo receipt. The Outcome still reports earned_cents as 2 and accepted as 2.
Move to production
Production verification is self-serve. The same call you just made works against your account:
- Create an account, then mint a production API key at /dashboard/api-keys. The
spk_live_key is shown once. - Replace the sandbox bearer token with that key on the same
POST /api/v1/verifycall. Set"settlement": "external"(the default): Spoolis verifies and issues the signed Outcome; your existing payment stack acts on it. - Each account includes 10 verification runs per calendar month before any payment; after that, prepaid usage credits apply.
- Verify production receipts with
environment: 'production'and the published trust set.
Production enablement is a separate, optional step that applies only to managed settlement (Spoolis-coordinated payment). Verification and Outcome issuance never require it.
5. Choose what you want to do next
- Build outcome-priced software.
- Bring your own judge.
- Accept work between two parties.
- Connect workflow and billing consumers.
- Move to the production API or configure wallet authority.
- Run a complete integration from the spoolis-examples repository.
Try your own Spool
Compile a sandbox Spool with no account, then verify it yourself.
Try your own Spool