Get AI Summary (v1)
Method & Path
GET /api/v1/workspace/:workspaceId/ai/summary
Description
Retrieves a summary of AI tool usage statistics for a workspace, including total usages, costs, and balance information.
Authentication
Required: Workspace authentication via session cookie.
Headers
Content-Type: application/json- Cookie with workspace session
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| workspaceId | string | Yes | The workspace ID |
Response 200 OK
{
"totalUsages": 450,
"completedUsages": 420,
"failedUsages": 20,
"pendingUsages": 10,
"totalCost": 89.75,
"totalPaid": 100.00,
"remainingBalance": 10.25,
"minimumAllowedBalance": 5.00
}
Fields:
totalUsages(number): Total number of AI tool usages (completed + failed + pending)completedUsages(number): Number of successfully completed AI usagesfailedUsages(number): Number of failed AI usagespendingUsages(number): Number of pending AI usagestotalCost(number): Total cost of all AI usages in USDtotalPaid(number): Total amount paid for AI services in USDremainingBalance(number): Remaining balance (totalPaid - totalCost) in USDminimumAllowedBalance(number): Minimum allowed balance before AI features are blocked (in USD)
Note: All monetary values are in USD (US Dollars) regardless of the workspace currency setting.
Common Errors
400 Bad Request: Invalid workspace ID format 404 Not Found: Workspace not found or access denied 401 Unauthorized: Authentication required 403 Forbidden: Subscription expired or insufficient permissions