{"openapi":"3.1.0","info":{"title":"SelfAPI","summary":"Future Self / Higher Self API prototype","description":"A deterministic prototype for values-aligned decisions, nudges, reflections, and safe derived-memory suggestions. No external LLMs, secrets, persistence, or authentication are used in this skeleton.","version":"0.2.0"},"paths":{"/health":{"get":{"tags":["system"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/v1/agent-card":{"get":{"tags":["agent"],"summary":"Agent Card","operationId":"agent_card_v1_agent_card_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCard"}}}}}}},"/v1/decision":{"post":{"tags":["consult"],"summary":"Decision","operationId":"decision_v1_decision_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/nudge":{"post":{"tags":["consult"],"summary":"Nudge","operationId":"nudge_v1_nudge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reflection":{"post":{"tags":["consult"],"summary":"Reflection","operationId":"reflection_v1_reflection_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReflectionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReflectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/memory/update":{"post":{"tags":["memory"],"summary":"Memory Update","operationId":"memory_update_v1_memory_update_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgentCard":{"properties":{"schema_version":{"type":"string","title":"Schema Version","default":"2026-06-04"},"name":{"type":"string","title":"Name","default":"SelfAPI"},"description":{"type":"string","title":"Description","default":"FutureSelf/HigherSelf reflection API prototype for values-aligned decisions."},"status":{"type":"string","title":"Status","default":"prototype"},"auth":{"additionalProperties":true,"type":"object","title":"Auth"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"endpoints":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Endpoints"}},"type":"object","required":["endpoints"],"title":"AgentCard"},"DecisionRequest":{"properties":{"prompt":{"type":"string","minLength":1,"title":"Prompt","examples":["Should I publish my essay today?"]},"options":{"items":{"type":"string"},"type":"array","title":"Options","examples":[["Publish now","Keep editing"]]},"values":{"items":{"type":"string"},"type":"array","title":"Values","examples":[["courage","honesty","creative momentum"]]},"persona":{"type":"string","enum":["FutureSelf","HigherSelf","CreativeCoach"],"title":"Persona","default":"HigherSelf"},"context":{"additionalProperties":true,"type":"object","title":"Context"}},"type":"object","required":["prompt"],"title":"DecisionRequest"},"DecisionResponse":{"properties":{"decision_id":{"type":"string","title":"Decision Id"},"persona":{"type":"string","title":"Persona"},"recommendation":{"type":"string","title":"Recommendation"},"reasoning":{"items":{"type":"string"},"type":"array","title":"Reasoning"},"scores":{"items":{"$ref":"#/components/schemas/OptionScore"},"type":"array","title":"Scores"},"next_action":{"type":"string","title":"Next Action"},"follow_up_question":{"type":"string","title":"Follow Up Question"},"safety":{"$ref":"#/components/schemas/Safety"}},"type":"object","required":["decision_id","persona","recommendation","reasoning","scores","next_action","follow_up_question","safety"],"title":"DecisionResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MemoryCandidate":{"properties":{"type":{"type":"string","enum":["goal","value","fear","pattern","preference","win","boundary"],"title":"Type"},"text":{"type":"string","minLength":1,"title":"Text"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","default":0.6}},"type":"object","required":["type","text"],"title":"MemoryCandidate"},"MemoryUpdateRequest":{"properties":{"source":{"type":"string","title":"Source","default":"manual"},"memories":{"items":{"$ref":"#/components/schemas/MemoryCandidate"},"type":"array","minItems":1,"title":"Memories"},"require_user_approval":{"type":"boolean","title":"Require User Approval","default":true}},"type":"object","required":["memories"],"title":"MemoryUpdateRequest"},"MemoryUpdateResponse":{"properties":{"update_id":{"type":"string","title":"Update Id"},"accepted_count":{"type":"integer","title":"Accepted Count"},"memory_ids":{"items":{"type":"string"},"type":"array","title":"Memory Ids"},"requires_user_approval":{"type":"boolean","title":"Requires User Approval"},"note":{"type":"string","title":"Note"},"safety":{"$ref":"#/components/schemas/Safety"}},"type":"object","required":["update_id","accepted_count","memory_ids","requires_user_approval","note","safety"],"title":"MemoryUpdateResponse"},"NudgeRequest":{"properties":{"goal":{"type":"string","minLength":1,"title":"Goal","examples":["Send the proposal"]},"blocker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blocker","examples":["I am worried it is not good enough"]},"tone":{"type":"string","enum":["kind_direct","gentle","bold"],"title":"Tone","default":"kind_direct"},"timebox_minutes":{"type":"integer","maximum":120.0,"minimum":1.0,"title":"Timebox Minutes","default":15},"persona":{"type":"string","enum":["FutureSelf","HigherSelf","CreativeCoach"],"title":"Persona","default":"FutureSelf"}},"type":"object","required":["goal"],"title":"NudgeRequest"},"NudgeResponse":{"properties":{"nudge_id":{"type":"string","title":"Nudge Id"},"message":{"type":"string","title":"Message"},"action":{"type":"string","title":"Action"},"implementation_intention":{"type":"string","title":"Implementation Intention"},"commitment_prompt":{"type":"string","title":"Commitment Prompt"},"safety":{"$ref":"#/components/schemas/Safety"}},"type":"object","required":["nudge_id","message","action","implementation_intention","commitment_prompt","safety"],"title":"NudgeResponse"},"OptionScore":{"properties":{"option":{"type":"string","title":"Option"},"value_alignment_score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Value Alignment Score"},"rationale":{"type":"string","title":"Rationale"}},"type":"object","required":["option","value_alignment_score","rationale"],"title":"OptionScore"},"ReflectionRequest":{"properties":{"prompt":{"type":"string","minLength":1,"title":"Prompt","examples":["I keep delaying the work I care about."]},"mode":{"type":"string","enum":["courage","creative_unblock","self_sabotage","reflection"],"title":"Mode","default":"reflection"},"persona":{"type":"string","enum":["FutureSelf","HigherSelf","CreativeCoach"],"title":"Persona","default":"HigherSelf"}},"type":"object","required":["prompt"],"title":"ReflectionRequest"},"ReflectionResponse":{"properties":{"reflection_id":{"type":"string","title":"Reflection Id"},"persona":{"type":"string","title":"Persona"},"mirror":{"type":"string","title":"Mirror"},"reframe":{"type":"string","title":"Reframe"},"questions":{"items":{"type":"string"},"type":"array","title":"Questions"},"commitment_prompt":{"type":"string","title":"Commitment Prompt"},"safety":{"$ref":"#/components/schemas/Safety"}},"type":"object","required":["reflection_id","persona","mirror","reframe","questions","commitment_prompt","safety"],"title":"ReflectionResponse"},"Safety":{"properties":{"risk_level":{"type":"string","enum":["low","attention","crisis_boundary"],"title":"Risk Level","default":"low"},"disclaimer":{"type":"string","title":"Disclaimer","default":"SelfAPI returns a deterministic simulation for reflection and planning; it is not therapy, diagnosis, legal, medical, financial advice, or a prediction."},"boundaries_applied":{"items":{"type":"string"},"type":"array","title":"Boundaries Applied"}},"type":"object","title":"Safety"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}