{"openapi":"3.1.0","info":{"title":"Run Artifact Retention","version":"1.0.0","description":"Apply run-count, age and manual-pin retention rules to artifact groups and total the bytes eligible for deletion.","contact":{"email":"jeremy@jeremycarter.ca"}},"servers":[{"url":"https://gptenv-x402-catalog.defcronyke.workers.dev"}],"paths":{"/run-artifact-retention/v1/check":{"post":{"operationId":"run_artifact_retention","summary":"Apply run-count, age and manual-pin retention rules to artifact groups and total the bytes eligible for deletion.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.04"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"as_of":{"type":"integer","minimum":0,"maximum":1000000000000},"minimum_newest":{"type":"integer","minimum":0,"maximum":100},"keep_seconds":{"type":"integer","minimum":0,"maximum":1000000000},"runs":{"maxItems":250,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"group":{"type":"string","minLength":1,"maxLength":80},"created_at":{"type":"integer","minimum":0,"maximum":1000000000000},"bytes":{"type":"integer","minimum":0,"maximum":1000000000000},"pinned":{"type":"boolean"}},"required":["id","group","created_at","bytes","pinned"],"additionalProperties":false}}},"required":["as_of","minimum_newest","keep_seconds","runs"],"additionalProperties":false},"example":{"as_of":500,"minimum_newest":1,"keep_seconds":100,"runs":[{"id":"A1","group":"main","created_at":200,"bytes":10,"pinned":false},{"id":"A2","group":"main","created_at":300,"bytes":20,"pinned":false},{"id":"A3","group":"main","created_at":400,"bytes":30,"pinned":false},{"id":"B1","group":"docs","created_at":100,"bytes":15,"pinned":false},{"id":"A0","group":"main","created_at":150,"bytes":5,"pinned":true}]}}}},"responses":{"200":{"description":"Service result","content":{"application/json":{"schema":{"type":"object"},"example":{"retained":[{"id":"A3","reasons":["newest","age"]},{"id":"A0","reasons":["pinned"]},{"id":"B1","reasons":["newest"]}],"eligible":["A2","A1"],"eligible_bytes":30}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 exact payment required on Base"},"503":{"description":"Payment unavailable"}}}}}}