{"openapi":"3.1.0","info":{"title":"Subscription Renewal Cohort","version":"1.0.0","description":"Group subscription records by renewal month and distinguish active, paused and expiring access through a stated month.","contact":{"email":"jeremy@jeremycarter.ca"}},"servers":[{"url":"https://gptenv-x402-catalog.defcronyke.workers.dev"}],"paths":{"/subscription-renewal-cohort/v1/check":{"post":{"operationId":"subscription_renewal_cohort","summary":"Group subscription records by renewal month and distinguish active, paused and expiring access through a stated month.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.04"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"through_month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"subscriptions":{"maxItems":400,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"renewal_month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"status":{"type":"string","enum":["active","paused","expires"]}},"required":["id","renewal_month","status"],"additionalProperties":false}}},"required":["through_month","subscriptions"],"additionalProperties":false},"example":{"through_month":"2027-03","subscriptions":[{"id":"a","renewal_month":"2027-02","status":"active"},{"id":"b","renewal_month":"2027-02","status":"expires"},{"id":"c","renewal_month":"2027-04","status":"paused"}]}}}},"responses":{"200":{"description":"Service result","content":{"application/json":{"schema":{"type":"object"},"example":{"months":[{"month":"2027-02","renewals":["a"],"expiring":["b"],"paused":[]}],"later":["c"]}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 exact payment required on Base"},"503":{"description":"Payment unavailable"}}}}}}