API Reference
Base URL: http://127.0.0.1:8000
Auth
POST /auth/register- body:
{ "email": "...", "password": "..." } - response:
access_token, user
POST /auth/login- body:
{ "email": "...", "password": "..." } - response:
access_token, user
POST /auth/logout- header:
Authorization: Bearer <token>
GET /auth/me- header optional:
Authorization
Plans & billing
GET /plans- vraci aktivni plany (
free,pro,business)
POST /billing/subscribe- header:
Authorization: Bearer <token> - body:
{ "plan_code": "pro", "reason": "user_upgrade" }
Chat
POST /chat- header optional:
Authorization - header optional:
X-Guest-Id - body:
message(required)conversation_id(optional)system(optional)max_new_tokens,temperature,top_k(optional)
GET /chat/conversations- user: Bearer token
- guest: automaticky nebo pres
X-Guest-Id
GET /chat/conversations/{conversation_id}/messages- vraci messages jen vlastnikovi (user/guest)
Usage & learning status
GET /usage/me- vraci denni usage a limity
GET /learning/status- vraci posledni autodeploy report
- zdroj:
enoa_gpt/checkpoints/autodeploy_last.json
GET /learning/healthcheck- lehky operational health endpoint pro learning stack
- vraci:
prod_checkpoint_existscandidate_checkpoint_existsautodeploy_report_existsautodeploy_report_decisionautodeploy_report_age_minutes
GET /metrics- Prometheus text metrics endpoint
- obsahuje runtime/learning zakladni metriky (model loaded, checkpoint existence, report age)
GET /ops/recovery-status- operational endpoint pro watchdog/recovery stav
- vraci:
recovery_fail_countrestarts_totalrestarts_last_hourlast_restart_timerecent_log_lines
Monitoring auth:
- pokud je nastaveno
ENOAI_MONITOR_API_KEY, endpointy /learning/status/learning/healthcheck/metrics/ops/recovery-status
vyzaduji header X-Monitor-Key: <value>