s2ar

assert

/v1/assert · $0.005 a call · 10 keyless calls a day · paid by x402, credits, mpp

Deterministic assertions over an agent's output: JSON validity and schema (Draft 2020-12), required or banned keys and terms, lengths, guarded regexes, numbers in range, citations present, quoted spans found verbatim in the source as given (its hash is in the record), URLs under allowed domains, the poetry verifiers; or a named rubric (strict-json, api-response, cited-answer, quotes-source, no-hedging; GET /v1/assert/checks lists them). Every check's verdict comes with its evidence (the offset, the count, the missing key), and the answer is a signed Assay record anyone can verify free at /v1/verify/{record_sha256}; the text is never kept.

Call it

curl 'https://api.s2ar.dev/v1/assert?text=%7B%22summary%22%3A+%22The+glob+flag+is+parsed+in+defs.rs%22%2C+%22source_url%22%3A+%22https%3A%2F%2Fgithub.com%2FBurntSushi%2Fripgrep%22%7D&checks=%5B%7B%22check%22%3A%22json_valid%22%7D%2C%7B%22check%22%3A%22required_keys%22%2C%22keys%22%3A%5B%22summary%22%2C%22source_url%22%5D%7D%2C%7B%22check%22%3A%22citations_present%22%2C%22min%22%3A1%7D%5D'
curl -X POST https://api.s2ar.dev/v1/assert \
  -H 'content-type: application/json' \
  -d '{"text": "{\"summary\": \"The glob flag is parsed in defs.rs\", \"source_url\": \"https://github.com/BurntSushi/ripgrep\"}", "checks": [{"check": "json_valid"}, {"check": "required_keys", "keys": ["summary", "source_url"]}, {"check": "citations_present", "min": 1}]}'

With a key: add -H 'Authorization: Bearer $S2AR_KEY'. Over x402, while sales are open: the same call at https://api.s2ar.dev/x402/v1/assert; unpaid, it answers 402 with the accepts[] to sign, then send the payment as PAYMENT-SIGNATURE (or X-PAYMENT). Sales are paused since 2026-10-16, and the mirror answers 410. From an agent: the MCP tool assert_output at https://api.s2ar.dev/mcp.

Parameters

parametertyperequiredwhat
textstringthe output to assert (or `json`, an object)
jsonobjectthe output as a JSON object instead of text (POST only)
checksarraythe checks; on GET, a JSON list in one parameter
rubricstringa named check list; `schema`, `domains` fill its slots
sourcestringthe source for quotes_in_source
schemaobjectfor json_schema / api-response

The answer

{
 "ok": true,
 "passed": 3,
 "checks": 3,
 "verdict": "pass",
 "score": 1.0,
 "results": [
  {
   "check": "json_valid",
   "ok": true,
   "evidence": {
    "type": "dict"
   }
  },
  {
   "check": "required_keys",
   "ok": true,
   "evidence": {
    "missing": []
   }
  },
  {
   "check": "citations_present",
   "ok": true,
   "evidence": {
    "urls": 1,
    "min": 1
   }
  }
 ],
 "record_sha256": "3f1c0d9e…",
 "charged_usd": 0.005,
 "receipt": {
  "evidence_hash": "sha256:94abfed2…",
  "cost_usd": 0.005,
  "what": "assert",
  "determinism": "replayable",
  "witnesses": [
   "checks"
  ],
  "issued_at": "2026-10-10T00:00:00Z",
  "refund_rule": "failed calls are never charged",
  "charter": "https://api.s2ar.dev/charter"
 }
}

Every paid answer carries its receipt; a record's sha256 re-verifies free at /v1/verify/{sha256}. A call that fails is never charged.

A worked example

assert an agents output: the call, its answer and its record, re-derived.

The errors are the same on every route.