Update: 2026-05-08 02:11:29

This commit is contained in:
Hamza-Ayed
2026-05-08 02:11:29 +03:00
parent 1cd511f12e
commit b49af44139
8 changed files with 491 additions and 164 deletions

View File

@@ -0,0 +1,14 @@
-- AI Usage Log — Token tracking for cost analysis
CREATE TABLE IF NOT EXISTS ai_usage_log (
id CHAR(36) PRIMARY KEY,
input_tokens INT UNSIGNED NOT NULL DEFAULT 0,
output_tokens INT UNSIGNED NOT NULL DEFAULT 0,
total_tokens INT UNSIGNED NOT NULL DEFAULT 0,
cost_usd DECIMAL(12, 8) NOT NULL DEFAULT 0,
cost_jod DECIMAL(12, 8) NOT NULL DEFAULT 0,
model VARCHAR(50) NOT NULL DEFAULT 'gemini-flash-lite',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_created (created_at),
INDEX idx_model (model)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;