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_exists
  • candidate_checkpoint_exists
  • autodeploy_report_exists
  • autodeploy_report_decision
  • autodeploy_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_count
  • restarts_total
  • restarts_last_hour
  • last_restart_time
  • recent_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>