mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-14 00:00:30 +00:00
Add AI cost export and top target rollups
This commit is contained in:
@@ -51,13 +51,17 @@ export class AIAPI {
|
||||
}
|
||||
|
||||
// Reset AI usage history (admin-only)
|
||||
static async resetCostHistory(): Promise<{ ok: boolean }> {
|
||||
static async resetCostHistory(): Promise<{ ok: boolean; backup_file?: string }> {
|
||||
return apiFetchJSON(`${this.baseUrl}/ai/cost/reset`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({}),
|
||||
}) as Promise<{ ok: boolean; backup_file?: string }>;
|
||||
}
|
||||
|
||||
static async exportCostHistory(days = 30, format: 'json' | 'csv' = 'csv'): Promise<Response> {
|
||||
return apiFetch(`${this.baseUrl}/ai/cost/export?days=${days}&format=${format}`, { method: 'GET' });
|
||||
}
|
||||
|
||||
// Start OAuth flow for Claude Pro/Max subscription
|
||||
// Returns the authorization URL to redirect the user to
|
||||
static async startOAuth(): Promise<{ auth_url: string; state: string }> {
|
||||
|
||||
Reference in New Issue
Block a user