Errors are returned as JSON API error responses with appropriate HTTP status codes:
401 Unauthorized — The API token is missing or invalid.
403 Forbidden — The authenticated user does not have access to the requested feature.
404 Not Found — The requested endpoint does not exist.
500 Internal Server Error — An error occurred while communicating with the AI service (e.g. invalid API key, service unavailable, etc.).