{
  "openapi": "3.1.0",
  "info": {
    "title": "ByteBOT Public API",
    "version": "1.0.0",
    "description": "Herkese açık, salt okunur API. İstemci IP'si başına dakikada 60 uygulama isteği. Kimlik doğrulaması, yazma işlemi ve sorgu parametresi yoktur.",
    "termsOfService": "https://bytenetwork.wasmer.app/api-terms.html",
    "contact": {
      "url": "https://discord.gg/TQBPdraDyU"
    }
  },
  "servers": [
    {
      "url": "/",
      "description": "Mevcut ByteBOT site origin'i"
    }
  ],
  "tags": [
    {
      "name": "Public",
      "description": "Kimlik doğrulaması gerektirmeyen genel kaynaklar."
    }
  ],
  "paths": {
    "/api/v1": {
      "get": {
        "tags": [
          "Public"
        ],
        "summary": "API dizinini al",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Meta"
          },
          "304": {
            "$ref": "#/components/responses/NotModified"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "head": {
        "tags": [
          "Public"
        ],
        "summary": "API dizini başlıklarını al",
        "responses": {
          "200": {
            "description": "Meta JSON yanıtının başlıkları."
          }
        }
      },
      "options": {
        "tags": [
          "Public"
        ],
        "summary": "CORS ön kontrolü",
        "responses": {
          "204": {
            "description": "Salt okunur CORS isteği kabul edildi."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/meta": {
      "get": {
        "tags": [
          "Public"
        ],
        "summary": "API dizinini al",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Meta"
          },
          "304": {
            "$ref": "#/components/responses/NotModified"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "head": {
        "tags": [
          "Public"
        ],
        "summary": "API dizini başlıklarını al",
        "responses": {
          "200": {
            "description": "Meta JSON yanıtının başlıkları."
          }
        }
      },
      "options": {
        "tags": [
          "Public"
        ],
        "summary": "CORS ön kontrolü",
        "responses": {
          "204": {
            "description": "Salt okunur CORS isteği kabul edildi."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/bot/status": {
      "get": {
        "tags": [
          "Public"
        ],
        "summary": "Bot durumunu al",
        "responses": {
          "200": {
            "$ref": "#/components/responses/BotStatus"
          },
          "304": {
            "$ref": "#/components/responses/NotModified"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "head": {
        "tags": [
          "Public"
        ],
        "summary": "Bot durumu başlıklarını al",
        "responses": {
          "200": {
            "description": "Durum JSON yanıtının başlıkları."
          }
        }
      },
      "options": {
        "tags": [
          "Public"
        ],
        "summary": "CORS ön kontrolü",
        "responses": {
          "204": {
            "description": "Salt okunur CORS isteği kabul edildi."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/bot/commands": {
      "get": {
        "tags": [
          "Public"
        ],
        "summary": "Slash komutlarını al",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Commands"
          },
          "304": {
            "$ref": "#/components/responses/NotModified"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "head": {
        "tags": [
          "Public"
        ],
        "summary": "Komut listesi başlıklarını al",
        "responses": {
          "200": {
            "description": "Komut JSON yanıtının başlıkları."
          }
        }
      },
      "options": {
        "tags": [
          "Public"
        ],
        "summary": "CORS ön kontrolü",
        "responses": {
          "204": {
            "description": "Salt okunur CORS isteği kabul edildi."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/features": {
      "get": {
        "tags": [
          "Public"
        ],
        "summary": "Yayınlanan özellikleri al",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Features"
          },
          "304": {
            "$ref": "#/components/responses/NotModified"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "head": {
        "tags": [
          "Public"
        ],
        "summary": "Özellik listesi başlıklarını al",
        "responses": {
          "200": {
            "description": "Özellik JSON yanıtının başlıkları."
          }
        }
      },
      "options": {
        "tags": [
          "Public"
        ],
        "summary": "CORS ön kontrolü",
        "responses": {
          "204": {
            "description": "Salt okunur CORS isteği kabul edildi."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "ETag": {
        "description": "Yanıt doğrulayıcısı; If-None-Match ile 304 kullanılabilir.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitLimit": {
        "description": "Dakikalık istek sınırı (60).",
        "schema": {
          "type": "integer",
          "example": 60
        }
      },
      "RateLimitRemaining": {
        "description": "Pencerede kalan istek sayısı.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Kotanın sıfırlanacağı Unix zamanı (saniye).",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "Meta": {
        "description": "Sürüm ve kaynak listesi.",
        "headers": {
          "ETag": {
            "$ref": "#/components/headers/ETag"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Meta"
            }
          }
        }
      },
      "BotStatus": {
        "description": "Toplu bot durumu.",
        "headers": {
          "ETag": {
            "$ref": "#/components/headers/ETag"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BotStatus"
            }
          }
        }
      },
      "Commands": {
        "description": "Genel slash komut listesi.",
        "headers": {
          "ETag": {
            "$ref": "#/components/headers/ETag"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Commands"
            }
          }
        }
      },
      "Features": {
        "description": "Genel özellik kataloğu.",
        "headers": {
          "ETag": {
            "$ref": "#/components/headers/ETag"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Features"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Dakikalık hız sınırı aşıldı; Retry-After kadar bekleyin.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotModified": {
        "description": "ETag eşleşti; yanıt gövdesi yok."
      },
      "BadRequest": {
        "description": "Sorgu parametreleri desteklenmez.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Bilinmeyen API yolu.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "Yazma metotları desteklenmez; Allow: GET, HEAD, OPTIONS.",
        "headers": {
          "Allow": {
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Meta": {
        "type": "object",
        "required": [
          "name",
          "version",
          "readOnly",
          "resources"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "ByteBOT Public API"
          },
          "version": {
            "type": "string",
            "example": "1"
          },
          "readOnly": {
            "type": "boolean",
            "const": true
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "path",
                "description"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "BotStatus": {
        "type": "object",
        "required": [
          "online",
          "guilds",
          "users",
          "latencyMs",
          "commandCount",
          "uptimeSeconds",
          "version",
          "lastUpdatedAt"
        ],
        "properties": {
          "online": {
            "type": "boolean"
          },
          "guilds": {
            "type": "integer",
            "minimum": 0
          },
          "users": {
            "type": "integer",
            "minimum": 0
          },
          "latencyMs": {
            "type": "integer",
            "minimum": 0
          },
          "commandCount": {
            "type": "integer",
            "minimum": 0
          },
          "uptimeSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastUpdatedAt": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Unix zamanı milisaniye olarak."
          }
        }
      },
      "CommandOption": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "integer"
          },
          "required": {
            "type": "boolean"
          }
        }
      },
      "Command": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommandOption"
            }
          }
        }
      },
      "Commands": {
        "type": "object",
        "required": [
          "commands",
          "count"
        ],
        "properties": {
          "commands": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Command"
            }
          },
          "count": {
            "type": "integer",
            "maximum": 100
          }
        }
      },
      "Feature": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "tier": {
            "type": "string"
          }
        }
      },
      "Features": {
        "type": "object",
        "required": [
          "features"
        ],
        "properties": {
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Feature"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}
