{"openapi":"3.1.0","info":{"title":"FLYLAB Developer API","version":"1.0.0-beta","description":"Run measured visual stimuli through the FlyEM male CNS connectome adapter and retrieve verifiable result packets."},"servers":[{"url":"https://useflybrain.fun/api/v1"}],"paths":{"/brain":{"get":{"summary":"Connectome status and dataset information","responses":{"200":{"description":"Brain adapter state"}}}},"/runs":{"get":{"summary":"List recent verified runs","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Run list"}}}},"/runs/{runId}":{"get":{"summary":"Retrieve one verified run","parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Run packet"},"404":{"description":"Run not found"}}}},"/runs/{runId}/replay.mp4":{"get":{"summary":"Download the deterministic replay video","parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"MP4 replay"}}}},"/challenges":{"post":{"summary":"Run a connectome challenge","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Challenge"}}}},"responses":{"201":{"description":"Verified connectome response"},"202":{"description":"Clearly marked demo fallback"},"429":{"description":"Rate limited"}}}},"/control/pages":{"post":{"summary":"Create a safe read-only snapshot of a public HTTPS page","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Page snapshot"},"400":{"description":"Unsafe or unavailable page"}}}},"/control/steps":{"post":{"summary":"Map live page geometry into a connectome-driven cursor step","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlStep"}}}},"responses":{"200":{"description":"Verified motor response"}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Challenge":{"type":"object","properties":{"mode":{"type":"string","enum":["maze","motion","light-dark","web-navigation"],"default":"maze"},"challenge":{"type":"string","maxLength":300}}},"ControlStep":{"type":"object","required":["sessionId","viewportWidth","viewportHeight","cursorX","cursorY","targetX","targetY","targetWidth","targetHeight"],"properties":{"sessionId":{"type":"string"},"pageSignature":{"type":"string"},"step":{"type":"integer"},"viewportWidth":{"type":"number"},"viewportHeight":{"type":"number"},"cursorX":{"type":"number"},"cursorY":{"type":"number"},"targetX":{"type":"number"},"targetY":{"type":"number"},"targetWidth":{"type":"number"},"targetHeight":{"type":"number"}}}}}}