apac-ops-bot/backend
SamoilenkoVadym d3aa58716d Restrict Usage view to admins only and document pricing
Changes:
1. Hide "📊 Usage" button from regular users - only admins can see statistics
2. Updated .env.example with detailed pricing documentation
3. Clarified that OpenAI API does NOT return costs, only token counts
4. Cost is calculated locally: (tokens / 1000) × price_per_1k

Cost Calculation:
- OpenAI API returns only usage.input_tokens and usage.output_tokens
- We calculate cost based on PROMPT_TOKEN_COST and COMPLETION_TOKEN_COST from .env
- Current values are placeholders - need to update with real prices from OpenAI pricing page
- Formula: cost = (prompt_tokens / 1000) × PROMPT_TOKEN_COST + (completion_tokens / 1000) × COMPLETION_TOKEN_COST

Admin-only features:
- 📊 Usage (token statistics)
- 👨‍💼 Admin (user management & analytics)

Regular users only see:
- 💬 Chat

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-27 20:12:08 +00:00
..
alembic Add test user authentication and RBAC admin panel 2026-01-27 20:05:54 +00:00
app Fix test user authentication issues 2026-01-27 20:09:07 +00:00
scripts Fix test user authentication issues 2026-01-27 20:09:07 +00:00
tests Implement OpenAI Responses API service with RAG enforcement 2026-01-27 14:26:43 +00:00
.env.example Restrict Usage view to admins only and document pricing 2026-01-27 20:12:08 +00:00
alembic.ini Add comprehensive backend test suite and Phase 1 foundation 2026-01-27 14:24:59 +00:00
Dockerfile Add comprehensive backend test suite and Phase 1 foundation 2026-01-27 14:24:59 +00:00
requirements-dev.txt Add comprehensive backend test suite and Phase 1 foundation 2026-01-27 14:24:59 +00:00
requirements.txt Add test user authentication and RBAC admin panel 2026-01-27 20:05:54 +00:00