{"openapi":"3.1.0","info":{"title":"Kerata API","description":"Kerata: AI-generated code and code-plagiarism detection. Scores are evidence for a person to review, not proof. Authenticate with an API key from Account → API keys, sent as `Authorization: Bearer <your API key>`. Guide with examples: /developers.","version":"3.0"},"paths":{"/api/v1/me":{"get":{"tags":["v1"],"summary":"Who am I (key owner, organization, plan, usage)","operationId":"v1_me_api_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/scan":{"post":{"tags":["v1"],"summary":"Scan pasted code for AI authorship","operationId":"v1_scan_api_v1_scan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scan/upload":{"post":{"tags":["v1"],"summary":"Scan an uploaded source file or .zip","operationId":"v1_scan_upload_api_v1_scan_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_scan_upload_api_v1_scan_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/scan/github":{"post":{"tags":["v1"],"summary":"Scan a public GitHub repository","operationId":"v1_scan_github_api_v1_scan_github_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubScanReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/class-checks":{"post":{"tags":["v1"],"summary":"Start a class check from a submissions export (.zip / PrairieLearn .csv)","operationId":"v1_class_check_api_v1_class_checks_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_class_check_api_v1_class_checks_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"get":{"tags":["v1"],"summary":"Status and result of any job (scan history job or class check)","operationId":"v1_job_api_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/class-checks/{job_id}":{"get":{"tags":["v1"],"summary":"Class check status + ranked student table when done","operationId":"v1_class_get_api_v1_class_checks__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/class-checks/{job_id}/students/{sid}":{"get":{"tags":["v1"],"summary":"Evidence for one student","operationId":"v1_student_api_v1_class_checks__job_id__students__sid__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"sid","in":"path","required":true,"schema":{"type":"string","title":"Sid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/class-checks/{job_id}/pair":{"get":{"tags":["v1"],"summary":"Side-by-side evidence for two students","operationId":"v1_pair_api_v1_class_checks__job_id__pair_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"a","in":"query","required":true,"schema":{"type":"string","title":"A"}},{"name":"b","in":"query","required":true,"schema":{"type":"string","title":"B"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/class-checks/{job_id}/export.csv":{"get":{"tags":["v1"],"summary":"Student table as CSV","operationId":"v1_export_csv_api_v1_class_checks__job_id__export_csv_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/class-checks/{job_id}/export.json":{"get":{"tags":["v1"],"summary":"Full results as JSON","operationId":"v1_export_json_api_v1_class_checks__job_id__export_json_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/results":{"get":{"tags":["v1"],"summary":"List saved scans and class checks (newest first)","operationId":"v1_results_api_v1_results_get","parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"course_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Course Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/results/{job_id}":{"get":{"tags":["v1"],"summary":"One saved result (alias of /jobs/{id})","operationId":"v1_result_api_v1_results__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_v1_class_check_api_v1_class_checks_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"starter":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Starter"},"extra":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Extra"},"assignment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment"},"peer":{"type":"string","title":"Peer","default":"true"},"ai":{"type":"string","title":"Ai","default":"true"},"history":{"type":"string","title":"History","default":"true"},"corpus_past":{"type":"string","title":"Corpus Past","default":"true"},"corpus_github":{"type":"string","title":"Corpus Github","default":"false"},"lang":{"type":"string","title":"Lang","default":"auto"},"course_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Course Id"},"assignment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Id"}},"type":"object","required":["file"],"title":"Body_v1_class_check_api_v1_class_checks_post"},"Body_v1_scan_upload_api_v1_scan_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_v1_scan_upload_api_v1_scan_upload_post"},"GithubScanReq":{"properties":{"url":{"type":"string","maxLength":500,"title":"Url","description":"https://github.com/owner/repo[/tree/ref/subdir] (public repos)."},"history":{"type":"boolean","title":"History","description":"Also analyze commit history (async job).","default":false}},"type":"object","required":["url"],"title":"GithubScanReq"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ScanReq":{"properties":{"code":{"type":"string","maxLength":400000,"title":"Code","description":"Source code to scan (5+ lines)."},"filename":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Filename","description":"Optional name; helps language detection."}},"type":"object","required":["code"],"title":"ScanReq"},"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"}}},"tags":[{"name":"v1","description":"Public REST API. Authenticate with an API key from Account → API keys, sent as `Authorization: Bearer <your API key>`. Guide: /developers."}]}