{"openapi":"3.0.3","info":{"title":"Codex Reset API","version":"1.1.0","description":"Public, read-only reset statistics from LunarWerx. No API key required. Same record as the forecast website. Poll data at most once every 300 seconds; health once every 60 seconds. HEAD and OPTIONS are also supported. This API does not reset an account or redeem credits."},"servers":[{"url":"https://codex.lunarwerx.com"}],"security":[],"externalDocs":{"url":"https://codex.lunarwerx.com/api","description":"API guide and examples"},"paths":{"/api/v1/stats":{"get":{"operationId":"getResetStats","summary":"Lifetime count, last reset, recent counts and gaps","parameters":[],"responses":{"200":{"description":"Current data. All timestamps are UTC; probabilities are fractions from 0 to 1.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"}}}},"400":{"description":"Invalid, unsupported or repeated query parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Degraded health or data unavailable. Retry-After: 60.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/resets":{"get":{"operationId":"listResets","summary":"Full tracked history, newest first","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0}},{"name":"since","in":"query","description":"Exclusive UTC timestamp; use YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.SSSZ.","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Current data. All timestamps are UTC; probabilities are fractions from 0 to 1.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resets"}}}},"400":{"description":"Invalid, unsupported or repeated query parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Degraded health or data unavailable. Retry-After: 60.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/forecast":{"get":{"operationId":"getResetForecast","summary":"Probabilities, uncertainty intervals and historical accuracy","parameters":[],"responses":{"200":{"description":"Current data. All timestamps are UTC; probabilities are fractions from 0 to 1.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forecast"}}}},"400":{"description":"Invalid, unsupported or repeated query parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Degraded health or data unavailable. Retry-After: 60.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/health":{"get":{"operationId":"getResetHealth","summary":"Observer, timeline and cron health; AI configuration and last successful read","parameters":[],"responses":{"200":{"description":"Current data. All timestamps are UTC; probabilities are fractions from 0 to 1.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"400":{"description":"Invalid, unsupported or repeated query parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Degraded health or data unavailable. Retry-After: 60.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Health"},{"$ref":"#/components/schemas/Error"}]}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Stats":{"type":"object","properties":{"apiVersion":{"type":"string","enum":["1"]},"generatedAt":{"type":"string","format":"date-time"},"refreshIntervalSeconds":{"type":"integer","enum":[300]},"recordStartedAt":{"type":"string","format":"date-time","nullable":true},"sources":{"type":"object","properties":{"record":{"type":"string","enum":["live"]},"timeline":{"type":"string"},"openaiStatus":{"type":"string"}},"required":["record","timeline","openaiStatus"]},"totalResets":{"type":"integer","minimum":0},"lastResetAt":{"type":"string","format":"date-time","nullable":true},"hoursSinceLastReset":{"type":"number","minimum":0,"nullable":true},"resetsLast7Days":{"type":"integer","minimum":0},"resetsLast30Days":{"type":"integer","minimum":0},"gaps":{"type":"object","properties":{"meanDays":{"type":"number","minimum":0,"nullable":true},"recentMeanDays":{"type":"number","minimum":0,"nullable":true},"recentMedianDays":{"type":"number","minimum":0,"nullable":true},"longestDays":{"type":"number","minimum":0,"nullable":true}},"required":["meanDays","recentMeanDays","recentMedianDays","longestDays"]},"banked":{"type":"object","properties":{"count":{"type":"integer","minimum":0},"lastAt":{"type":"string","format":"date-time","nullable":true}},"required":["count","lastAt"]}},"required":["apiVersion","generatedAt","refreshIntervalSeconds","recordStartedAt","sources","totalResets","lastResetAt","hoursSinceLastReset","resetsLast7Days","resetsLast30Days","gaps","banked"]},"Reset":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"gapDays":{"type":"number","minimum":0,"nullable":true},"announcement":{"type":"object","properties":{"text":{"type":"string","nullable":true},"url":{"type":"string","format":"uri","nullable":true}},"required":["text","url"],"nullable":true}},"required":["at","gapDays","announcement"]},"Resets":{"type":"object","properties":{"apiVersion":{"type":"string","enum":["1"]},"generatedAt":{"type":"string","format":"date-time"},"refreshIntervalSeconds":{"type":"integer","enum":[300]},"recordStartedAt":{"type":"string","format":"date-time","nullable":true},"sources":{"type":"object","properties":{"record":{"type":"string","enum":["live"]},"timeline":{"type":"string"},"openaiStatus":{"type":"string"}},"required":["record","timeline","openaiStatus"]},"totalResets":{"type":"integer","minimum":0},"totalMatching":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0},"offset":{"type":"integer","minimum":0},"nextOffset":{"type":"integer","minimum":0,"nullable":true},"resets":{"type":"array","items":{"$ref":"#/components/schemas/Reset"}}},"required":["apiVersion","generatedAt","refreshIntervalSeconds","recordStartedAt","sources","totalResets","totalMatching","limit","offset","nextOffset","resets"]},"Forecast":{"type":"object","properties":{"apiVersion":{"type":"string","enum":["1"]},"generatedAt":{"type":"string","format":"date-time"},"refreshIntervalSeconds":{"type":"integer","enum":[300]},"recordStartedAt":{"type":"string","format":"date-time","nullable":true},"sources":{"type":"object","properties":{"record":{"type":"string","enum":["live"]},"timeline":{"type":"string"},"openaiStatus":{"type":"string"}},"required":["record","timeline","openaiStatus"]},"lastResetAt":{"type":"string","format":"date-time","nullable":true},"headline":{"type":"string"},"next24Hours":{"type":"object","properties":{"probability":{"type":"number","minimum":0,"maximum":1},"low":{"type":"number","minimum":0,"maximum":1},"high":{"type":"number","minimum":0,"maximum":1}},"required":["probability","low","high"]},"nearTerm":{"type":"object","properties":{"hours":{"type":"number","minimum":0},"probability":{"type":"number","minimum":0,"maximum":1},"low":{"type":"number","minimum":0,"maximum":1},"high":{"type":"number","minimum":0,"maximum":1}},"required":["hours","probability","low","high"]},"accuracy":{"type":"object","nullable":true,"additionalProperties":true,"description":"Historical replay of the daily timing model, not saved past predictions. brierRollingBase and rollingSkill use a past-only trailing-rate baseline. Legacy brierBase and skill use a hindsight constant; legacy live* fields only identify replays after the initial deployment date. Null with too little history."},"recording":{"type":"string","enum":["saved","unsaved"],"description":"Whether these probabilities are from the saved scheduled publication. Unsaved means a read-only fallback calculation."},"liveAccuracy":{"type":"object","properties":{"status":{"type":"string","enum":["collecting","available","unavailable"]},"method":{"type":"string","enum":["saved-forecasts"]},"recordingSince":{"type":"string","format":"date-time","nullable":true},"latestAt":{"type":"string","format":"date-time","nullable":true},"evaluationDays":{"type":"integer","minimum":0},"modelVersions":{"type":"array","items":{"type":"string"}},"sixHours":{"$ref":"#/components/schemas/HorizonAccuracy"},"twentyFourHours":{"$ref":"#/components/schemas/HorizonAccuracy"}},"required":["status","method","recordingSince","latestAt","evaluationDays","modelVersions","sixHours","twentyFourHours"],"nullable":true},"comparisons":{"type":"object","properties":{"modelVersion":{"type":"string"},"clockFactor":{"type":"number","minimum":0,"maximum":1},"baseline":{"type":"object","properties":{"sixHours":{"type":"number","minimum":0,"maximum":1},"twentyFourHours":{"type":"number","minimum":0,"maximum":1}},"required":["sixHours","twentyFourHours"]},"withoutHints":{"type":"object","properties":{"sixHours":{"type":"number","minimum":0,"maximum":1},"twentyFourHours":{"type":"number","minimum":0,"maximum":1}},"required":["sixHours","twentyFourHours"]},"smoothHistory":{"type":"object","properties":{"sixHours":{"type":"number","minimum":0,"maximum":1},"twentyFourHours":{"type":"number","minimum":0,"maximum":1}},"required":["sixHours","twentyFourHours"]}},"required":["modelVersion","clockFactor","baseline","withoutHints","smoothHistory"],"nullable":true,"description":"Comparisons calculated from the same available information. smoothHistory is an experimental candidate; it does not drive the published forecast. modelVersion versions the forecast algorithm, not the Gemini reader."},"caveat":{"type":"string"}},"required":["apiVersion","generatedAt","refreshIntervalSeconds","recordStartedAt","sources","lastResetAt","headline","next24Hours","nearTerm","accuracy","recording","liveAccuracy","comparisons","caveat"]},"HorizonAccuracy":{"type":"object","properties":{"hours":{"type":"integer","enum":[6,24]},"windows":{"type":"integer","minimum":0},"events":{"type":"integer","minimum":0},"firstAt":{"type":"string","format":"date-time","nullable":true},"lastAt":{"type":"string","format":"date-time","nullable":true},"meanForecast":{"type":"number","nullable":true},"observedRate":{"type":"number","nullable":true},"brier":{"type":"number","nullable":true},"baselineBrier":{"type":"number","nullable":true},"withoutHintsBrier":{"type":"number","nullable":true},"smoothHistoryBrier":{"type":"number","nullable":true},"skill":{"type":"number","nullable":true},"hintWindows":{"type":"integer","minimum":0},"hintBrier":{"type":"number","nullable":true},"hintWithoutHintsBrier":{"type":"number","nullable":true}},"required":["hours","windows","events","firstAt","lastAt","meanForecast","observedRate","brier","baselineBrier","withoutHintsBrier","smoothHistoryBrier","skill","hintWindows","hintBrier","hintWithoutHintsBrier"]},"LiveAccuracy":{"type":"object","properties":{"status":{"type":"string","enum":["collecting","available","unavailable"]},"method":{"type":"string","enum":["saved-forecasts"]},"recordingSince":{"type":"string","format":"date-time","nullable":true},"latestAt":{"type":"string","format":"date-time","nullable":true},"evaluationDays":{"type":"integer","minimum":0},"modelVersions":{"type":"array","items":{"type":"string"}},"sixHours":{"$ref":"#/components/schemas/HorizonAccuracy"},"twentyFourHours":{"$ref":"#/components/schemas/HorizonAccuracy"}},"required":["status","method","recordingSince","latestAt","evaluationDays","modelVersions","sixHours","twentyFourHours"]},"Health":{"type":"object","properties":{"apiVersion":{"type":"string","enum":["1"]},"status":{"type":"string","enum":["ok","degraded"]},"checkedAt":{"type":"string","format":"date-time"},"observer":{"type":"string","enum":["live","degraded","unavailable"]},"timeline":{"type":"string","enum":["live","unavailable"]},"cron":{"type":"object","properties":{"status":{"type":"string","enum":["live","stale"]},"lastCompletedAt":{"type":"string","format":"date-time","nullable":true}},"required":["status","lastCompletedAt"]},"ai":{"type":"object","properties":{"configured":{"type":"boolean"},"requestedModel":{"type":"string"},"lastSuccessfulReadAt":{"type":"string","format":"date-time","nullable":true},"lastSuccessfulModel":{"type":"string","nullable":true}},"required":["configured","requestedModel","lastSuccessfulReadAt","lastSuccessfulModel"]}},"required":["apiVersion","status","checkedAt","observer","timeline","cron","ai"]}}}}