{
  "openapi": "3.1.0",
  "info": {
    "title": "實價AI Read-only AI API",
    "version": "2026-07-03",
    "description": "Read-only housing-market query API for external LLM tools and agents. The caller pays their own LLM provider; 實價AI only serves authenticated housing data queries."
  },
  "servers": [
    {
      "url": "https://api.shijia-ai.com"
    }
  ],
  "paths": {
    "/api/v1/ai/ask": {
      "post": {
        "summary": "Ask 實價AI a read-only housing-market question",
        "security": [
          {
            "ShijiaApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "intent": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "district": {
                    "type": "string"
                  },
                  "skill_id": {
                    "type": "string"
                  },
                  "parameters": {
                    "type": "object"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Read-only answer from 實價AI"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "Blocked write/admin/subscription-gated request"
          },
          "429": {
            "description": "Plan quota exceeded"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ShijiaApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Shijia-API-Key"
      }
    }
  }
}
