{"openapi":"3.1.0","info":{"title":"Bamelak AI Pricing API","version":"1.0.3","description":"Private pricing for Tehran districts 1–3. All monetary values in toman. Read /llms.txt for interpretation, limits and examples."},"servers":[{"url":"https://ai.bamelak.com"}],"paths":{"/api/v1/estimate":{"post":{"operationId":"estimateProperty","summary":"Calibrated property valuation from geographic coordinates","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateInput"}}}},"responses":{"200":{"description":"Pricing result (toman)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateResponse"}}}},"400":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/neighborhood-price":{"post":{"operationId":"neighborhoodAveragePrice","summary":"قیمت میانگین محله — observed P10/mean/median/P90 by name","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NeighborhoodInput"}}}},"responses":{"200":{"description":"Pricing result (toman)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NeighborhoodResponse"}}}},"400":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Error; inspect error.code and details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"mlk_..."}},"schemas":{"EstimateInput":{"type":"object","additionalProperties":false,"required":["latitude","longitude","area","propertyType"],"properties":{"latitude":{"type":"number","minimum":35.4,"maximum":35.95},"longitude":{"type":"number","minimum":50.85,"maximum":51.75},"area":{"type":"number","exclusiveMinimum":0,"maximum":10000},"district":{"type":"string","enum":["1","2","3"]},"propertyType":{"type":"string","enum":["apartment","house","land"]},"neighborhood":{"type":"string","maxLength":80},"buildingAge":{"type":"number","minimum":0,"maximum":150},"bedrooms":{"type":"integer","minimum":0,"maximum":20},"bathrooms":{"type":"integer","minimum":0,"maximum":20},"floor":{"type":"integer","minimum":-10,"maximum":100},"totalFloors":{"type":"integer","minimum":1,"maximum":100},"parkingSpaces":{"type":"integer","minimum":0,"maximum":20},"landArea":{"type":"number","exclusiveMinimum":0,"maximum":100000},"elevator":{"type":"boolean"},"parking":{"type":"boolean"},"storage":{"type":"boolean"},"renovated":{"type":"boolean"},"balcony":{"type":"boolean"},"swimmingPool":{"type":"boolean"},"saunaJacuzzi":{"type":"boolean"},"gym":{"type":"boolean"},"lobby":{"type":"boolean"},"concierge":{"type":"boolean"},"roofGarden":{"type":"boolean"},"centralCooling":{"type":"boolean"},"premiumView":{"type":"boolean"}}},"NeighborhoodInput":{"type":"object","additionalProperties":false,"required":["neighborhood"],"properties":{"neighborhood":{"type":"string","minLength":2,"maxLength":80,"examples":["دروس"]},"district":{"type":"string","enum":["1","2","3"]},"propertyType":{"type":"string","enum":["apartment","house","land"],"default":"apartment"},"area":{"type":"number","exclusiveMinimum":0,"maximum":10000}}},"EstimateResponse":{"type":"object","required":["requestId","data"],"properties":{"requestId":{"type":"string"},"data":{"type":"object","properties":{"calculationId":{"type":"string"},"district":{"type":"string","enum":["1","2","3"]},"currency":{"const":"toman"},"area":{"type":"number"},"price":{"type":"object","required":["minimum","middle","maximum"],"properties":{"minimum":{"type":"number"},"middle":{"type":"number"},"maximum":{"type":"number"},"average":{"type":"number"}}},"pricePerM2":{"type":"object","required":["minimum","middle","maximum"],"properties":{"minimum":{"type":"number"},"middle":{"type":"number"},"maximum":{"type":"number"},"average":{"type":"number"}}},"confidence":{"enum":["low","medium","high"]},"calibrationSampleCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"disclaimer":{"type":"string"}}}}},"NeighborhoodResponse":{"type":"object","required":["requestId","data"],"properties":{"requestId":{"type":"string"},"data":{"type":"object","properties":{"neighborhood":{"type":"string"},"canonicalNeighborhood":{"type":"string"},"requestedNeighborhood":{"type":"string"},"district":{"type":"string","enum":["1","2","3"]},"propertyType":{"type":"string","enum":["apartment","house","land"]},"matchedBy":{"enum":["catalog","spelling-correction"]},"currency":{"const":"toman"},"pricePerM2":{"type":"object","required":["minimum","middle","maximum"],"properties":{"minimum":{"type":"number"},"middle":{"type":"number"},"maximum":{"type":"number"},"average":{"type":"number"}}},"totalPrice":{"anyOf":[{"type":"object","required":["minimum","middle","maximum"],"properties":{"minimum":{"type":"number"},"middle":{"type":"number"},"maximum":{"type":"number"},"average":{"type":"number"}}},{"type":"null"}]},"area":{"type":["number","null"]},"location":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"},"precision":{"const":"sample-centroid"}}},"evidence":{"type":"object","properties":{"sampleCount":{"type":"integer"},"excludedOutliers":{"type":"integer"},"verifiedCount":{"type":"integer"},"askingPriceCount":{"type":"integer"},"oldestDate":{"type":"string"},"latestDate":{"type":"string"},"maximumAgeDays":{"const":180}}},"confidence":{"enum":["low","medium","high"]},"method":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}}},"Error":{"type":"object","required":["requestId","error"],"properties":{"requestId":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}