{"openapi":"3.1.0","info":{"title":"SN38 ChronoGPT Backend","version":"0.1.0"},"paths":{"/benchmark/{cutoff_year}":{"get":{"summary":"Leak detection benchmark","description":"Returns benchmark items for a given cutoff year. TEE-protected.\n\n- **known=false** (default): Returns post-cutoff items the model should NOT know. Used for leak detection.\n- **known=true**: Returns pre-cutoff items the model SHOULD know. Used to verify the model learned its training data.","operationId":"api_benchmark_benchmark__cutoff_year__get","parameters":[{"name":"cutoff_year","in":"path","required":true,"schema":{"type":"integer","title":"Cutoff Year"}},{"name":"known","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Known"}},{"name":"X-Client-Cert","in":"header","required":false,"schema":{"type":"string","title":"X-Client-Cert"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/submissions/{round_num}":{"get":{"summary":"List submissions","description":"Returns all miner submissions for a given round.","operationId":"api_submissions_submissions__round_num__get","parameters":[{"name":"round_num","in":"path","required":true,"schema":{"type":"integer","title":"Round Num"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/submissions/{round_num}/{uid}":{"get":{"summary":"Get submission by UID","description":"Returns a specific miner's submission for a given round.","operationId":"api_submission_uid_submissions__round_num___uid__get","parameters":[{"name":"round_num","in":"path","required":true,"schema":{"type":"integer","title":"Round Num"}},{"name":"uid","in":"path","required":true,"schema":{"type":"integer","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rounds/current":{"get":{"summary":"Current round","description":"Returns the current round number and the round being evaluated (current - 1).","operationId":"api_current_round_rounds_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/rounds/advance":{"post":{"summary":"Advance round","description":"Advances to the next round. Requires admin API key.","operationId":"api_advance_round_rounds_advance_post","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/quality/questions":{"get":{"summary":"Quality evaluation questions","description":"Returns questions for Stage 2 quality duels. TEE-protected.","operationId":"api_quality_questions_quality_questions_get","parameters":[{"name":"X-Client-Cert","in":"header","required":false,"schema":{"type":"string","title":"X-Client-Cert"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/years":{"get":{"summary":"Evaluation years","description":"Returns the list of all years models are evaluated on (2013–2024).","operationId":"api_years_years_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/config":{"get":{"summary":"Evaluation configuration","description":"Returns the current evaluation parameters.\n\n- **max_parameters**: Maximum number of model parameters allowed\n- **max_model_bytes**: Maximum model file size for pre-download check (float32 = 4 bytes/param)\n- **max_eval_seconds**: Maximum evaluation time per model before timeout\n- **leak_weight**: Weight of leak score in the final score (Stage 1)\n- **quality_weight**: Weight of quality score in the final score (Stage 2)\n- **top_n_for_quality**: Number of top miners from Stage 1 that qualify for Stage 2\n- **min_eval_score**: Minimum average evaluation score across all years to qualify for Stage 2 (more negative = better)\n- **leak_epsilon**: Score threshold — items scoring above this are considered \"known\" by the model\n- **leak_threshold**: Max % of post-cutoff items allowed above epsilon — exceeding this gives the worst score for that year (leak detected)\n- **known_threshold**: Min % of pre-cutoff items required above epsilon — below this gives the worst score for that year (model doesn't know its training data)\n- **emission_pct**: Percentage of emissions allocated to the round winner (rest goes to subnet owner)","operationId":"api_config_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health check","operationId":"api_health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/models/check-hash":{"post":{"summary":"Check model weight hash","description":"Checks if a model's weight hash was already submitted by another miner. First submitter has priority.","operationId":"check_hash_models_check_hash_post","parameters":[{"name":"X-Client-Cert","in":"header","required":false,"schema":{"type":"string","title":"X-Client-Cert"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HashCheck"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/detail":{"post":{"summary":"Submit single year evaluation result","description":"Validators submit per-year results as they evaluate. TEE-protected.","operationId":"submit_eval_detail_eval_detail_post","parameters":[{"name":"X-Client-Cert","in":"header","required":false,"schema":{"type":"string","title":"X-Client-Cert"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalDetailSubmission"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/results":{"post":{"summary":"Submit evaluation results","description":"Validators submit full round results. TEE-protected.","operationId":"submit_eval_eval_results_post","parameters":[{"name":"X-Client-Cert","in":"header","required":false,"schema":{"type":"string","title":"X-Client-Cert"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalSubmission"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/results/{round_num}":{"get":{"summary":"Get evaluation results","description":"Returns public evaluation results for a past round. Shows qualified miners, duel wins, winner, and emission weights. Current and future rounds return 403.","operationId":"get_eval_results_eval_results__round_num__get","parameters":[{"name":"round_num","in":"path","required":true,"schema":{"type":"integer","title":"Round Num"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EvalResultResponse"},"title":"Response Get Eval Results Eval Results  Round Num  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"EvalDetailSubmission":{"properties":{"round":{"type":"integer","title":"Round"},"uid":{"type":"integer","title":"Uid"},"year":{"type":"integer","title":"Year"},"repo_id":{"type":"string","title":"Repo Id"},"passed":{"type":"boolean","title":"Passed"},"score":{"type":"number","title":"Score"},"score_unknown":{"type":"number","title":"Score Unknown"},"score_known":{"type":"number","title":"Score Known"}},"type":"object","required":["round","uid","year","repo_id","passed","score","score_unknown","score_known"],"title":"EvalDetailSubmission"},"EvalResultResponse":{"properties":{"validator_hotkey":{"type":"string","title":"Validator Hotkey"},"round":{"type":"integer","title":"Round"},"leak_scores":{"additionalProperties":{"type":"number"},"type":"object","title":"Leak Scores"},"qualified":{"items":{"type":"integer"},"type":"array","title":"Qualified"},"final_scores":{"additionalProperties":{"type":"number"},"type":"object","title":"Final Scores"},"stage2":{"additionalProperties":true,"type":"object","title":"Stage2"},"winner":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Winner"},"weights":{"additionalProperties":true,"type":"object","title":"Weights"}},"type":"object","required":["validator_hotkey","round","leak_scores","qualified","final_scores","stage2","winner","weights"],"title":"EvalResultResponse"},"EvalSubmission":{"properties":{"round":{"type":"integer","title":"Round"},"results":{"additionalProperties":true,"type":"object","title":"Results"}},"type":"object","required":["round","results"],"title":"EvalSubmission","description":"Full evaluation results submitted by a validator.\n\nresults contains all scoring details (stored as JSONB):\n{\n    \"stage1\": {<uid>: {\"eval_score\": float}},\n    \"qualified\": [<uid>, ...],\n    \"stage2\": {<uid>: {\"wins\": int, \"win_rate\": float}},\n    \"final_scores\": {<uid>: float},\n    \"winner\": <uid>,\n    \"weights\": {<uid>: float}\n}"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HashCheck":{"properties":{"weight_hash":{"type":"string","title":"Weight Hash"},"uid":{"type":"integer","title":"Uid"},"snapshot_at":{"type":"string","title":"Snapshot At"}},"type":"object","required":["weight_hash","uid","snapshot_at"],"title":"HashCheck"},"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"}}}}