{"components":{"schemas":{"Draft":{"properties":{"baseVersion":{"type":"integer"},"page":{"$ref":"#/components/schemas/Page"},"status":{"const":"draft"}},"required":["status","baseVersion","page"],"type":"object"},"Error":{"properties":{"code":{"type":"string"},"error":{"deprecated":true,"type":"string"},"fields":{"items":{"properties":{"code":{"type":"string"},"field":{"type":"string"}},"required":["field","code"],"type":"object"},"type":"array"},"limits":{"type":"object"},"message":{"type":"string"}},"required":["code","message","fields","limits"],"type":"object"},"History":{"properties":{"versions":{"items":{"properties":{"title":{"type":"string"},"updatedAt":{"format":"date-time","type":["string","null"]},"updatedBy":{"description":"Источник изменения. Ключ не идентифицирует человека.","type":["string","null"]},"version":{"type":"integer"}},"type":"object"},"type":"array"}},"type":"object"},"Page":{"additionalProperties":false,"properties":{"body":{"description":"Размер измеряется в байтах UTF-8.","type":"string","x-max-utf8-bytes":524288},"format":{"default":"text","enum":["text","html"],"type":"string"},"title":{"maxLength":120,"type":"string"}},"required":["title","body"],"type":"object"},"Patch":{"additionalProperties":false,"properties":{"body":{"description":"Размер измеряется в байтах UTF-8.","type":"string","x-max-utf8-bytes":524288},"format":{"default":"text","enum":["text","html"],"type":"string"},"title":{"maxLength":120,"type":"string"}},"type":"object"},"Prompt":{"additionalProperties":false,"properties":{"model":{"type":"string"},"prompt":{"maxLength":3000,"type":"string"}},"required":["prompt"],"type":"object"},"Publication":{"properties":{"api_url":{"type":"string"},"edit_url":{"type":"string"},"expires_at":{"type":"string"},"public_url":{"type":"string"},"slug":{"type":"string"}},"required":["slug","public_url","edit_url","api_url","expires_at"],"type":"object"},"Restore":{"additionalProperties":false,"properties":{"version":{"minimum":1,"type":"integer"}},"required":["version"],"type":"object"},"Snapshot":{"properties":{"body":{"description":"Размер измеряется в байтах UTF-8.","type":"string","x-max-utf8-bytes":524288},"format":{"default":"text","enum":["text","html"],"type":"string"},"title":{"maxLength":120,"type":"string"},"updatedAt":{"format":"date-time","type":["string","null"]},"updatedBy":{"description":"Источник изменения. Ключ не идентифицирует человека.","type":["string","null"]},"version":{"type":"integer"}},"required":["title","body","version","updatedAt","updatedBy"],"type":"object"}},"securitySchemes":{"EditToken":{"description":"Ключ редактирования этой страницы.","scheme":"bearer","type":"http"}}},"info":{"description":"API публикаций Guitarbus.","title":"Guitarbus API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Ссылки на ресурсы API"}},"/api/health":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"type":"string"}},"type":"object"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Состояние сервера"}},"/api/limits":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Лимиты и квоты"}},"/api/mcp":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"MCP Streamable HTTP (JSON-RPC)"}},"/api/models":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"items":{"properties":{"enabled":{"type":"boolean"},"id":{"type":"string"},"label":{"type":"string"}},"type":"object"},"type":"array"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Доступные модели"}},"/api/openapi.json":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Спецификация OpenAPI"}},"/api/pages":{"post":{"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Page"},{"$ref":"#/components/schemas/Prompt"}]}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Опубликовать страницу или сгенерировать её по запросу"}},"/api/pages/drafts":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Publication"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Создать неопубликованную страницу с черновиком"}},"/api/pages/validate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Проверить страницу без сохранения"}},"/api/pages/{slug}":{"get":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}},{"in":"header","name":"If-None-Match","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"304":{"description":"Версия не изменилась","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"summary":"Получить опубликованную страницу"},"patch":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}},{"description":"Точный сильный ETag из GET соответствующего ресурса.","in":"header","name":"If-Match","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Patch"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Версия изменилась"},"428":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Отсутствует If-Match"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Обновить отдельные поля публикации"},"put":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}},{"description":"Точный сильный ETag из GET соответствующего ресурса.","in":"header","name":"If-Match","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Версия изменилась"},"428":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Отсутствует If-Match"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Заменить опубликованную страницу"}},"/api/pages/{slug}/draft":{"delete":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}},{"description":"Точный сильный ETag из GET соответствующего ресурса.","in":"header","name":"If-Match","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Запрос выполнен"},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Версия изменилась"},"428":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Отсутствует If-Match"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Удалить черновик"},"get":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Получить черновик"},"put":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}},{"description":"Точный сильный ETag из GET соответствующего ресурса.","in":"header","name":"If-Match","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Версия изменилась"},"428":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Отсутствует If-Match"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Сохранить черновик. Для первого сохранения передайте ETag публикации"}},"/api/pages/{slug}/draft/preview":{"get":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}}],"responses":{"200":{"content":{"text/html":{"schema":{"type":"string"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Получить изолированный HTML черновика"}},"/api/pages/{slug}/draft/publish":{"post":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}},{"description":"Точный сильный ETag из GET соответствующего ресурса.","in":"header","name":"If-Match","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Версия изменилась"},"428":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Отсутствует If-Match"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Опубликовать черновик, если исходная версия ещё актуальна"}},"/api/pages/{slug}/edit-token/rotate":{"post":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"edit_token":{"type":"string"},"edit_url":{"type":"string"}},"type":"object"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Заменить ключ редактирования с немедленным отзывом старого"}},"/api/pages/{slug}/history":{"get":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/History"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Получить список версий"}},"/api/pages/{slug}/history/{version}":{"get":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}},{"in":"path","name":"version","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}},"description":"Запрос выполнен"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Получить содержимое версии"}},"/api/pages/{slug}/restore":{"post":{"parameters":[{"in":"path","name":"slug","required":true,"schema":{"pattern":"^p-[a-f0-9]{16}$","type":"string"}},{"description":"Точный сильный ETag из GET соответствующего ресурса.","in":"header","name":"If-Match","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Restore"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Snapshot"}}},"description":"Запрос выполнен","headers":{"ETag":{"description":"Текущая версия ресурса","schema":{"type":"string"}}}},"412":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Версия изменилась"},"428":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Отсутствует If-Match"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Ошибка API"}},"security":[{"EditToken":[]}],"summary":"Восстановить версию как новую публикацию"}}},"servers":[{"url":"https://guitarbus.com"}]}