Skip to main content

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

ParameterTypeRequiredDescription
workspaceIdstringYesThe 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 usages
  • failedUsages (number): Number of failed AI usages
  • pendingUsages (number): Number of pending AI usages
  • totalCost (number): Total cost of all AI usages in USD
  • totalPaid (number): Total amount paid for AI services in USD
  • remainingBalance (number): Remaining balance (totalPaid - totalCost) in USD
  • minimumAllowedBalance (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