s2ar

score

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

Score a text against a poetic form (sonnet, haiku, villanelle, limerick, …; GET /v1/score/forms lists them, free, with the acceptance policy) or an inline spec, with programmatic verifiers: meter from a pronouncing dictionary named by version in every answer, rhyme, line and syllable counts. The verdict is gated (an exact line count for fixed forms, a content floor, no credit for identical end words, a floor under every dimension) and every gate names its evidence; the same text gets the same answer every time, and the answer is a signed Assay record anyone can verify free; the text is never kept.

Call it

curl 'https://api.s2ar.dev/v1/score?text=An+old+silent+pond%0AA+frog+jumps+into+the+pond%0ASplash%21+Silence+again&form=haiku'
curl -X POST https://api.s2ar.dev/v1/score \
  -H 'content-type: application/json' \
  -d '{"text": "An old silent pond\nA frog jumps into the pond\nSplash! Silence again", "form": "haiku"}'

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/score; 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 score_text at https://api.s2ar.dev/mcp.

Parameters

parametertyperequiredwhat
textstringyes
formstringa form name; GET /v1/score/forms lists them
specobjectan inline form spec instead of a name (POST only)

The answer

{
 "ok": true,
 "form": "haiku",
 "accepted": true,
 "accepted_v1": true,
 "composite": 0.96,
 "policy": "verse/2",
 "scores": {
  "form": 1.0,
  "surface": 1.0
 },
 "gates": [
  {
   "gate": "line_count",
   "ok": true,
   "evidence": {
    "got": 3,
    "want": 3
   }
  }
 ],
 "grader": {
  "policy": "verse/2",
  "verifiers": "prosody-1.0.0",
  "pronouncing": "0.3.0",
  "cmudict": "1.1.3"
 },
 "record_sha256": "5b2e…",
 "charged_usd": 0.005,
 "receipt": {
  "evidence_hash": "sha256:94abfed2…",
  "cost_usd": 0.005,
  "what": "score",
  "determinism": "replayable",
  "witnesses": [
   "verifiers"
  ],
  "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

score a sonnet: the call, its answer and its record, re-derived.

The errors are the same on every route.