feat: Credits-System — Token-Usage-Router, Budget-Verwaltung, Frontend-Übersicht
- Neuer Router /api/token-usage mit Overview, Org-Detail, Monatsstatistik - Budget-Felder (credits_total, cost_per_credit, token_budget_usd) bei Lizenz-Erstellung - Token-Nutzung Sub-Tab in Org-Detail mit Verbrauchsbalken und Monatstabelle - Dashboard Stat-Card für API-Kosten gesamt - CSS Dark-Theme Styling für Token-Komponenten
Dieser Commit ist enthalten in:
@@ -40,6 +40,10 @@ class LicenseCreate(BaseModel):
|
||||
license_type: str = Field(pattern="^(trial|annual|permanent)$")
|
||||
max_users: int = Field(default=5, ge=1, le=1000)
|
||||
duration_days: Optional[int] = Field(default=None, ge=1, le=3650)
|
||||
token_budget_usd: Optional[float] = None
|
||||
credits_total: Optional[int] = None
|
||||
cost_per_credit: Optional[float] = None
|
||||
budget_warning_percent: Optional[int] = Field(default=80, ge=1, le=100)
|
||||
|
||||
|
||||
class LicenseResponse(BaseModel):
|
||||
@@ -51,6 +55,11 @@ class LicenseResponse(BaseModel):
|
||||
valid_until: Optional[str]
|
||||
status: str
|
||||
notes: Optional[str]
|
||||
token_budget_usd: Optional[float] = None
|
||||
credits_total: Optional[int] = None
|
||||
credits_used: Optional[float] = None
|
||||
cost_per_credit: Optional[float] = None
|
||||
budget_warning_percent: Optional[int] = None
|
||||
created_at: str
|
||||
|
||||
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren