Ai Availability Endpoint
const url = 'https://example.com/ai/availability/';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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/ai/availability/ \ --header 'Authorization: Bearer <token>'Report whether builder AI chat is usable (builder-audit #338 P1-11).
Permission-gated on use_ai_chat so non-admin editors (who cannot read
/admin/ai-status) can learn availability. Returns available=false
rather than 503 when provider keys are missing, so the builder shows a safe
disabled state without console-noise errors. A viewer (no use_ai_chat)
gets 403.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Successful Response
Public-safe AI readiness signal (builder-audit #338 P1-11).
Carries a single boolean and intentionally exposes NO provider name, model,
or key detail — it is readable by any non-admin editor holding
use_ai_chat so the builder can enable/disable chat without the
admin-only /admin/ai-status endpoint (which leaks provider/key info).
object
Example generated
{ "available": true}Bad request — invalid query parameters or payload
Unauthorized — missing or invalid credentials
Forbidden — caller lacks access to this resource
Not found
Validation error
Too many requests — retry after the advertised interval
Headers
Section titled “Headers ”Seconds until the request may be retried
Internal server error
Service unavailable — the database could not serve the request