{"openapi":"3.1.0","info":{"title":"Stayloop API · 第一档 / Tier 1","version":"2026-10-16","summary":"加拿大租房规则、安省日期算术与开放授权的租金基准 · Canadian tenancy rules, Ontario date arithmetic and openly licensed rent benchmarks","description":"第一档 = Stayloop 自己的确定性规则、日期算术与开放授权的租金基准（CMHC / 加拿大统计局）。无需密钥，不接受也不存储任何个人信息；每个响应带 `as_of`（规则快照日）与 `boundary`（边界句）。\n\nTier 1 = Stayloop’s own deterministic rules, date arithmetic and openly licensed rent benchmarks (CMHC / Statistics Canada). No key required; no personal information is accepted or stored; every response carries `as_of` (rule snapshot date) and `boundary`.\n\n限流：按 `X-Client-Id`（可选、自报、≤64 字符）或 IP 每小时 300 次，每端点全站每小时 5000 次。· Rate limit: 300/hour per `X-Client-Id` (optional, self-declared, ≤64 chars) or IP, 5000/hour per endpoint site-wide.\n\n同一套函数也通过 MCP 端点 `POST https://www.stayloop.ai/api/mcp` 提供。· The same functions are exposed as MCP tools at `POST https://www.stayloop.ai/api/mcp`.","termsOfService":"https://www.stayloop.ai/terms","contact":{"email":"hello@stayloop.ai","url":"https://www.stayloop.ai/stayloop-api"},"x-rules-as-of":"2026-10-16"},"servers":[{"url":"https://www.stayloop.ai/api/v1","description":"Production"}],"tags":[{"name":"tier-1","description":"第一档 · 免费 · 无需密钥 · Tier 1 · free · no key"}],"x-boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."},"x-rate-limit":{"per_key_per_hour":300,"per_endpoint_per_hour":5000,"key":"X-Client-Id header (optional) or client IP"},"paths":{"/rules":{"get":{"tags":["tier-1"],"operationId":"listRules","summary":"列出一个省的租房规则 · List a province’s tenancy rules","description":"安省：Stayloop 执行或说明的全部规则（编号、法条、严重度、生效日）。其他 12 个省 / 地区：已核实的官方事实逐项展开（适用法律、审裁机构、租约格式、押金、宠物押金、钥匙押金、预收租金、申请费、禁宠、涨租、人权法、隐私法、租期结束、拒绝告知），每条带引注与官方链接。· Ontario: every rule Stayloop enforces or explains (id, statute, severity, since). The other 12 provinces and territories: their verified official facts, one rule per topic, each with its citation and source URL.","parameters":[{"name":"province","in":"query","required":false,"schema":{"type":"string","enum":["ON","QC","BC","AB","MB","SK","NS","NB","PE","NL","YT","NT","NU"],"default":"ON","description":"省 / 地区代码，缺省 ON · Province or territory code, defaults to ON"}}],"responses":{"200":{"description":"规则列表 · Rule list","headers":{"x-api-version":{"schema":{"type":"string"},"description":"API 版本（日期）· API version (date) — 2026-10-16"},"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"每键每小时上限 · Per-key hourly limit"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesResult"},"example":{"province":"QC","province_name":{"zh":"魁北克省","en":"Quebec"},"as_of":"2026-10-16","rules":[{"id":"QC-deposit","topic":"deposit","statute":"Civil Code of Québec, art. 1904 (2nd para.) and art. 1893","source_url":"https://www.legisquebec.gouv.qc.ca/en/document/cs/CCQ-1991","title":{"zh":"押金","en":"Security deposit"},"summary":{"zh":"房东不能收取任何押金……","en":"A landlord may not require any deposit…"}}],"boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}}},"400":{"description":"invalid_json · invalid_input · unsupported_province","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited（带 Retry-After）· rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}},"/listings/compliance":{"post":{"tags":["tier-1"],"operationId":"checkListingCompliance","summary":"核对房源条款 · Check listing terms","description":"按省份核对押金 / 钥匙押金 / 禁宠 / 申请费 / 宠物与清洁押金 / 预收租金等条款。安省走 RTA / O. Reg. 516/06；其他省只核押金类与费用类（响应里的 `notes` 写明范围）。`passed` = 没有 block 级命中。文本字段只用于检查，不落库。· Checks deposit / key deposit / pet ban / application fee / pet & cleaning deposit / rent-in-advance terms for the province. Ontario uses the RTA / O. Reg. 516/06; other provinces cover deposits and fees only (`notes` says so). `passed` = no block-severity finding. Text fields are checked and discarded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListingComplianceInput"},"example":{"province":"ON","monthly_rent":2800,"deposit":3000,"pets_allowed":"restricted","description":"Bright 1+den, no application fee."}}}},"responses":{"200":{"description":"检查结果 · Check result","headers":{"x-api-version":{"schema":{"type":"string"},"description":"API 版本（日期）· API version (date) — 2026-10-16"},"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"每键每小时上限 · Per-key hourly limit"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceResult"},"example":{"province":"ON","passed":false,"findings":[{"rule_id":"RTA-106-deposit-cap","rule":"RTA-106-deposit-cap","severity":"block","statute":"RTA s.106(2)","message":{"zh":"押金 $3,000 超过一个月租金 $2,800。","en":"Deposit $3,000 exceeds one month's rent $2,800."},"source_url":"https://www.stayloop.ai/rules#RTA-106-deposit-cap","url":"https://www.stayloop.ai/rules#RTA-106-deposit-cap"}],"checked":["RTA-106-deposit-cap","OREG516-17-key-deposit","RTA-14-no-pet-clause","RTA-134-no-fees"],"as_of":"2026-10-16","boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}}},"400":{"description":"invalid_json · invalid_input · unsupported_province","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited（带 Retry-After）· rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}},"/lease/terms-check":{"post":{"tags":["tier-1"],"operationId":"checkLeaseTerms","summary":"核对租约条款 · Check lease terms","description":"安省：押金上限、租约格式（TRREB Form 400 只是要约）、附表 B 的禁宠 / 禁装空调 / 额外费用条款、日期顺序。其他省：押金上限 / 钥匙押金 / 预收租金三类，另核该省租约格式与日期。· Ontario: deposit cap, lease form (TRREB Form 400 is an offer), Schedule B pet-ban / AC-ban / extra-fee terms, date order. Other provinces: deposit cap, key deposit and rent in advance, plus the province’s lease form and dates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaseTermsInput"},"example":{"province":"ON","rent_amount":2800,"deposit_amount":2800,"form_type":"trreb","start_date":"2026-12-01","end_date":"2027-11-30"}}}},"responses":{"200":{"description":"检查结果 · Check result","headers":{"x-api-version":{"schema":{"type":"string"},"description":"API 版本（日期）· API version (date) — 2026-10-16"},"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"每键每小时上限 · Per-key hourly limit"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceResult"},"example":{"province":"ON","passed":true,"findings":[{"rule_id":"OREG9-18-standard-lease","rule":"OREG9-18-standard-lease","severity":"warn","statute":"O. Reg. 9/18","message":{"zh":"TRREB Form 400 是要约；正式租约仍须使用安省标准租约。","en":"TRREB Form 400 is an offer; the tenancy itself must use the Ontario standard lease."},"source_url":"https://www.stayloop.ai/rules#OREG9-18-standard-lease","url":"https://www.stayloop.ai/rules#OREG9-18-standard-lease"}],"checked":["RTA-106-deposit-cap","OREG9-18-standard-lease","RTA-14-no-pet-clause","RTA-36-1-tenant-ac","RTA-134-no-fees"],"as_of":"2026-10-16","boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}}},"400":{"description":"invalid_json · invalid_input · unsupported_province","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited（带 Retry-After）· rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}},"/guideline":{"get":{"tags":["tier-1"],"operationId":"rentIncreaseGuideline","summary":"安省涨租指导比例与 N1 截止日 · Ontario rent-increase guideline and N1 deadline","description":"按涨租生效日所在年份取指导比例（RTA s.120；法定封顶 2.5%），并算出 N1 最晚送达日（生效日前 90 天，s.116）。未公布的年份回退到最近一年并标 `published:false`。· Guideline for the year the increase takes effect (RTA s.120; statutory cap 2.5%) and the latest N1 service date (90 days before, s.116). Unpublished years fall back to the latest figure with `published:false`.","parameters":[{"name":"effective","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01"},"description":"涨租生效日 · Date the increase takes effect"}],"responses":{"200":{"description":"指导比例 · Guideline","headers":{"x-api-version":{"schema":{"type":"string"},"description":"API 版本（日期）· API version (date) — 2026-10-16"},"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"每键每小时上限 · Per-key hourly limit"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidelineResult"},"example":{"province":"ON","effective":"2027-01-01","year":2027,"pct":1.9,"published":true,"cap":2.5,"n1_deadline":"2026-10-03","notice_days":90,"as_of":"2026-10-16","boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}}},"400":{"description":"invalid_json · invalid_input · unsupported_province","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited（带 Retry-After）· rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}},"/n4/earliest-termination":{"get":{"tags":["tier-1"],"operationId":"n4EarliestTermination","summary":"安省 N4 最早终止日 · Ontario N4 earliest termination date","description":"送达日 + 7 天（RTA s.59，2026-09-21 起），邮寄另加 5 天视为送达日。只做日期算术：不判断是否该发 N4、不填表。· Service date + 7 days (RTA s.59, since 2026-09-21); mail adds 5 deemed-service days. Date arithmetic only: no view on whether to serve, no form filling.","parameters":[{"name":"served","in":"query","required":true,"schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01"},"description":"送达日 · Date served"},{"name":"method","in":"query","required":false,"schema":{"type":"string","enum":["hand","mail","email"],"default":"hand"}}],"responses":{"200":{"description":"日期 · Dates","headers":{"x-api-version":{"schema":{"type":"string"},"description":"API 版本（日期）· API version (date) — 2026-10-16"},"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"每键每小时上限 · Per-key hourly limit"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/N4Result"},"example":{"province":"ON","served":"2026-11-02","method":"mail","deemed_served":"2026-11-07","earliest_termination":"2026-11-14","termination_days":7,"mail_days":5,"as_of":"2026-10-16","boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}}},"400":{"description":"invalid_json · invalid_input · unsupported_province","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited（带 Retry-After）· rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}},"/late-payment/persistent":{"post":{"tags":["tier-1"],"operationId":"persistentLatePayment","summary":"安省持续迟付判定 · Ontario persistent late payment test","description":"对一组账期（应付日 + 实付日，≤120 期）按 RTA s.58(1.1) 的定义判定：6 个月内 ≥3 次迟付超过 7 天。只回账期日期，不回金额；不接受姓名或地址。· Applies the RTA s.58(1.1) definition — rent more than 7 days late at least 3 times within any 6 months — to up to 120 periods (due date + paid date). Returns due dates only; takes no names or addresses.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LatePaymentInput"},"example":{"periods":[{"due_date":"2026-04-01","paid_at":"2026-04-12"},{"due_date":"2026-05-01","paid_at":"2026-05-02"},{"due_date":"2026-06-01","paid_at":"2026-06-15"},{"due_date":"2026-07-01","paid_at":"2026-07-01"},{"due_date":"2026-08-01","paid_at":null}],"as_of":"2026-10-16"}}}},"responses":{"200":{"description":"判定 · Result","headers":{"x-api-version":{"schema":{"type":"string"},"description":"API 版本（日期）· API version (date) — 2026-10-16"},"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"每键每小时上限 · Per-key hourly limit"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LatePaymentResult"},"example":{"province":"ON","as_of_date":"2026-10-16","late":["2026-04-01","2026-06-01","2026-08-01"],"persistent":true,"window":["2026-04-01","2026-08-01"],"definition":{"grace_days":7,"count":3,"window_months":6},"as_of":"2026-10-16","boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}}},"400":{"description":"invalid_json · invalid_input · unsupported_province","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited（带 Retry-After）· rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}},"/rent-benchmark":{"get":{"tags":["tier-1"],"operationId":"rentBenchmark","summary":"安省租金基准（CMHC / 统计局）· Ontario rent benchmark (CMHC / StatCan)","description":"按区域、户型、物业类型给出最具体的 CMHC 租赁市场调查均租（公寓单元优先子区域，其余按分区，回退全市 / CMA），并附统计局季度挂牌均租。CMHC 均租是在住单元的调查均值，低于新签约价。**`attribution` 必须随数字一起展示**（开放授权的署名要求）。目前只有安省；其他省份 404 `not_available`。· The most specific CMHC Rental Market Survey average for the area / bedrooms / type (condo sub-area first, else zone, falling back to city / CMA), with the StatCan quarterly asking rent. CMHC averages are occupied-stock survey means and sit below new-lease prices. **`attribution` must be shown with the figure** (licence requirement). Ontario only for now; other provinces 404 `not_available`.","parameters":[{"name":"province","in":"query","required":false,"schema":{"type":"string","enum":["ON"],"default":"ON"}},{"name":"area","in":"query","required":false,"schema":{"type":"string","maxLength":200},"description":"社区 / 城市名（英文）· Neighbourhood or city name (English)","example":"Liberty Village"},{"name":"bedrooms","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":10,"default":1}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["apartment","condo","townhouse","house"],"default":"apartment"}}],"responses":{"200":{"description":"基准 · Benchmark","headers":{"x-api-version":{"schema":{"type":"string"},"description":"API 版本（日期）· API version (date) — 2026-10-16"},"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"每键每小时上限 · Per-key hourly limit"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RentBenchmarkResult"},"example":{"province":"ON","area":"Liberty Village","bedrooms":1,"type":"condo","benchmark":{"source":"cmhc","kind":"condo","area":"Toronto","period":"2025-10","avg":2531,"prev_avg":2498,"quality":"a","label":{"zh":"CMHC · Toronto · 2025 年 10 月","en":"CMHC · Toronto · October 2025"}},"alt":{"kind":"purpose_built","area":"Zone 1 - Toronto (Central)","period":"2025-10","avg":2042,"quality":"a"},"asking":{"period":"2026-04","avg":2310,"prev_avg":2345},"attribution":{"zh":"来源：加拿大按揭与住房公司（CMHC）租赁市场调查，2025 年 10 月（出租公寓单元）","en":"Source: Canada Mortgage and Housing Corporation (CMHC), Rental Market Survey, October 2025 (rental condominium apartments)"},"as_of":"2026-10-16","boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}}},"400":{"description":"invalid_json · invalid_input · unsupported_province","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_available（非安省，或该户型没有数据）· not_available (not Ontario, or no row for the bedroom bucket)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited（带 Retry-After）· rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-boundary":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}},"components":{"schemas":{"Bi":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false},"ProvinceCode":{"type":"string","enum":["ON","QC","BC","AB","MB","SK","NS","NB","PE","NL","YT","NT","NU"],"default":"ON","description":"省 / 地区代码，缺省 ON · Province or territory code, defaults to ON"},"Error":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","enum":["invalid_json","invalid_input","unsupported_province","not_available","rate_limited","method_not_allowed"]},"message":{"type":"string","description":"写明哪个字段 · Names the field at fault"},"retry_after":{"type":"integer","description":"只在 429 出现（秒）· Only on 429, seconds"}},"additionalProperties":false,"example":{"error":"invalid_input","message":"effective: must be a date formatted YYYY-MM-DD"}},"Finding":{"type":"object","required":["rule_id","rule","severity","statute","message"],"properties":{"rule_id":{"type":"string","example":"RTA-106-deposit-cap"},"rule":{"type":"string","description":"与 rule_id 相同（旧字段名，保留）· Same as rule_id (legacy name, kept)"},"severity":{"type":"string","enum":["block","warn","info"]},"statute":{"type":"string","example":"RTA s.106(2)"},"message":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false},"source_url":{"type":"string","format":"uri","description":"安省 → stayloop.ai/rules#id；外省 → 该省官方条文页 · Ontario → stayloop.ai/rules#id; other provinces → the official source page"},"url":{"type":"string","format":"uri","description":"与 source_url 相同（旧字段名）· Same as source_url (legacy name)"}}},"Envelope":{"type":"object","required":["as_of","boundary"],"properties":{"as_of":{"type":"string","format":"date","description":"规则快照日 · Rule snapshot date","example":"2026-10-16"},"boundary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"固定边界句 · Fixed boundary statement","example":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}},"ComplianceResult":{"allOf":[{"type":"object","required":["as_of","boundary"],"properties":{"as_of":{"type":"string","format":"date","description":"规则快照日 · Rule snapshot date","example":"2026-10-16"},"boundary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"固定边界句 · Fixed boundary statement","example":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}},{"type":"object","required":["province","passed","findings","checked"],"properties":{"province":{"type":"string","enum":["ON","QC","BC","AB","MB","SK","NS","NB","PE","NL","YT","NT","NU"],"default":"ON","description":"省 / 地区代码，缺省 ON · Province or territory code, defaults to ON"},"passed":{"type":"boolean","description":"没有 block 级命中 · No block-severity finding"},"findings":{"type":"array","items":{"type":"object","required":["rule_id","rule","severity","statute","message"],"properties":{"rule_id":{"type":"string","example":"RTA-106-deposit-cap"},"rule":{"type":"string","description":"与 rule_id 相同（旧字段名，保留）· Same as rule_id (legacy name, kept)"},"severity":{"type":"string","enum":["block","warn","info"]},"statute":{"type":"string","example":"RTA s.106(2)"},"message":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false},"source_url":{"type":"string","format":"uri","description":"安省 → stayloop.ai/rules#id；外省 → 该省官方条文页 · Ontario → stayloop.ai/rules#id; other provinces → the official source page"},"url":{"type":"string","format":"uri","description":"与 source_url 相同（旧字段名）· Same as source_url (legacy name)"}}}},"checked":{"type":"array","items":{"type":"string"},"description":"本检查在该省能命中的规则 id · Rule ids this check can raise for the province"},"notes":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"外省时说明检查范围 · Scope note for provinces outside Ontario"}}}]},"RulesResult":{"allOf":[{"type":"object","required":["as_of","boundary"],"properties":{"as_of":{"type":"string","format":"date","description":"规则快照日 · Rule snapshot date","example":"2026-10-16"},"boundary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"固定边界句 · Fixed boundary statement","example":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}},{"type":"object","required":["province","province_name","rules"],"properties":{"province":{"type":"string","enum":["ON","QC","BC","AB","MB","SK","NS","NB","PE","NL","YT","NT","NU"],"default":"ON","description":"省 / 地区代码，缺省 ON · Province or territory code, defaults to ON"},"province_name":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false},"rules":{"type":"array","items":{"oneOf":[{"type":"object","required":["id","area","statute","title","summary","severity","since"],"properties":{"id":{"type":"string","example":"RTA-106-deposit-cap"},"area":{"type":"string","enum":["listing","lease","screening","notice","agent","renewal","tenancy","maintenance"]},"statute":{"type":"string","example":"RTA s.106(2)"},"title":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false},"summary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false},"severity":{"type":"string","enum":["block","warn","info"]},"since":{"type":"string","format":"date"}}},{"type":"object","required":["id","topic","statute","source_url","title","summary"],"properties":{"id":{"type":"string","example":"QC-deposit","description":"`<省代码>-<topic>` · `<CODE>-<topic>`"},"topic":{"type":"string","enum":["statute","tribunal","lease-form","deposit","pet-deposit","key-or-other-deposits","advance-rent","application-fee","pet-ban-allowed","rent-increase","human-rights","privacy-law","lease-end","adverse-decision"]},"statute":{"type":"string","description":"官方引注 · Official citation","example":"Civil Code of Québec, art. 1904 (2nd para.) and art. 1893"},"source_url":{"type":"string","format":"uri"},"title":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false},"summary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false}}}]}}}}]},"GuidelineResult":{"allOf":[{"type":"object","required":["as_of","boundary"],"properties":{"as_of":{"type":"string","format":"date","description":"规则快照日 · Rule snapshot date","example":"2026-10-16"},"boundary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"固定边界句 · Fixed boundary statement","example":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}},{"type":"object","required":["province","effective","year","pct","published","cap","n1_deadline","notice_days"],"properties":{"province":{"type":"string","const":"ON"},"effective":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01"},"year":{"type":"integer","description":"涨租生效年份 · Year the increase takes effect"},"pct":{"type":"number","description":"该年指导比例（%）· Guideline percentage for that year"},"published":{"type":"boolean","description":"false = 该年尚未公布，pct 是最近一年的值 · false = not yet published, pct is the latest known figure"},"cap":{"type":"number","description":"法定封顶（%）· Statutory cap"},"n1_deadline":{"type":"string","format":"date","description":"N1 最晚送达日（生效日前 90 天）· Latest N1 service date (90 days before)"},"notice_days":{"type":"integer"}}}]},"N4Result":{"allOf":[{"type":"object","required":["as_of","boundary"],"properties":{"as_of":{"type":"string","format":"date","description":"规则快照日 · Rule snapshot date","example":"2026-10-16"},"boundary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"固定边界句 · Fixed boundary statement","example":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}},{"type":"object","required":["province","served","method","deemed_served","earliest_termination","termination_days","mail_days"],"properties":{"province":{"type":"string","const":"ON"},"served":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01"},"method":{"type":"string","enum":["hand","mail","email"]},"deemed_served":{"type":"string","format":"date","description":"邮寄 +5 天 · Mail adds five deemed-service days"},"earliest_termination":{"type":"string","format":"date"},"termination_days":{"type":"integer"},"mail_days":{"type":"integer"}}}]},"LatePaymentResult":{"allOf":[{"type":"object","required":["as_of","boundary"],"properties":{"as_of":{"type":"string","format":"date","description":"规则快照日 · Rule snapshot date","example":"2026-10-16"},"boundary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"固定边界句 · Fixed boundary statement","example":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}},{"type":"object","required":["province","as_of_date","late","persistent","window","definition"],"properties":{"province":{"type":"string","const":"ON"},"as_of_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01"},"late":{"type":"array","items":{"type":"string","format":"date"},"description":"迟付超过 7 天的账期 · Due dates paid (or unpaid) more than 7 days late"},"persistent":{"type":"boolean"},"window":{"oneOf":[{"type":"array","items":{"type":"string","format":"date"},"minItems":2,"maxItems":2},{"type":"null"}],"description":"构成持续迟付的首末账期 · First and last due dates of the qualifying window"},"definition":{"type":"object","properties":{"grace_days":{"type":"integer"},"count":{"type":"integer"},"window_months":{"type":"integer"}}}}}]},"RentBenchmarkResult":{"allOf":[{"type":"object","required":["as_of","boundary"],"properties":{"as_of":{"type":"string","format":"date","description":"规则快照日 · Rule snapshot date","example":"2026-10-16"},"boundary":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"固定边界句 · Fixed boundary statement","example":{"zh":"只做确定性规则与日期算术，不是法律意见；不选表、不建议是否发出任何通知；不接受也不存储个人信息。","en":"Deterministic rules and date arithmetic only, not legal advice; it does not pick forms or advise whether to serve any notice; it accepts and stores no personal information."}}}},{"type":"object","required":["province","bedrooms","type","benchmark","attribution"],"properties":{"province":{"type":"string","const":"ON"},"area":{"type":["string","null"]},"bedrooms":{"type":"integer","description":"CMHC 户型档：0 开间 · 1 · 2 · 3 = 三房及以上 · CMHC bucket: 0 studio · 1 · 2 · 3 = three or more"},"type":{"type":"string","enum":["apartment","condo","townhouse","house"]},"benchmark":{"type":"object","required":["source","kind","area","period","avg","label"],"properties":{"source":{"type":"string","enum":["cmhc","statcan"]},"kind":{"type":"string","enum":["purpose_built","condo","asking"]},"area":{"type":"string","example":"Zone 1 - Toronto (Central)"},"period":{"type":"string","example":"2025-10"},"avg":{"type":"number"},"prev_avg":{"type":["number","null"]},"quality":{"type":["string","null"],"description":"CMHC 可靠性等级 a–d · CMHC reliability code a–d"},"label":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false}}},"alt":{"type":"object","description":"同区域另一种 CMHC 口径 · The other CMHC kind for the same area"},"asking":{"type":"object","description":"统计局季度挂牌均租 · StatCan quarterly asking rent"},"history":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"avg":{"type":"number"}}}},"attribution":{"type":"object","required":["zh","en"],"properties":{"zh":{"type":"string"},"en":{"type":"string"}},"additionalProperties":false,"description":"必填署名句，展示数字处必须显示 · Required attribution, must be shown wherever the figure is printed"}}}]},"ListingComplianceInput":{"type":"object","properties":{"province":{"type":"string","enum":["ON","QC","BC","AB","MB","SK","NS","NB","PE","NL","YT","NT","NU"],"default":"ON","description":"省 / 地区代码，缺省 ON · Province or territory code, defaults to ON"},"monthly_rent":{"type":"number","minimum":0,"maximum":1000000,"example":2800},"deposit":{"type":"number","minimum":0,"maximum":1000000,"example":2800},"key_deposit":{"type":"number","minimum":0,"maximum":1000000},"application_fee":{"type":"number","minimum":0,"maximum":1000000},"pets_allowed":{"type":"string","enum":["yes","no","restricted"]},"title":{"type":"string","maxLength":2000},"description":{"type":"string","maxLength":2000},"schedule_b":{"type":"string","maxLength":2000}},"additionalProperties":false},"LeaseTermsInput":{"type":"object","properties":{"province":{"type":"string","enum":["ON","QC","BC","AB","MB","SK","NS","NB","PE","NL","YT","NT","NU"],"default":"ON","description":"省 / 地区代码，缺省 ON · Province or territory code, defaults to ON"},"rent_amount":{"type":"number","minimum":0,"maximum":1000000,"example":2800},"deposit_amount":{"type":"number","minimum":0,"maximum":1000000,"example":2800},"form_type":{"type":"string","maxLength":40,"description":"ontario_standard | trreb | imported | other","example":"ontario_standard"},"schedule_b":{"type":"string","maxLength":2000},"start_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01"},"end_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01"}},"additionalProperties":false},"LatePaymentInput":{"type":"object","required":["periods"],"properties":{"periods":{"type":"array","minItems":1,"maxItems":120,"items":{"type":"object","required":["due_date"],"properties":{"due_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01"},"paid_at":{"type":["string","null"],"description":"YYYY-MM-DD 或 ISO 日期时间；null = 未付 · Date or ISO date-time; null = unpaid"}},"additionalProperties":false}},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","example":"2027-01-01","description":"判定日，缺省今天 · Evaluation date, defaults to today"}},"additionalProperties":false}}}}