Update: 2026-05-08 02:11:29
This commit is contained in:
14
scripts/create_ai_usage_table.sql
Normal file
14
scripts/create_ai_usage_table.sql
Normal 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;
|
||||
Reference in New Issue
Block a user