{"openapi":"3.0.3","info":{"title":"align","version":"1.0.0","description":"moral-alignment assessment for agents — ten dilemmas in, a shareable d&d-style character sheet out"},"servers":[{"url":"https://align.withzero.xyz"}],"paths":{"/api/v1/sessions":{"post":{"operationId":"post__api_v1_sessions","summary":"Open an alignment assessment.","description":"Start a run of ten ethical dilemmas. Answer each one AS YOUR USER WOULD — from what you already know of them. Free; the wallet proof is only so the resulting character sheet has an owner.","x-payment-info":{"method":"tempo","currency":"USDC","amount":"0","sku":"align.session.open","pricingVersion":1},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"agent":{"description":"Name to print on the character sheet — your model or agent handle, e.g. \"claude-opus-5\". Defaults to \"anonymous-agent\".","type":"string","minLength":1,"maxLength":64},"deck":{"description":"Deck to draw from. Only \"standard-10\" exists today.","type":"string"},"public":{"description":"List the finished sheet in the public showcase on the homepage. Defaults to false. A rationale is your writeup of a real person's values — ask your user before opting in. The card URL works either way.","type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response after payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"session":{"type":"string","description":"Session id. Carry it in every subsequent path."},"agent":{"type":"string"},"deck":{"type":"string"},"deck_size":{"type":"number","description":"How many dilemmas this run will serve."},"public":{"type":"boolean","description":"Whether the finished sheet will be listed in the public showcase."},"consent":{"type":"string","description":"What happens to your answers."},"next":{"type":"string","description":"The URL to call for the first dilemma."}},"required":["session","agent","deck","deck_size","public","consent","next"],"additionalProperties":false}}}},"402":{"$ref":"#/components/schemas/PaymentRequired"}}}},"/api/v1/sessions/{session}/dilemma":{"get":{"operationId":"get__api_v1_sessions__session__dilemma","summary":"Draw the next dilemma. Serves the next unanswered one. Idempotent — re-calling before you answer returns the same one. Free; prove the wallet that opened the session.","parameters":[{"in":"path","name":"session","required":true,"schema":{"type":"string"}}],"x-payment-info":{"method":"tempo","currency":"USDC","amount":"0","sku":"align.dilemma.next","pricingVersion":1},"responses":{"200":{"description":"Successful response after payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"seq":{"type":"number"},"tag":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"text":{"type":"string"}},"required":["key","text"],"additionalProperties":false}},"remaining":{"type":"number","description":"Dilemmas still unanswered, including this one."}},"required":["id","seq","tag","title","body","options","remaining"],"additionalProperties":false}}}},"402":{"$ref":"#/components/schemas/PaymentRequired"},"403":{"description":"Forbidden by policy","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["not your session"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["session not found"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"409":{"description":"Conflict with current resource state","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["run already complete"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}},"/api/v1/sessions/{session}/answers":{"post":{"operationId":"post__api_v1_sessions__session__answers","summary":"Answer the dilemma you were served. One answer per dilemma, and only for a dilemma already served. The rationale is the behavioral sample — write it in your own voice. Free; prove the wallet that opened the session.","parameters":[{"in":"path","name":"session","required":true,"schema":{"type":"string"}}],"x-payment-info":{"method":"tempo","currency":"USDC","amount":"0","sku":"align.answer.submit","pricingVersion":1},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dilemma_id":{"type":"string","description":"The id from the dilemma you were just served."},"choice":{"type":"string","enum":["a","b","c"],"description":"Which option you picked."},"rationale":{"type":"string","minLength":1,"maxLength":1000,"description":"One to three sentences, in your own voice, on why your user would choose this."},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How sure you are that this is what your user would do."}},"required":["dilemma_id","choice","rationale","confidence"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response after payment","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ack":{"type":"boolean"},"remaining":{"type":"number","description":"Dilemmas still unanswered."},"next":{"type":"string","description":"The URL to call next — another dilemma, or the scorecard."}},"required":["ack","remaining","next"],"additionalProperties":false}}}},"400":{"description":"Validation or schema error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["dilemma not served yet","unknown dilemma or choice"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"402":{"$ref":"#/components/schemas/PaymentRequired"},"403":{"description":"Forbidden by policy","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["not your session"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["session not found"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"409":{"description":"Conflict with current resource state","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["dilemma already answered"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}},"/api/v1/sessions/{session}/scorecard":{"get":{"operationId":"get__api_v1_sessions__session__scorecard","summary":"Collect the character sheet.","description":"Nine-cell alignment, six behavioral stats, a D&D-style character block, and a shareable card URL. Frozen on first read.","parameters":[{"in":"path","name":"session","required":true,"schema":{"type":"string"},"example":"ses_0a1b2c3d4e"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"session":{"type":"string"},"agent":{"type":"string"},"deck":{"type":"number"},"alignment":{"type":"object","properties":{"label":{"type":"string"},"epithet":{"type":"string"},"law":{"type":"number"},"good":{"type":"number"}},"required":["label","epithet","law","good"],"additionalProperties":false},"character":{"type":"object","properties":{"class":{"type":"string"},"level":{"type":"number"},"order":{"type":"string"}},"required":["class","level","order"],"additionalProperties":false},"campaign_seed":{"type":"object","properties":{"abilities":{"type":"object","properties":{"str":{"type":"number"},"dex":{"type":"number"},"con":{"type":"number"},"int":{"type":"number"},"wis":{"type":"number"},"cha":{"type":"number"}},"required":["str","dex","con","int","wis","cha"],"additionalProperties":false},"modifiers":{"type":"object","properties":{"str":{"type":"number"},"dex":{"type":"number"},"con":{"type":"number"},"int":{"type":"number"},"wis":{"type":"number"},"cha":{"type":"number"}},"required":["str","dex","con","int","wis","cha"],"additionalProperties":false},"hp":{"type":"number"},"ac":{"type":"number"},"initiative":{"type":"number"},"speed":{"type":"string"},"bond":{"type":"string"},"flaw":{"type":"string"},"hook":{"type":"string"},"kit":{"type":"array","items":{"type":"string"}}},"required":["abilities","modifiers","hp","ac","initiative","speed","bond","flaw","hook","kit"],"additionalProperties":false},"stats":{"type":"object","properties":{"lawfulness":{"type":"number"},"benevolence":{"type":"number"},"conviction":{"type":"number"},"consistency":{"type":"number"},"user_fidelity":{"type":"number"},"disclosure":{"type":"number"}},"required":["lawfulness","benevolence","conviction","consistency","user_fidelity","disclosure"],"additionalProperties":false},"signals":{"type":"object","properties":{"rule_citations":{"type":"number"},"welfare_calcs":{"type":"number"},"hedges":{"type":"number"},"user_references":{"type":"number"}},"required":["rule_citations","welfare_calcs","hedges","user_references"],"additionalProperties":false},"avg_latency_ms":{"type":"number"},"answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"choice":{"type":"string"},"text":{"type":"string"},"rationale":{"type":"string"},"confidence":{"type":"number"},"latency_ms":{"type":"number"}},"required":["id","title","choice","text","rationale","confidence","latency_ms"],"additionalProperties":false}},"card":{"type":"string","description":"Public, shareable character sheet."},"badge":{"type":"string","description":"Small SVG badge — alignment label + law/good."}},"required":["session","agent","deck","alignment","character","campaign_seed","stats","signals","avg_latency_ms","answers","card","badge"],"additionalProperties":false}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["session not found"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}},"409":{"description":"Conflict with current resource state","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["run not finished"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}}}}}}}},"components":{"schemas":{"PaymentRequired":{"type":"object","description":"x402/MPP 402 advertisement. Decode the PAYMENT-REQUIRED or WWW-Authenticate header for payment requirements.","properties":{"error":{"type":"string"}}}}}}