{"openapi":"3.1.0","info":{"title":"SafeAgent","description":"Execution Guard for AI Agents — exactly-once claim before execute.","version":"0.1.0"},"paths":{"/.well-known/ai-plugin.json":{"get":{"summary":"Ai Plugin","operationId":"ai_plugin__well_known_ai_plugin_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Ai Plugin  Well Known Ai Plugin Json Get"}}}}}}},"/.well-known/safeagent.json":{"get":{"summary":"Safeagent Discovery","operationId":"safeagent_discovery__well_known_safeagent_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Safeagent Discovery  Well Known Safeagent Json Get"}}}}}}},"/robots.txt":{"get":{"summary":"Robots Txt","operationId":"robots_txt_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/llms.txt":{"get":{"summary":"Llms Txt","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/.well-known/agent.json":{"get":{"summary":"Agent Json","operationId":"agent_json__well_known_agent_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/mcp.json":{"get":{"summary":"Mcp Json","operationId":"mcp_json__well_known_mcp_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/favicon.ico":{"get":{"summary":"Favicon","operationId":"favicon_favicon_ico_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"summary":"Landing","operationId":"landing__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"head":{"summary":"Landing","operationId":"landing__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/audit-service":{"get":{"summary":"Audit Service","operationId":"audit_service_audit_service_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"head":{"summary":"Audit Service","operationId":"audit_service_audit_service_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"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"}}}}}}},"/.well-known/x402":{"get":{"summary":"Well Known X402","operationId":"well_known_x402__well_known_x402_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Well Known X402  Well Known X402 Get"}}}}}}},"/claim":{"post":{"summary":"Claim","description":"Two-phase exactly-once claim.\n\n``{\"status\": \"PROCEED\"}``  — new claim; execute your action, then POST /settle/{request_id}.\n``{\"status\": \"SKIP\", \"existing\": {...}}`` — already COMMITTED; reuse the stored result.\n``{\"status\": \"PENDING\"}`` — another caller has this in-flight; retry after the TTL.\n\nRequires x402 payment when SAFEAGENT_PAYMENT_ADDRESS is set.","operationId":"claim_claim_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ClaimRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Claim Claim Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/claim/test":{"post":{"summary":"Claim Test","description":"Free test claim — same logic as POST /claim but no x402 payment required.\n\nRate-limited to 10 calls per IP address total. After the limit is reached,\nuse POST /claim with an x402 payment header for production access.","operationId":"claim_test_claim_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestClaimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Claim Test Claim Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/settle/{request_id}":{"post":{"summary":"Settle","description":"Transition PENDING → COMMITTED with the execution result. Not payment-gated.","operationId":"settle_settle__request_id__post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Settle Settle  Request Id  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/audit":{"get":{"summary":"Audit","description":"Claim history, optionally filtered. Results ordered newest-first. Not payment-gated.","operationId":"audit_audit_get","parameters":[{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by agent EVM wallet address","title":"Agent Id"},"description":"Filter by agent EVM wallet address"},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by action name","title":"Action"},"description":"Filter by action name"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: PENDING or COMMITTED","title":"Status"},"description":"Filter by status: PENDING or COMMITTED"},{"name":"from_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Include rows with claimed_at >= this Unix timestamp","title":"From Ts"},"description":"Include rows with claimed_at >= this Unix timestamp"},{"name":"to_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Include rows with claimed_at <= this Unix timestamp","title":"To Ts"},"description":"Include rows with claimed_at <= this Unix timestamp"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Page size","default":100,"title":"Limit"},"description":"Page size"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset","default":0,"title":"Offset"},"description":"Pagination offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Audit Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sweep":{"post":{"summary":"Sweep","description":"Reset stale PENDING rows to CLAIMABLE. Not payment-gated.","operationId":"sweep_sweep_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Sweep Sweep Post"}}}}}}}},"components":{"schemas":{"ClaimRequest":{"properties":{"request_id":{"type":"string","title":"Request Id"},"action":{"type":"string","title":"Action"}},"type":"object","required":["request_id","action"],"title":"ClaimRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SettleRequest":{"properties":{"result":{"additionalProperties":true,"type":"object","title":"Result"}},"type":"object","required":["result"],"title":"SettleRequest"},"TestClaimRequest":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"action_type":{"type":"string","title":"Action Type"},"scope":{"type":"string","title":"Scope"}},"type":"object","required":["agent_id","action_type","scope"],"title":"TestClaimRequest"},"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"}}}}