{"openapi":"3.1.0","info":{"title":"CityCode API","version":"1.0.0","description":"Grounded, citation-backed answers to Minneapolis municipal-code questions, for programmatic use by agents. Authenticate with a CityCode API key (`Authorization: Bearer cck_live_…`)."},"servers":[{"url":"https://citycodeassistant.com"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"A CityCode API key. Create one in the developer dashboard."}},"schemas":{"Citation":{"type":"object","properties":{"section":{"type":"string","description":"Municipal-code section identifier."},"title":{"type":"string"},"excerpt":{"type":"string","description":"Verbatim supporting text."}}},"QueryResponse":{"type":"object","required":["answer","citations","confidence","responseTimeMs"],"properties":{"answer":{"type":"string"},"citations":{"type":"array","items":{"$ref":"#/components/schemas/Citation"}},"confidence":{"type":"number","minimum":0,"maximum":1},"responseTimeMs":{"type":"number"}}},"Error":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string"}}}}},"security":[{"ApiKeyAuth":[]}],"paths":{"/api/v1/citycode/query":{"post":{"summary":"Ask a Minneapolis municipal-code question","operationId":"queryCityCode","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"type":"string","minLength":1,"maxLength":2000,"example":"What is the maximum height for a detached accessory structure?"}}}}}},"responses":{"200":{"description":"A grounded answer with citations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponse"}}}},"400":{"description":"Invalid request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Free-tier rate limit reached — subscribe to Pro.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Service temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/citycode/health":{"get":{"summary":"Liveness probe","operationId":"health","security":[],"responses":{"200":{"description":"Service is up.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"service":{"type":"string"},"version":{"type":"string"}}}}}}}}}}}