{
    "openapi": "3.1.0",
    "info": {
        "title": "Таверна Табакси — открытое API",
        "version": "1.0.0",
        "description": "Антикафе с D&D и настольными играми: факты, цены, расписание игр со свободными местами, частые вопросы.\nТолько чтение, без ключа, не чаще 60 запросов в минуту с адреса. Ответы кэшируются на минуту.\nЗаписаться через API нельзя — это делает человек на сайте или по телефону; для ИИ-агентов есть MCP-сервер https://tabaxi.ru/api/mcp с заявкой, которую подтверждает администратор.",
        "contact": {
            "name": "Таверна Табакси",
            "url": "https://tabaxi.ru/kontakty",
            "email": "gakman@ya.ru"
        }
    },
    "servers": [
        {
            "url": "https://tabaxi.ru/api/v1"
        }
    ],
    "externalDocs": {
        "description": "Оглавление сайта для ИИ",
        "url": "https://tabaxi.ru/llms.txt"
    },
    "paths": {
        "/info": {
            "get": {
                "operationId": "getInfo",
                "summary": "Кто мы: адрес, часы, телефон, ссылки и факты (возраст, залы, слоты, своя еда…)",
                "responses": {
                    "200": {
                        "description": "Сведения о таверне",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "name": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string"
                                                },
                                                "phone": {
                                                    "type": "string"
                                                },
                                                "address": {
                                                    "type": "string"
                                                },
                                                "geo": {
                                                    "type": "object",
                                                    "properties": {
                                                        "lat": {
                                                            "type": "number"
                                                        },
                                                        "lng": {
                                                            "type": "number"
                                                        }
                                                    }
                                                },
                                                "hours": {
                                                    "type": "string"
                                                },
                                                "opening_hours": {
                                                    "type": "string",
                                                    "description": "Формат schema.org: Tu-Su 12:00-22:00"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "links": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "string"
                                                    }
                                                },
                                                "facts": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Слишком много запросов: не чаще 60 в минуту"
                    }
                }
            }
        },
        "/prices": {
            "get": {
                "operationId": "getPrices",
                "summary": "Цены: разовая игра, абонемент, день настолок, аренда стола, коворкинг",
                "responses": {
                    "200": {
                        "description": "Тарифы",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "price",
                                                    "currency"
                                                ],
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "price": {
                                                        "type": "integer"
                                                    },
                                                    "currency": {
                                                        "type": "string"
                                                    },
                                                    "per": {
                                                        "type": "string",
                                                        "description": "игра, абонемент, день, слот"
                                                    },
                                                    "text": {
                                                        "type": "string"
                                                    },
                                                    "note": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Слишком много запросов: не чаще 60 в минуту"
                    }
                }
            }
        },
        "/schedule": {
            "get": {
                "operationId": "getSchedule",
                "summary": "Ближайшие игры со свободными местами",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "С даты (ГГГГ-ММ-ДД)"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "description": "По дату включительно"
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "novice",
                                "campaign",
                                "event"
                            ]
                        }
                    },
                    {
                        "name": "system",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "dnd5e",
                                "dnd2024",
                                "pf2",
                                "cyberpunk",
                                "vtm",
                                "coc",
                                "board",
                                "other"
                            ]
                        }
                    },
                    {
                        "name": "available",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        },
                        "description": "Только где есть места"
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200,
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Игры по времени начала",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Game"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Слишком много запросов: не чаще 60 в минуту"
                    }
                }
            }
        },
        "/schedule/{id}": {
            "get": {
                "operationId": "getGame",
                "summary": "Одна игра: свободные места сейчас",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Игра",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Game"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Слишком много запросов: не чаще 60 в минуту"
                    },
                    "404": {
                        "description": "Нет такой игры или она уже прошла"
                    }
                }
            }
        },
        "/faq": {
            "get": {
                "operationId": "getFaq",
                "summary": "Частые вопросы и ответы",
                "responses": {
                    "200": {
                        "description": "Вопросы",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "meta"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "q": {
                                                        "type": "string"
                                                    },
                                                    "a": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/Meta"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Слишком много запросов: не чаще 60 в минуту"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Game": {
                "type": "object",
                "required": [
                    "id",
                    "title",
                    "starts_at",
                    "seats_total",
                    "seats_left",
                    "status",
                    "url"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string",
                        "example": "Первая игра: ваншот для новичков"
                    },
                    "category": {
                        "type": "string",
                        "enum": [
                            "novice",
                            "campaign",
                            "event"
                        ],
                        "description": "novice — для новичков, campaign — кампании, event — события"
                    },
                    "category_label": {
                        "type": "string"
                    },
                    "system": {
                        "type": "string",
                        "example": "D&D 5e (2014)"
                    },
                    "about": {
                        "type": "string",
                        "description": "Формат: уровни, готовые персонажи…"
                    },
                    "description": {
                        "type": "string"
                    },
                    "starts_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "С часовым поясом таверны"
                    },
                    "ends_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "room": {
                        "type": "string"
                    },
                    "master": {
                        "type": "string",
                        "description": "Имя мастера (ведущего)"
                    },
                    "seats_total": {
                        "type": "integer"
                    },
                    "seats_left": {
                        "type": "integer",
                        "description": "Свободных мест прямо сейчас"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "open",
                            "full"
                        ]
                    },
                    "price": {
                        "type": "integer",
                        "description": "Рубли с человека; нет поля — цену уточнять"
                    },
                    "currency": {
                        "type": "string",
                        "enum": [
                            "RUB"
                        ]
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "Где записаться"
                    },
                    "calendar": {
                        "type": "string",
                        "format": "uri",
                        "description": ".ics этой игры"
                    },
                    "signup": {
                        "type": "string",
                        "description": "Как записаться — для человека"
                    }
                }
            },
            "Meta": {
                "type": "object",
                "properties": {
                    "generated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "source": {
                        "type": "string",
                        "format": "uri"
                    },
                    "docs": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            }
        }
    }
}