{"openapi":"3.1.0","info":{"title":"S20 Root Lab GPT Action API","description":"Action API for a custom GPT focused on Samsung Galaxy S20 research, ADB workflows, Magisk/root operations, Android terminal tooling, and eBPF study. The API returns structured guidance and can enqueue authenticated root terminal jobs to the owner's S20 phone agent through the private gateway.","version":"1.0.0"},"servers":[{"url":"https://gpt.xinjiyuan.tech"}],"paths":{"/health":{"get":{"tags":["system"],"summary":"Health","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"parameters":[]}},"/v1/profile":{"get":{"tags":["profile"],"summary":"Profile","operationId":"get_profile","parameters":[],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/playbooks/{topic}":{"get":{"tags":["playbooks"],"summary":"Playbook","operationId":"get_playbook","parameters":[{"name":"topic","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PlaybookTopic"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/triage":{"post":{"tags":["research"],"summary":"Triage","operationId":"triage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/adb/commands":{"post":{"tags":["adb"],"summary":"Adb Commands","operationId":"adb_commands","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdbCommandsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/magisk/module-plan":{"post":{"tags":["magisk"],"summary":"Magisk Module Plan","operationId":"magisk_module_plan","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModulePlanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModulePlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/ebpf/checklist":{"post":{"tags":["ebpf"],"summary":"Ebpf Checklist","operationId":"ebpf_checklist","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EbpfRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EbpfChecklistResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/research-pack":{"post":{"tags":["research"],"summary":"Research Pack","operationId":"research_pack","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchPackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchPackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/phone/exec":{"post":{"tags":["phone"],"summary":"Phone Exec","operationId":"phone_exec","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneExecRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneExecResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/phone/result/{job_id}":{"get":{"tags":["phone"],"summary":"Phone Result","operationId":"phone_result","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneResultResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/phone/stats":{"get":{"tags":["phone"],"summary":"Phone Stats","operationId":"phone_stats","parameters":[],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/phone/file/start":{"post":{"tags":["phone"],"summary":"Phone File Start","operationId":"phone_file_start","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneFileStartRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneFileStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/phone/file/chunk":{"post":{"tags":["phone"],"summary":"Phone File Chunk","operationId":"phone_file_chunk","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneFileChunkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneFileChunkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/phone/file/finish":{"post":{"tags":["phone"],"summary":"Phone File Finish","operationId":"phone_file_finish","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneFileFinishRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneFileFinishResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}}},"components":{"schemas":{"AdbCommandsResponse":{"properties":{"task":{"type":"string","title":"Task"},"commands":{"items":{"type":"string"},"type":"array","title":"Commands"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["task","commands","notes"],"title":"AdbCommandsResponse"},"CommandBlockResponse":{"properties":{"title":{"type":"string","title":"Title"},"commands":{"items":{"type":"string"},"type":"array","title":"Commands"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["title","commands"],"title":"CommandBlockResponse"},"CommandRequest":{"properties":{"task":{"type":"string","title":"Task","description":"ADB or terminal task, for example logcat, bugreport, packages, props."},"package_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Package Name","description":"Optional Android package name."},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Path","description":"Optional path on device or host."},"include_root":{"type":"boolean","title":"Include Root","description":"Include su/root command variants when useful.","default":true}},"type":"object","required":["task"],"title":"CommandRequest"},"DeviceState":{"properties":{"model":{"type":"string","title":"Model","description":"Device model or codename.","default":"Samsung Galaxy S20"},"android_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Android Version","description":"Android version if known."},"kernel_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kernel Version","description":"Kernel version from uname -a if known."},"root":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Root","description":"Whether root is available.","default":true},"magisk":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Magisk","description":"Whether Magisk is installed.","default":true},"adb":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Adb","description":"Whether adb access is available.","default":true},"termux_or_terminal":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Termux Or Terminal","description":"Whether a terminal app is available.","default":true},"ebpf_interest":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ebpf Interest","description":"Whether eBPF is relevant to the task.","default":true},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Any extra device facts."}},"type":"object","title":"DeviceState"},"EbpfChecklistResponse":{"properties":{"goal":{"type":"string","title":"Goal"},"kernel_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kernel Version"},"feasibility_checks":{"items":{"type":"string"},"type":"array","title":"Feasibility Checks"},"commands":{"items":{"type":"string"},"type":"array","title":"Commands"},"failure_modes":{"items":{"type":"string"},"type":"array","title":"Failure Modes"}},"type":"object","required":["goal","feasibility_checks","commands","failure_modes"],"title":"EbpfChecklistResponse"},"EbpfRequest":{"properties":{"kernel_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kernel Version"},"goal":{"type":"string","title":"Goal","description":"eBPF tracing or inspection goal."},"available_tools":{"items":{"type":"string"},"type":"array","title":"Available Tools"}},"type":"object","required":["goal"],"title":"EbpfRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"service":{"type":"string","title":"Service"},"time":{"type":"integer","title":"Time"}},"type":"object","required":["ok","service","time"],"title":"HealthResponse"},"ModulePlanRequest":{"properties":{"goal":{"type":"string","title":"Goal","description":"Magisk module or root-level modification goal."},"target_paths":{"items":{"type":"string"},"type":"array","title":"Target Paths"},"needs_sepolicy":{"type":"boolean","title":"Needs Sepolicy","default":false},"reversible":{"type":"boolean","title":"Reversible","default":true}},"type":"object","required":["goal"],"title":"ModulePlanRequest"},"ModulePlanResponse":{"properties":{"goal":{"type":"string","title":"Goal"},"module_id":{"type":"string","title":"Module Id"},"layout":{"items":{"type":"string"},"type":"array","title":"Layout"},"guardrails":{"items":{"type":"string"},"type":"array","title":"Guardrails"},"commands":{"items":{"type":"string"},"type":"array","title":"Commands"}},"type":"object","required":["goal","module_id","layout","guardrails","commands"],"title":"ModulePlanResponse"},"PhoneExecRequest":{"properties":{"cmd_type":{"type":"string","enum":["shell","probe","app","file","note"],"title":"Cmd Type","default":"shell"},"payload":{"type":"string","title":"Payload","description":"Phone-side lab command or task payload."},"args":{"items":{"type":"string"},"type":"array","title":"Args"},"timeout":{"type":"integer","maximum":3600.0,"minimum":1.0,"title":"Timeout","default":60}},"type":"object","required":["payload"],"title":"PhoneExecRequest"},"PhoneExecResponse":{"properties":{"status":{"type":"string","title":"Status"},"job_id":{"type":"string","title":"Job Id"},"queue_depth":{"type":"integer","title":"Queue Depth"}},"type":"object","required":["status","job_id","queue_depth"],"title":"PhoneExecResponse"},"PhoneFileChunkRequest":{"properties":{"file_id":{"type":"string","title":"File Id"},"index":{"type":"integer","minimum":0.0,"title":"Index"},"data_b64":{"type":"string","title":"Data B64"}},"type":"object","required":["file_id","index","data_b64"],"title":"PhoneFileChunkRequest"},"PhoneFileChunkResponse":{"properties":{"status":{"type":"string","title":"Status"},"file_id":{"type":"string","title":"File Id"},"index":{"type":"integer","title":"Index"},"bytes":{"type":"integer","title":"Bytes"}},"type":"object","required":["status","file_id","index","bytes"],"title":"PhoneFileChunkResponse"},"PhoneFileFinishRequest":{"properties":{"file_id":{"type":"string","title":"File Id"}},"type":"object","required":["file_id"],"title":"PhoneFileFinishRequest"},"PhoneFileFinishResponse":{"properties":{"status":{"type":"string","title":"Status"},"file_id":{"type":"string","title":"File Id"},"size":{"type":"integer","title":"Size"},"sha256":{"type":"string","title":"Sha256"},"download_url":{"type":"string","title":"Download Url"},"target_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Path"},"mode":{"type":"string","title":"Mode"}},"type":"object","required":["status","file_id","size","sha256","download_url","mode"],"title":"PhoneFileFinishResponse"},"PhoneFileStartRequest":{"properties":{"filename":{"type":"string","title":"Filename","default":"payload.bin"},"total_size":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Total Size"},"sha256":{"anyOf":[{"type":"string","maxLength":64,"minLength":64},{"type":"null"}],"title":"Sha256"},"target_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Path"},"mode":{"type":"string","title":"Mode","default":"0600"}},"type":"object","title":"PhoneFileStartRequest"},"PhoneFileStartResponse":{"properties":{"status":{"type":"string","title":"Status"},"file_id":{"type":"string","title":"File Id"},"chunk_size_hint":{"type":"integer","title":"Chunk Size Hint"}},"type":"object","required":["status","file_id","chunk_size_hint"],"title":"PhoneFileStartResponse"},"PhoneResultResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"stdout":{"type":"string","title":"Stdout","default":""},"stderr":{"type":"string","title":"Stderr","default":""},"finished_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Finished At"}},"type":"object","required":["job_id","status"],"title":"PhoneResultResponse"},"PhoneStatsResponse":{"properties":{"exec_count":{"type":"integer","title":"Exec Count"},"pull_count":{"type":"integer","title":"Pull Count"},"result_count":{"type":"integer","title":"Result Count"},"queue_depth":{"type":"integer","title":"Queue Depth"},"stored_results":{"type":"integer","title":"Stored Results"},"uptime":{"type":"number","title":"Uptime"}},"type":"object","required":["exec_count","pull_count","result_count","queue_depth","stored_results","uptime"],"title":"PhoneStatsResponse"},"PlaybookResponse":{"properties":{"topic":{"type":"string","title":"Topic"},"goal":{"type":"string","title":"Goal"},"steps":{"items":{"type":"string"},"type":"array","title":"Steps"},"commands":{"items":{"type":"string"},"type":"array","title":"Commands"}},"type":"object","required":["topic","goal","steps","commands"],"title":"PlaybookResponse"},"PlaybookTopic":{"type":"string","enum":["s20-root-baseline","adb","magisk","hook-frameworks","reverse-engineering","app-framework","keepalive","soft-reboot","ebpf","terminal","recovery"],"title":"PlaybookTopic"},"ProfileResponse":{"properties":{"name":{"type":"string","title":"Name"},"mission":{"type":"string","title":"Mission"},"boundaries":{"items":{"type":"string"},"type":"array","title":"Boundaries"},"strengths":{"items":{"type":"string"},"type":"array","title":"Strengths"}},"type":"object","required":["name","mission","boundaries","strengths"],"title":"ProfileResponse"},"ResearchPackRequest":{"properties":{"topic":{"type":"string","title":"Topic","description":"Research topic for the S20 lab."},"depth":{"type":"string","enum":["quick","normal","max"],"title":"Depth","default":"normal"},"include_commands":{"type":"boolean","title":"Include Commands","default":true},"include_failure_modes":{"type":"boolean","title":"Include Failure Modes","default":true}},"type":"object","required":["topic"],"title":"ResearchPackRequest"},"ResearchPackResponse":{"properties":{"topic":{"type":"string","title":"Topic"},"depth":{"type":"string","title":"Depth"},"pack":{"additionalProperties":{"$ref":"#/components/schemas/PlaybookResponse"},"type":"object","title":"Pack","properties":{}},"action_policy":{"type":"string","title":"Action Policy"}},"type":"object","required":["topic","depth","pack","action_policy"],"title":"ResearchPackResponse"},"TriageRequest":{"properties":{"objective":{"type":"string","title":"Objective","description":"What the user wants to investigate or accomplish."},"device":{"$ref":"#/components/schemas/DeviceState"},"risk_tolerance":{"type":"string","enum":["low","medium","high"],"title":"Risk Tolerance","default":"medium"},"output_style":{"type":"string","enum":["checklist","commands","deep-dive"],"title":"Output Style","default":"checklist"}},"type":"object","required":["objective"],"title":"TriageRequest"},"TriageResponse":{"properties":{"objective":{"type":"string","title":"Objective"},"device":{"$ref":"#/components/schemas/DeviceState"},"risk_tolerance":{"type":"string","title":"Risk Tolerance"},"assessment":{"type":"string","title":"Assessment"},"checks":{"items":{"type":"string"},"type":"array","title":"Checks"},"commands":{"items":{"$ref":"#/components/schemas/CommandBlockResponse"},"type":"array","title":"Commands"},"next_questions":{"items":{"type":"string"},"type":"array","title":"Next Questions"}},"type":"object","required":["objective","device","risk_tolerance","assessment","checks","commands","next_questions"],"title":"TriageResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}