{
  "openapi": "3.0.3",
  "info": {
    "title": "ZoXa Addons API",
    "version": "1.0",
    "description": "API جلب إضافات ماينكرافت (Bedrock وJava) مع بحث حي في الكتالوج — مفتاح واحد يعمل على zoxa وvlxai"
  },
  "servers": [
    {
      "url": "https://zoxa.pages.dev"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/api/v1/addons": {
      "get": {
        "summary": "كل الإضافات المنشورة",
        "responses": {
          "200": {
            "description": "قائمة الإضافات",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "addons": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "cover": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "مفتاح غير صالح"
          },
          "429": {
            "description": "تجاوز الحد (60/دقيقة)"
          }
        }
      }
    },
    "/api/v1/addons/{id}": {
      "get": {
        "summary": "تفاصيل إضافة واحدة",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "slug أو id"
          }
        ],
        "responses": {
          "200": {
            "description": "تفاصيل الإضافة"
          },
          "400": {
            "description": "معرّف مكسور"
          },
          "404": {
            "description": "غير موجود"
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "summary": "معلومات المفتاح",
        "responses": {
          "200": {
            "description": "ok + key { name, owner, created, calls }"
          },
          "401": {
            "description": "مفتاح غير صالح"
          }
        }
      }
    },
    "/api/v1/catalog": {
      "get": {
        "summary": "بحث حي في الكتالوج (zoxa)",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "نص البحث"
          },
          {
            "name": "pg",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 40
            },
            "description": "رقم الصفحة"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "dl",
                "new",
                "rel"
              ]
            }
          },
          {
            "name": "n",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 24
            },
            "description": "حجم الصفحة"
          }
        ],
        "responses": {
          "200": {
            "description": "نتائج الكتالوج"
          },
          "429": {
            "description": "تجاوز الحد"
          }
        }
      }
    }
  }
}