Skip to main content

Get AI Summary (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/ai/summary

Description

Get AI usage summary including total usages, costs, and payment information.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with workspace permissions.

Headers

Authorization: Bearer <workspace_token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Response 200 OK

{
"totalUsages": 250,
"totalCost": 45.50,
"totalPaid": 40.00,
"outstandingBalance": 5.50,
"byToolType": {
"product-marketing-post": 150,
"image-generation": 80,
"session-summary": 15,
"other": 5
},
"byStatus": {
"completed": 240,
"pending": 5,
"failed": 5
}
}

Response Fields

  • totalUsages (number): Total number of AI tool usages
  • totalCost (number): Total cost of all AI operations
  • totalPaid (number): Total amount paid for AI
  • outstandingBalance (number): Outstanding balance (totalCost - totalPaid)
  • byToolType (object): Usage count grouped by tool type
  • byStatus (object): Usage count grouped by status (completed, pending, failed)

Common Errors

401 Unauthorized: Missing or invalid authentication token

404 Not Found: Workspace not found

500 Internal Server Error: Server error occurred while processing the request