Публичная проверка AI-чата
GET
/wp-json/wp2tutor/ai/v1/chat
const url = 'https://example.com/wp-json/wp2tutor/ai/v1/chat';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/wp-json/wp2tutor/ai/v1/chatHealth ручки wp2tutor/ai/v1/chat. PHP AiChatController::get_items: всегда JSON { status: ok, service: ai-chat }, HTTP 200. Секрет не проверяется, прокси к модели не вызывается.
CORS на маршрутах /wp2tutor/ai/v1: Access-Control-Allow-Origin: *, методы GET, POST, OPTIONS, заголовки Content-Type и X-Ai-Chat-Secret. Если в настройках AI provider_connection = this_server, фильтр rest_authentication_errors пропускает cookie-auth для URI с /wp2tutor/ai/v1.
Responses
Заголовок раздела «Responses»Ручка жива. Тело фиксированное: status ok, service ai-chat.
Media typeapplication/json
object
status
PHP всегда литерал ok — ручка ответила, не статус лицензии/сборки.
string
service
PHP всегда литерал ai-chat (имя REST-сервиса).
string
Example
{ "status": "ok", "service": "ai-chat"}