{"openapi":"3.1.0","info":{"title":"audit-api","description":"detail.web audit API: движок аудита (SEO/GEO), скоринг, PDF, SaaS-кабинет и биллинг. Endpoint /audit запускает SiteAuditor.","version":"0.1.0"},"paths":{"/audit/estimate":{"post":{"tags":["audit"],"summary":"Пред-оценка размера сайта (по sitemap) перед deep-аудитом","description":"Дешёвая прикидка (1-6 запросов): сколько страниц на сайте по sitemap и хватит ли кредитов на полный обход. Ничего не списывает. Оценка по sitemap может врать — реальный аудит обходит сайт по ссылкам и стопается по бюджету.","operationId":"post_audit_estimate_audit_estimate_post","parameters":[{"name":"X-Request-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Request-Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteEstimateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteEstimateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/audit":{"post":{"tags":["audit"],"summary":"Аудит одного сайта","description":"Принимает URL и запускает аудит через существующий `SiteAuditor` из `src/`. Возвращает score (0..100, выше = больше проблем = теплее лид), список issues и структурированные signals.","operationId":"post_audit_audit_post","parameters":[{"name":"X-Request-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Request-Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditResponse"}}}},"503":{"description":"Сайт недоступен или превышен timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Превышен rate-limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/audit/diff":{"post":{"tags":["audit"],"summary":"Дифф аудита: что изменилось с прошлой проверки (PRO)","description":"Прогоняет свежий аудит и сравнивает с предыдущим снапшотом того же URL для владельца ключа: дельта score/health, какие проверки ухудшились/улучшились. Stateful — требует PRO-ключ (без него available=false + upsell).","operationId":"post_audit_diff_audit_diff_post","parameters":[{"name":"X-Request-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Request-Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditDiffRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditDiffResponse"}}}},"503":{"description":"Сайт недоступен или timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Превышен rate-limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/audit/public":{"post":{"tags":["audit"],"summary":"Публичный аудит (для landing-формы)","description":"Публичный endpoint для лендинг-формы `DETAILWEB/apps/audit-web/`. Вход: URL + опц. email/phone. Выход: score + top-3 точек роста. Полный PDF отдаётся через отдельный email-флоу (после warm-up Brevo). Rate-limit: 3 запроса/IP/24h + 20 запросов/email/24h. Капча (Cloudflare Turnstile) — если TURNSTILE_SECRET задан в .env.","operationId":"post_public_audit_audit_public_post","parameters":[{"name":"X-Request-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Request-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAuditRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAuditResponse"}}}},"400":{"description":"Некорректный URL или капча.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate-limit (3/IP/24h или 20/email/24h).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Сайт недоступен.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/config":{"get":{"tags":["billing"],"summary":"Состояние биллинга","operationId":"get_billing_config_billing_config_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/capabilities":{"get":{"tags":["billing"],"summary":"Умеет ли магазин автоплатежи","description":"Без авторизации: витрине нужно знать, показывать ли галку продления.","operationId":"billing_capabilities_billing_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Billing Capabilities Billing Capabilities Get"}}}}}}},"/billing/checkout":{"post":{"tags":["billing"],"summary":"Создать оплату ЮKassa","operationId":"post_checkout_billing_checkout_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":