{"openapi":"3.1.0","info":{"title":"Revenium Analytics API","version":"1.0.0","description":"Public API for accessing Revenium analytics data"},"servers":[{"url":"https://app.revenium.ai\r\n","description":"Revenium Platform API"}],"security":[{"Authorization":[]}],"components":{"securitySchemes":{"Authorization":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key authentication. Obtain your API key from the Revenium dashboard."}},"schemas":{},"parameters":{}},"paths":{"/api/v2/analytics/agent-tool-breakdown":{"get":{"tags":["Analytics"],"summary":"Get agent tool cost breakdown","description":"Returns cost per (agent, tool) pair for the specified date range, including tool type and call count.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get agent tool cost breakdown","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"data":{"type":"array","items":{"type":"object","properties":{"agentName":{"type":"string"},"toolName":{"type":"string"},"toolType":{"type":"string"},"totalCost":{"type":"number"},"totalCalls":{"type":"number"}},"required":["agentName","toolName","toolType","totalCost","totalCalls"]}},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"]}},"required":["id","resourceType","label","period","data","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/agents":{"get":{"tags":["Filter Options"],"summary":"Get available agents","description":"Returns distinct agent values for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available agents","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/api-keys":{"get":{"tags":["Filter Options"],"summary":"Get available API keys","description":"Returns distinct API key id/name pairs for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available API keys","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/customers":{"get":{"tags":["Filter Options"],"summary":"Get available customers","description":"Returns distinct customer id/name pairs for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available customers","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/task-types":{"get":{"tags":["Filter Options"],"summary":"Get available task types","description":"Returns distinct task type values for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available task types","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/model-sources":{"get":{"tags":["Filter Options"],"summary":"Get available model sources","description":"Returns distinct model source values for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available model sources","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/models":{"get":{"tags":["Filter Options"],"summary":"Get available models","description":"Returns distinct model values for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available models","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/organizations":{"get":{"tags":["Filter Options"],"summary":"Get available organizations","description":"Returns distinct organization id/name pairs for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available organizations","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/products":{"get":{"tags":["Filter Options"],"summary":"Get available products","description":"Returns distinct product id/name pairs for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available products","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/providers":{"get":{"tags":["Filter Options"],"summary":"Get available providers","description":"Returns distinct provider values for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available providers","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/teams":{"get":{"tags":["Filter Options"],"summary":"Get available teams","description":"Returns distinct team (subscriber) values for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available teams","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/tool-providers":{"get":{"tags":["Filter Options"],"summary":"Get available tool providers","description":"Returns distinct tool provider names for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available tool providers","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/tools":{"get":{"tags":["Filter Options"],"summary":"Get available tools","description":"Returns distinct tool IDs for the specified time period. Used to populate filter dropdowns for tool analytics.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available tools","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/users":{"get":{"tags":["Filter Options"],"summary":"Get available users","description":"Returns distinct subscriber email values for the specified time period. Used to populate user filter dropdowns for cost-by-user analytics.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["coding_assistant","revenium_metered","provider_billing"]},"default":["coding_assistant"]},"required":false,"name":"costSources","in":"query"}],"responses":{"200":{"description":"Get available users","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/filter-options/vendors":{"get":{"tags":["Filter Options"],"summary":"Get available vendors","description":"Returns distinct vendor values for the specified time period. Used to populate filter dropdowns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get available vendors","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/avg-time-by-agent":{"get":{"tags":["Analytics"],"summary":"Get average time by agent","description":"Returns the average request duration (in seconds) grouped by AI agent for the specified time period. Useful for identifying performance bottlenecks and optimizing agent configurations.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get average time by agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_avg_time_by_agent","resourceType":"metric_aggregated","label":"Average Time by Agent","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"agent-alpha","metrics":[{"metricResult":1.5,"metricType":"AVG_TIME_BY_AGENT","links":{"drill-down":{"href":"/v2/analytics/avg-time-by-agent?startDate=2026-01-01&endDate=2026-01-31&agents=agent-alpha"},"timeseries":{"href":"/v2/analytics/avg-time-by-agent?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/avg-time-by-agent?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/avg-time-by-agent?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/avg-time-by-agent?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/avg-time-by-agent?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/status/connection":{"get":{"tags":["Status"],"summary":"Get connection status","description":"Returns the last received timestamp for completion logs (SDK data) from ClickHouse. Use this to check whether the SDK is actively sending data.","responses":{"200":{"description":"Get connection status","content":{"application/json":{"schema":{"type":"object","properties":{"completion_logs":{"type":"object","properties":{"last_date_received":{"type":"string","nullable":true}},"required":["last_date_received"]}},"required":["completion_logs"]},"example":{"completion_logs":{"last_date_received":"2026-01-15T12:30:00.000Z"}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/iceberg-cost-by-agent":{"get":{"tags":["Analytics"],"summary":"Get iceberg cost breakdown by agent","description":"Returns per-agent cost data shaped for the iceberg chart: token costs as positive values (tip of the iceberg) and tool costs as negative values (hidden mass below), with tool costs broken down by individual tool name.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get iceberg cost breakdown by agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"data":{"type":"array","items":{"type":"object","properties":{"agentName":{"type":"string"},"toolName":{"type":"string"},"costType":{"type":"string"},"cost":{"type":"number"}},"required":["agentName","toolName","costType","cost"]}},"summary":{"type":"object","properties":{"totalTokenCost":{"type":"number"},"totalToolCost":{"type":"number"},"totalCost":{"type":"number"},"multiplier":{"type":"number","nullable":true}},"required":["totalTokenCost","totalToolCost","totalCost","multiplier"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"]}},"required":["id","resourceType","label","period","data","summary","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/jobs/roi-summary":{"get":{"tags":["Analytics"],"summary":"Get job type ROI summary","description":"Returns ROI metrics aggregated by job type for the specified date range, including cost breakdown, value, and overall ROI summary.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"string"},"required":false,"name":"jobType","in":"query"}],"responses":{"200":{"description":"Get job type ROI summary","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"byJobType":{"type":"array","items":{"type":"object","properties":{"jobType":{"type":"string"},"totalJobs":{"type":"number"},"totalCost":{"type":"number"},"tokenCost":{"type":"number"},"externalToolCost":{"type":"number"},"humanCost":{"type":"number"},"conversions":{"type":"number"},"deflections":{"type":"number"},"totalValue":{"type":"number"},"averageValue":{"type":"number"},"costPerConversion":{"type":"number"},"costPerOutcome":{"type":"number"},"roi":{"type":"number"},"successRate":{"type":"number"}},"required":["jobType","totalJobs","totalCost","tokenCost","externalToolCost","humanCost","conversions","deflections","totalValue","averageValue","costPerConversion","costPerOutcome","roi","successRate"]}},"summary":{"type":"object","properties":{"totalJobTypes":{"type":"number"},"totalJobs":{"type":"number"},"totalCost":{"type":"number"},"totalValue":{"type":"number"},"overallROI":{"type":"number"}},"required":["totalJobTypes","totalJobs","totalCost","totalValue","overallROI"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"]}},"required":["id","resourceType","label","period","byJobType","summary","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-agent":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by agent","description":"Returns cost metrics grouped by AI agent over time for the specified date range. Data is bucketed by an automatically determined interval (hourly, daily, or monthly) based on the time span. Useful for tracking agent cost trends and identifying spending patterns.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"agents","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["revenium_metered","provider_billing"]}},"required":false,"name":"costSource","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_cost_by_agent","resourceType":"metric_timeseries","label":"Cost by Agent","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"agent-alpha","metrics":[{"metricResult":21.5,"metricType":"COST_BY_AGENT_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/cost-by-agent?startDate=2026-01-01&endDate=2026-01-31&agents=agent-alpha"},"aggregated":{"href":"/v2/analytics/cost-by-agent-aggregated?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-agent?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-by-agent-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/cost-by-agent?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/cost-by-agent?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/cost-by-agent?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-agent?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-agent-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by agent","description":"Returns the total aggregated cost grouped by AI agent for the specified time period. Useful for comparing overall spending across different agents without time-series granularity. Results are paginated and include HAL-formatted links for navigation.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["revenium_metered","provider_billing"]}},"required":false,"name":"costSource","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_by_agent_aggregated","resourceType":"metric_aggregated","label":"Cost by Agent (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"agent-alpha","metrics":[{"metricResult":639.24,"metricType":"COST_METRIC_BY_AGENT","links":{"drill-down":{"href":"/v2/analytics/cost-by-agent?startDate=2026-01-01&endDate=2026-01-31&agents=agent-alpha"},"timeseries":{"href":"/v2/analytics/cost-by-agent?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-agent-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/cost-by-agent?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/cost-by-agent-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-agent-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-api-key":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by API key","description":"Returns cost metrics grouped by API key over time for the specified date range. Enables tracking of costs associated with specific API credentials, useful for identifying high-usage keys or allocating costs to specific integrations.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by API key","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_cost_by_api_key","resourceType":"metric_timeseries","label":"Cost by API Key","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"pk_live_abc123","metrics":[{"metricResult":15.75,"metricType":"COST_BY_CREDENTIAL_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/cost-by-api-key?startDate=2026-01-01&endDate=2026-01-31&entities=pk_live_abc123"},"aggregated":{"href":"/v2/analytics/cost-by-api-key-aggregated?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-api-key?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-by-api-key-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/cost-by-api-key?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/cost-by-api-key?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/cost-by-api-key?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-api-key?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-api-key-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by API key","description":"Returns the total aggregated cost grouped by API key for the specified time period. Provides a summary view of spending across different API keys without time-series breakdown.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by API key","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_by_api_key_aggregated","resourceType":"metric_aggregated","label":"Cost by API Key (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"pk_live_abc123","metrics":[{"metricResult":150.25,"metricType":"COST_METRIC_BY_API_KEY","links":{"drill-down":{"href":"/v2/analytics/cost-by-api-key?startDate=2026-01-01&endDate=2026-01-31&apiKeys[]=pk_live_abc123"},"timeseries":{"href":"/v2/analytics/cost-by-api-key?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-api-key-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"timeseries":{"href":"/v2/analytics/cost-by-api-key?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/cost-by-api-key-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-api-key-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-model":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by model","description":"Returns cost metrics grouped by AI model over time for the specified date range. Data is automatically bucketed by interval based on the time span. Useful for analyzing model cost trends and optimizing model selection based on cost efficiency.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"models","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"providers","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by model","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_cost_by_model","resourceType":"metric_timeseries","label":"Cost by Model","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"gpt-4","metrics":[{"metricResult":45.2,"metricType":"COST_METRIC_BY_MODEL_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/cost-by-model?startDate=2026-01-01&endDate=2026-01-31&models=gpt-4"},"aggregated":{"href":"/v2/analytics/cost-by-model-aggregated?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-model?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-by-model-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/cost-by-model?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/cost-by-model?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/cost-by-model?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-model?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-model-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by model","description":"Returns the total aggregated cost grouped by AI model for the specified time period. Provides a summary view of spending across different models (e.g., GPT-4, Claude, etc.) without time-series breakdown.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by model","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_by_model_aggregated","resourceType":"metric_aggregated","label":"Cost by Model (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"claude-3-5-sonnet-latest","metrics":[{"metricResult":313.34,"metricType":"COST_METRIC_BY_MODEL","links":{"drill-down":{"href":"/v2/analytics/cost-by-model?startDate=2026-01-01&endDate=2026-01-31&models=claude-3-5-sonnet-latest"},"timeseries":{"href":"/v2/analytics/cost-by-model?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-model-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/cost-by-model?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/cost-by-model-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-model-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-organization":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by organization","description":"Returns cost metrics grouped by organization over time for the specified date range. Enables cost allocation and tracking across different organizational units or business entities within your tenant.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by organization","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_cost_by_organization","resourceType":"metric_timeseries","label":"Cost by Organization","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"org-12345","metrics":[{"metricResult":125.5,"metricType":"COST_BY_ORGANIZATION_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/cost-by-organization?startDate=2026-01-01&endDate=2026-01-31&entities=org-12345"},"aggregated":{"href":"/v2/analytics/cost-by-organization-aggregated?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-organization?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-by-organization-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/cost-by-organization?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/cost-by-organization?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/cost-by-organization?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-organization?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-organization-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by organization","description":"Returns the total aggregated cost grouped by organization for the specified time period. Provides a summary view of spending across different organizations without time-series breakdown.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by organization","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_by_organization_aggregated","resourceType":"metric_aggregated","label":"Cost by Organization (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"Acme Corp","metrics":[{"metricResult":450.75,"metricType":"COST_METRIC_BY_ORGANIZATION","links":{"drill-down":{"href":"/v2/analytics/cost-by-organization?startDate=2026-01-01&endDate=2026-01-31&organizations[]=Acme+Corp"},"timeseries":{"href":"/v2/analytics/cost-by-organization?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-organization-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"timeseries":{"href":"/v2/analytics/cost-by-organization?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/cost-by-organization-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-organization-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-product":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by product","description":"Returns cost metrics grouped by product over time for the specified date range. Enables tracking of AI costs associated with specific products or services, useful for product-level P&L analysis and cost optimization.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"products","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["revenium_metered","provider_billing"]}},"required":false,"name":"costSource","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_cost_by_product","resourceType":"metric_timeseries","label":"Cost by Product","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"enterprise-edition","metrics":[{"metricResult":85.3,"metricType":"COST_BY_PRODUCT_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/cost-by-product?startDate=2026-01-01&endDate=2026-01-31&products=enterprise-edition"},"aggregated":{"href":"/v2/analytics/cost-by-product-aggregated?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-product?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-by-product-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/cost-by-product?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/cost-by-product?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/cost-by-product?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-product?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-product-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by product","description":"Returns the total aggregated cost grouped by product for the specified time period. Provides a summary view of AI spending attributed to each product without time-series granularity.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["revenium_metered","provider_billing"]}},"required":false,"name":"costSource","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_by_product_aggregated","resourceType":"metric_aggregated","label":"Cost by Product (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"pro-plan","metrics":[{"metricResult":493.65,"metricType":"COST_METRIC_BY_PRODUCT","links":{"drill-down":{"href":"/v2/analytics/cost-by-product?startDate=2026-01-01&endDate=2026-01-31&products=pro-plan"},"timeseries":{"href":"/v2/analytics/cost-by-product?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-product-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/cost-by-product?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/cost-by-product-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-product-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-provider":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by provider","description":"Returns cost metrics grouped by AI provider (e.g., OpenAI, Anthropic, Google) over time for the specified date range. Useful for comparing spending across different AI vendors and optimizing provider selection.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by provider","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_cost_by_provider","resourceType":"metric_timeseries","label":"Cost by Provider","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"Anthropic","metrics":[{"metricResult":156.8,"metricType":"COST_METRIC_BY_PROVIDER_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/cost-by-provider?startDate=2026-01-01&endDate=2026-01-31&providers=Anthropic"},"aggregated":{"href":"/v2/analytics/cost-by-provider-aggregated?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-provider?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-by-provider-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/cost-by-provider?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/cost-by-provider?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/cost-by-provider?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-provider?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-provider-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by provider","description":"Returns the total aggregated cost grouped by AI provider for the specified time period. Provides a summary view of spending across different providers (e.g., OpenAI, Anthropic) without time-series breakdown.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by provider","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_by_provider_aggregated","resourceType":"metric_aggregated","label":"Cost by Provider (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"OpenAI","metrics":[{"metricResult":450.75,"metricType":"COST_METRIC_BY_PROVIDER","links":{"drill-down":{"href":"/v2/analytics/cost-by-provider?startDate=2026-01-01&endDate=2026-01-31&providers[]=OpenAI"},"timeseries":{"href":"/v2/analytics/cost-by-provider?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-provider-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"timeseries":{"href":"/v2/analytics/cost-by-provider?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/cost-by-provider-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-provider-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-task":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by task type","description":"Returns cost metrics grouped by task type over time for the specified date range. Data is automatically bucketed by interval based on the time span.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["revenium_metered","provider_billing"]}},"required":false,"name":"costSource","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by task type","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-task-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by task type","description":"Returns the total aggregated cost grouped by task type for the specified time period.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["revenium_metered","provider_billing"]}},"required":false,"name":"costSource","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by task type","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-team":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by team","description":"Returns cost metrics grouped by team over time for the specified date range. Enables cost allocation and chargeback across different teams within your organization, supporting departmental budgeting and accountability.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by team","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_cost_by_team","resourceType":"metric_timeseries","label":"Cost by Team","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"engineering","metrics":[{"metricResult":234.5,"metricType":"COST_BY_TEAM_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/cost-by-team?startDate=2026-01-01&endDate=2026-01-31&entities=engineering"},"aggregated":{"href":"/v2/analytics/cost-by-team-aggregated?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-team?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-by-team-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/cost-by-team?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/cost-by-team?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/cost-by-team?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-team?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-user":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by user","description":"Returns cost, request count, and token metrics grouped by subscriber email over time. Data is bucketed by an automatically determined interval based on the time span. Each user group contains three metrics: cost, request count, and total tokens. Useful for attributing AI coding assistant spend to individual engineers.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["coding_assistant","revenium_metered","provider_billing"]},"default":["coding_assistant"]},"required":false,"name":"costSources","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"agents","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"providers","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"models","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"users","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by user","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_cost_by_user","resourceType":"metric_timeseries","label":"Cost by User","period":{"start":"2026-03-01T00:00:00.000Z","end":"2026-03-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-03-01T00:00:00.000Z","endTimestamp":"2026-03-01T23:59:59.999Z","groups":[{"groupName":"engineer@example.com","metrics":[{"metricResult":18.32,"metricType":"COST_BY_USER_OVER_TIME"},{"metricResult":42,"metricType":"REQUESTS_BY_USER_OVER_TIME"},{"metricResult":1500000,"metricType":"TOKENS_BY_USER_OVER_TIME"}]}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-user?startDate=2026-03-01&endDate=2026-03-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-by-user-aggregated?startDate=2026-03-01&endDate=2026-03-31"},"prev-period":{"href":"/v2/analytics/cost-by-user?startDate=2026-02-01&endDate=2026-02-28"},"next-period":{"href":"/v2/analytics/cost-by-user?startDate=2026-04-01&endDate=2026-04-30"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-user-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by user","description":"Returns total cost, request count, and token metrics grouped by subscriber email for the specified period. Each user group contains three metrics. Results are sorted by total cost descending. Useful for identifying top spenders and budget allocation per engineer.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["coding_assistant","revenium_metered","provider_billing"]},"default":["coding_assistant"]},"required":false,"name":"costSources","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"agents","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"providers","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"models","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"users","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by user","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_by_user_aggregated","resourceType":"metric_aggregated","label":"Cost by User (Aggregated)","period":{"start":"2026-03-01T00:00:00.000Z","end":"2026-03-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"engineer@example.com","metrics":[{"metricResult":549.59,"metricType":"COST_METRIC_BY_USER"},{"metricResult":1250,"metricType":"REQUEST_METRIC_BY_USER"},{"metricResult":45230000,"metricType":"TOKEN_METRIC_BY_USER"}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-user-aggregated?startDate=2026-03-01&endDate=2026-03-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/cost-by-user?startDate=2026-03-01&endDate=2026-03-31"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-tool":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by tool","description":"Returns cost metrics grouped by tool ID over time. Shows external tool and service costs for each registered tool.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"toolIds","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by tool","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-tool-agent":{"get":{"tags":["Analytics"],"summary":"Get tool cost by agent","description":"Returns total tool cost grouped by agent for the specified date range.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get tool cost by agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-tool-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by tool","description":"Returns total cost per tool for the specified date range without time bucketing. Includes tool type and provider metadata.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by tool","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-tool-provider":{"get":{"tags":["Analytics"],"summary":"Get cost breakdown by tool provider","description":"Returns cost metrics grouped by tool provider (e.g., Equifax, Plaid, Snowflake) over time.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"providers","in":"query"}],"responses":{"200":{"description":"Get cost breakdown by tool provider","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-tool-provider-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by tool provider","description":"Returns total cost per tool provider for the specified date range without time bucketing.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by tool provider","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-by-vendor":{"get":{"tags":["Analytics"],"summary":"Get cost by vendor","description":"Returns aggregated cost metrics grouped by vendor for the specified time period. Provides a consolidated view of spending across AI service providers, useful for vendor management and contract negotiations.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get cost by vendor","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_by_vendor","resourceType":"metric_aggregated","label":"Cost by Vendor","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"Anthropic","metrics":[{"metricResult":2239.36,"metricType":"COST_METRIC_BY_VENDOR","links":{"drill-down":{"href":"/v2/analytics/cost-by-vendor?startDate=2026-01-01&endDate=2026-01-31&entities=Anthropic"},"timeseries":{"href":"/v2/analytics/cost-by-vendor?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/cost-by-vendor?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/cost-by-vendor?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/cost-by-vendor?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-by-vendor?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/cost-per-customer":{"get":{"tags":["Analytics"],"summary":"Get cost per customer","description":"Returns aggregated cost metrics grouped by customer (subscriber) for the specified time period. Enables understanding of AI costs incurred to serve each customer, essential for pricing decisions and customer profitability analysis.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["revenium_metered","provider_billing"]}},"required":false,"name":"costSource","in":"query"}],"responses":{"200":{"description":"Get cost per customer","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_cost_per_customer","resourceType":"metric_aggregated","label":"Cost per Customer","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"globaltech-enterprises","metrics":[{"metricResult":641.58,"metricType":"COST_METRIC_BY_CUSTOMER","links":{"drill-down":{"href":"/v2/analytics/cost-per-customer?startDate=2026-01-01&endDate=2026-01-31&entities=globaltech-enterprises"},"timeseries":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/cost-per-customer?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/cost-per-customer?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/cost-per-customer?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/customer-cost":{"get":{"tags":["Analytics"],"summary":"Get customer cost over time","description":"Returns cost metrics per customer over time for the specified date range. Tracks how customer-attributed AI costs evolve, useful for identifying cost trends, detecting anomalies, and forecasting future customer-related expenses.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"customers","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["revenium_metered","provider_billing"]}},"required":false,"name":"costSource","in":"query"}],"responses":{"200":{"description":"Get customer cost over time","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_customer_cost","resourceType":"metric_timeseries","label":"Customer Cost Over Time","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"Acme Corp","metrics":[{"metricResult":6250.42,"metricType":"COST_BY_CUSTOMER_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31&customers=Acme%20Corp"},"aggregated":{"href":"/v2/analytics/cost-per-customer?startDate=2026-01-01&endDate=2026-01-31"}}}]},{"groupName":"Beta Inc","metrics":[{"metricResult":3834.75,"metricType":"COST_BY_CUSTOMER_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31&customers=Beta%20Inc"},"aggregated":{"href":"/v2/analytics/cost-per-customer?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/cost-per-customer?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/customer-cost?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/customer-cost?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/customer-cost-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated cost by customer","description":"Returns the total aggregated cost grouped by customer for the specified time period. Provides a summary view of spending across different customers without time-series breakdown.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get aggregated cost by customer","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_customer_cost_aggregated","resourceType":"metric_aggregated","label":"Customer Cost (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"customer-123","metrics":[{"metricResult":250.5,"metricType":"COST_METRIC_BY_CUSTOMER","links":{"drill-down":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31&customers[]=customer-123"},"timeseries":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/customer-cost-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"timeseries":{"href":"/v2/analytics/customer-cost?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/customer-cost-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/customer-cost-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/profit-margin-per-customer":{"get":{"tags":["Analytics"],"summary":"Get profit margin per customer","description":"Returns profit margin metrics (revenue minus cost) grouped by customer for the specified time period. Calculates the profitability of AI services for each customer, essential for identifying high-value customers and optimizing pricing strategies.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get profit margin per customer","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_profit_margin_per_customer","resourceType":"metric_aggregated","label":"Profit Margin per Customer","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"globaltech-enterprises","metrics":[{"metricResult":25.5,"metricType":"PROFIT_MARGIN_BY_CUSTOMER","links":{"drill-down":{"href":"/v2/analytics/profit-margin-per-customer?startDate=2026-01-01&endDate=2026-01-31&entities=globaltech-enterprises"},"timeseries":{"href":"/v2/analytics/profit-margin-per-customer?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/profit-margin-per-customer?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/profit-margin-per-customer?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/profit-margin-per-customer?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/profit-margin-per-customer?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/profit-margin-per-product":{"get":{"tags":["Analytics"],"summary":"Get profit margin per product","description":"Returns profit margin metrics (revenue minus cost) grouped by product for the specified time period. Enables product-level profitability analysis to identify which AI-powered products or features generate the most value.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get profit margin per product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_profit_margin_per_product","resourceType":"metric_aggregated","label":"Profit Margin per Product","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"enterprise-edition","metrics":[{"metricResult":32.8,"metricType":"PROFIT_MARGIN_BY_PRODUCT","links":{"drill-down":{"href":"/v2/analytics/profit-margin-per-product?startDate=2026-01-01&endDate=2026-01-31&products=enterprise-edition"},"timeseries":{"href":"/v2/analytics/profit-margin-per-product?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/profit-margin-per-product?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/profit-margin-per-product?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/profit-margin-per-product?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/profit-margin-per-product?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/response-time-by-model":{"get":{"tags":["Analytics"],"summary":"Get response time by model","description":"Returns average response time (latency) metrics grouped by AI model for the specified time period. Useful for performance monitoring, SLA compliance, and model selection based on speed requirements.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get response time by model","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_response_time_by_model","resourceType":"metric_aggregated","label":"Response Time by Model","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"gpt-4","metrics":[{"metricResult":5,"metricType":"RESPONSE_TIME_BY_MODEL","links":{"drill-down":{"href":"/v2/analytics/response-time-by-model?startDate=2026-01-01&endDate=2026-01-31&models=gpt-4"},"timeseries":{"href":"/v2/analytics/response-time-by-model?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/response-time-by-model?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/response-time-by-model?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/response-time-by-model?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/response-time-by-model?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/response-time-by-vendor":{"get":{"tags":["Analytics"],"summary":"Get response time by vendor","description":"Returns average response time (latency) metrics grouped by AI vendor for the specified time period. Enables comparison of provider performance, useful for vendor evaluation and ensuring quality of service across different AI providers.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get response time by vendor","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_response_time_by_vendor","resourceType":"metric_aggregated","label":"Response Time by Vendor","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"OpenAI","metrics":[{"metricResult":1.36,"metricType":"RESPONSE_TIME_BY_VENDOR","links":{"drill-down":{"href":"/v2/analytics/response-time-by-vendor?startDate=2026-01-01&endDate=2026-01-31&providers=OpenAI"},"timeseries":{"href":"/v2/analytics/response-time-by-vendor?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/response-time-by-vendor?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/response-time-by-vendor?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/response-time-by-vendor?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/response-time-by-vendor?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/revenue-per-customer":{"get":{"tags":["Analytics"],"summary":"Get revenue per customer","description":"Returns revenue metrics grouped by customer (subscriber) for the specified time period. Tracks the revenue generated from AI services attributed to each customer, essential for customer value analysis and revenue forecasting.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get revenue per customer","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_revenue_per_customer","resourceType":"metric_aggregated","label":"Revenue per Customer","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"streamflow-technologies","metrics":[{"metricResult":130.82,"metricType":"REVENUE_METRIC_BY_CUSTOMER","links":{"drill-down":{"href":"/v2/analytics/revenue-per-customer?startDate=2026-01-01&endDate=2026-01-31&entities=streamflow-technologies"},"timeseries":{"href":"/v2/analytics/revenue-per-customer?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/revenue-per-customer?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/revenue-per-customer?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/revenue-per-customer?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/revenue-per-customer?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/revenue-per-product":{"get":{"tags":["Analytics"],"summary":"Get revenue per product","description":"Returns revenue metrics grouped by product for the specified time period. Enables tracking of AI-generated revenue by product line, useful for product performance analysis and strategic planning.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get revenue per product","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_revenue_per_product","resourceType":"metric_aggregated","label":"Revenue per Product","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"enterprise-edition","metrics":[{"metricResult":450.25,"metricType":"REVENUE_METRIC_BY_PRODUCT","links":{"drill-down":{"href":"/v2/analytics/revenue-per-product?startDate=2026-01-01&endDate=2026-01-31&products=enterprise-edition"},"timeseries":{"href":"/v2/analytics/revenue-per-product?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/revenue-per-product?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/revenue-per-product?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/revenue-per-product?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/revenue-per-product?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/task-completion-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated task completion count","description":"Returns the total count of completed tasks for the specified time period. Optionally filter by specific agents. Useful for getting a single summary metric without time-series breakdown.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"agents","in":"query"}],"responses":{"200":{"description":"Get aggregated task completion count","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_task_completion_aggregated","resourceType":"metric_aggregated","label":"Task Completion (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"Tasks Completed","metrics":[{"metricResult":1993,"metricType":"TASK_COMPLETION_AGGREGATED","links":{"timeseries":{"href":"/v2/analytics/task-completion?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/task-completion-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/task-completion?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/task-completion-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/task-completion-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/task-completion":{"get":{"tags":["Analytics"],"summary":"Get task completion over time","description":"Returns the number of completed tasks over time for the specified date range. Data is bucketed by an automatically determined interval (hourly, daily, or monthly) based on the time span. Optionally filter by a specific agent.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string"}},"required":false,"name":"agents","in":"query"}],"responses":{"200":{"description":"Get task completion over time","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_task_completion","resourceType":"metric_timeseries","label":"Task Completion","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"Tasks Completed","metrics":[{"metricResult":156,"metricType":"TASK_COMPLETION_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/task-completion?startDate=2026-01-01&endDate=2026-01-01"}}}]}]},{"startTimestamp":"2026-01-02T00:00:00.000Z","endTimestamp":"2026-01-02T23:59:59.999Z","groups":[{"groupName":"Tasks Completed","metrics":[{"metricResult":203,"metricType":"TASK_COMPLETION_OVER_TIME","links":{"drill-down":{"href":"/v2/analytics/task-completion?startDate=2026-01-02&endDate=2026-01-02"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/task-completion?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"prev-period":{"href":"/v2/analytics/task-completion?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/task-completion?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/task-completion?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/task-completion?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/task-performance-by-agent":{"get":{"tags":["Analytics"],"summary":"Get task performance by agent","description":"Returns task completion and performance metrics grouped by AI agent for the specified time period. Includes success rates, completion times, and efficiency metrics. Useful for evaluating agent effectiveness and optimizing agent configurations.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get task performance by agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_task_performance_by_agent","resourceType":"metric_aggregated","label":"Task Performance by Agent","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"agent-alpha","metrics":[{"metricResult":486,"metricType":"TASK_PERFORMANCE_BY_AGENT","links":{"drill-down":{"href":"/v2/analytics/task-performance-by-agent?startDate=2026-01-01&endDate=2026-01-31&agents=agent-alpha"},"timeseries":{"href":"/v2/analytics/task-performance-by-agent?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/task-performance-by-agent?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/task-performance-by-agent?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/task-performance-by-agent?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/task-performance-by-agent?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/tasks-completed-by-agent":{"get":{"tags":["Analytics"],"summary":"Get tasks completed by agent","description":"Returns the number of tasks completed grouped by AI agent for the specified time period. Useful for measuring agent productivity and workload distribution.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get tasks completed by agent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_tasks_completed_by_agent","resourceType":"metric_aggregated","label":"Tasks Completed by Agent","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"agent-alpha","metrics":[{"metricResult":150,"metricType":"TASKS_COMPLETED_BY_AGENT","links":{"drill-down":{"href":"/v2/analytics/tasks-completed-by-agent?startDate=2026-01-01&endDate=2026-01-31&agents=agent-alpha"},"timeseries":{"href":"/v2/analytics/tasks-completed-by-agent?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/tasks-completed-by-agent?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/tasks-completed-by-agent?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/tasks-completed-by-agent?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/tasks-completed-by-agent?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/tool-latency":{"get":{"tags":["Analytics"],"summary":"Get average tool latency","description":"Returns the average execution duration in milliseconds per tool for the specified date range.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get average tool latency","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/tool-success-rate":{"get":{"tags":["Analytics"],"summary":"Get tool success rate","description":"Returns the success rate (percentage) per tool for the specified date range, ordered from lowest to highest.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get tool success rate","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/token-breakdown-by-type":{"get":{"tags":["Analytics"],"summary":"Get token usage broken down by type","description":"Returns token consumption over time grouped by token type: Input, Output, Cache Read, and Cache Creation. Useful for understanding prompt caching effectiveness — the ratio of Cache Read to Input tokens indicates how much of the prompt is being served from cache.","parameters":[{"schema":{"type":"string","nullable":true},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"array","items":{"type":"string"}},"required":false,"name":"providers","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get token usage broken down by type","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_token_breakdown_by_type","resourceType":"metric_timeseries","label":"Token Breakdown by Type","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"Cache Read","metrics":[{"metricResult":152000,"metricType":"TOKEN_BREAKDOWN_BY_TYPE","links":{}}]},{"groupName":"Input","metrics":[{"metricResult":18000,"metricType":"TOKEN_BREAKDOWN_BY_TYPE","links":{}}]}]}]},"_links":{"self":{"href":"/v2/analytics/token-breakdown-by-type?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/tokens-per-minute":{"get":{"tags":["Analytics"],"summary":"Get tokens per minute by provider","description":"Returns token throughput metrics (tokens processed per minute) grouped by provider for the specified time period. Useful for capacity planning, rate limit monitoring, and understanding usage patterns across different AI providers.","parameters":[{"schema":{"type":"string","nullable":true},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"array","items":{"type":"string"}},"required":false,"name":"providers","in":"query"},{"schema":{"type":"string","enum":["INPUT","OUTPUT","REASONING","CACHED","TOTAL"]},"required":false,"name":"tokenType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get tokens per minute by provider","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_tokens_per_minute","resourceType":"metric_timeseries","label":"Tokens per Minute","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"OpenAI","metrics":[{"metricResult":1250,"metricType":"TOKENS_PER_MINUTE","links":{"drill-down":{"href":"/v2/analytics/tokens-per-minute?startDate=2026-01-01&endDate=2026-01-31&providers=OpenAI"},"aggregated":{"href":"/v2/analytics/tokens-per-minute-aggregated?startDate=2026-01-01&endDate=2026-01-31"}}}]}]}]},"_links":{"self":{"href":"/v2/analytics/tokens-per-minute?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"aggregated":{"href":"/v2/analytics/tokens-per-minute-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"prev-period":{"href":"/v2/analytics/tokens-per-minute?startDate=2025-12-01&endDate=2025-12-31"},"next-period":{"href":"/v2/analytics/tokens-per-minute?startDate=2026-02-01&endDate=2026-02-28"},"first":{"href":"/v2/analytics/tokens-per-minute?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/tokens-per-minute?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/tokens-per-minute-aggregated":{"get":{"tags":["Analytics"],"summary":"Get aggregated tokens per minute","description":"Returns the average tokens per minute grouped by provider for the specified time period. Provides a summary view of token throughput across different providers without time-series breakdown.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get aggregated tokens per minute","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_tokens_per_minute_aggregated","resourceType":"metric_aggregated","label":"Tokens per Minute (Aggregated)","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"OpenAI","metrics":[{"metricResult":15000,"metricType":"TOKENS_PER_MINUTE_AGGREGATED","links":{"drill-down":{"href":"/v2/analytics/tokens-per-minute?startDate=2026-01-01&endDate=2026-01-31&providers[]=OpenAI"},"timeseries":{"href":"/v2/analytics/tokens-per-minute?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/tokens-per-minute-aggregated?startDate=2026-01-01&endDate=2026-01-31"},"timeseries":{"href":"/v2/analytics/tokens-per-minute?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/tokens-per-minute-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/tokens-per-minute-aggregated?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/token-vs-tool-cost":{"get":{"tags":["Analytics"],"summary":"Get token vs tool cost comparison","description":"Returns cost metrics grouped by cost category (Token Costs vs Tool Costs) over time. Shows the dramatic contrast between AI token costs and external tool/service costs.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get token vs tool cost comparison","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_timeseries_token_vs_tool_cost","resourceType":"metric_timeseries","label":"Token vs Tool Cost","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"startTimestamp":"2026-01-01T00:00:00.000Z","endTimestamp":"2026-01-01T23:59:59.999Z","groups":[{"groupName":"Token Costs","metrics":[{"metricResult":5.8,"metricType":"TOKEN_VS_TOOL_COST","links":{}}]},{"groupName":"Tool Costs","metrics":[{"metricResult":1250,"metricType":"TOKEN_VS_TOOL_COST","links":{}}]}]}]},"_links":{"self":{"href":"/v2/analytics/token-vs-tool-cost?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/top-movers":{"get":{"tags":["Analytics"],"summary":"Get top movers by cost change","description":"Returns entities (models, agents, products, etc.) with the largest cost changes compared to a previous period. Identifies significant increases or decreases in spending, useful for anomaly detection, trend analysis, and proactive cost management.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"string","enum":["model","agent","product","customer"],"default":"model"},"required":false,"name":"groupBy","in":"query"}],"responses":{"200":{"description":"Get top movers by cost change","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_top_movers","resourceType":"metric_aggregated","label":"Top Movers by model","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"gpt-4","metrics":[{"metricResult":100,"metricType":"TOP_MOVERS","currentValue":0.27,"previousValue":0,"trend":"new","links":{"drill-down":{"href":"/v2/analytics/top-movers?startDate=2026-01-01&endDate=2026-01-31&models=gpt-4"},"timeseries":{"href":"/v2/analytics/top-movers?startDate=2026-01-01&endDate=2026-01-31"}}}]}]},"_links":{"self":{"href":"/v2/analytics/top-movers?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"timeseries":{"href":"/v2/analytics/top-movers?startDate=2026-01-01&endDate=2026-01-31"},"first":{"href":"/v2/analytics/top-movers?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/top-movers?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/top-tools-by-call-count":{"get":{"tags":["Analytics"],"summary":"Get top tools by call count","description":"Returns tools ranked by total call count for the specified date range, paginated via page/size.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get top tools by call count","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/trace-cost-distribution":{"get":{"tags":["Analytics"],"summary":"Get trace-level cost distribution","description":"Returns per-trace cost data points (up to 500 most expensive) with distribution summary stats (p50, p90, p95, p99, mean, stddev). Optionally accepts a threshold parameter to count traces exceeding it.","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"threshold","in":"query"}],"responses":{"200":{"description":"Get trace-level cost distribution","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"dataPoints":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"agentName":{"type":"string"},"totalCost":{"type":"number"},"totalCalls":{"type":"number"},"distinctTools":{"type":"number"},"traceStart":{"type":"string"},"traceEnd":{"type":"string"}},"required":["transactionId","agentName","totalCost","totalCalls","distinctTools","traceStart","traceEnd"]}},"summary":{"type":"object","properties":{"p50":{"type":"number"},"p90":{"type":"number"},"p95":{"type":"number"},"p99":{"type":"number"},"mean":{"type":"number"},"stddev":{"type":"number"},"totalTraces":{"type":"number"},"tracesAboveThreshold":{"type":"number","nullable":true}},"required":["p50","p90","p95","p99","mean","stddev","totalTraces","tracesAboveThreshold"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"]}},"required":["id","resourceType","label","period","dataPoints","summary","_links"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/analytics/transaction-count-by-team":{"get":{"tags":["Analytics"],"summary":"Get total transaction count by team","description":"Returns the total number of AI transactions for the team over the specified date range. Provides a single summary metric (transaction volume) without time-series or per-entity breakdown, answering \"how many transactions did I have this period\".","parameters":[{"schema":{"type":"string","format":"date-time","example":"2024-01-01T00:00:00.000Z"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","format":"date-time","example":"2024-01-31T23:59:59.000Z"},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"string","enum":["sum","avg","max","min","count","median","p50","p90","p95","p99"]},"required":false,"name":"metricType","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"size","in":"query"}],"responses":{"200":{"description":"Get total transaction count by team","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceType":{"type":"string"},"label":{"type":"string"},"created":{"type":"string","format":"date-time"},"updated":{"type":"string","nullable":true,"format":"date-time"},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"_embedded":{"type":"object","properties":{"items":{"type":"array","items":{"nullable":true}}},"required":["items"]},"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"required":["self"],"additionalProperties":{"type":"object","properties":{"href":{"type":"string"}},"required":["href"]}},"page":{"type":"object","properties":{"size":{"type":"integer","minimum":0,"exclusiveMinimum":true},"totalElements":{"type":"integer","minimum":0},"totalPages":{"type":"integer","minimum":0},"number":{"type":"integer","minimum":0}},"required":["size","totalElements","totalPages","number"]}},"required":["id","resourceType","label","created","updated","period","_embedded","_links"]},"example":{"id":"metric_aggregated_transaction_count_by_team","resourceType":"metric_aggregated","label":"Transaction Count by Team","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-31T23:59:59.000Z"},"_embedded":{"items":[{"groupName":"Transaction Count","metrics":[{"metricResult":48213,"metricType":"TRANSACTION_COUNT_BY_TEAM","links":{}}]}]},"_links":{"self":{"href":"/v2/analytics/transaction-count-by-team?startDate=2026-01-01&endDate=2026-01-31"},"collection":{"href":"/v2/analytics"},"first":{"href":"/v2/analytics/transaction-count-by-team?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"},"last":{"href":"/v2/analytics/transaction-count-by-team?startDate=2026-01-01&endDate=2026-01-31&page=0&size=20"}}}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/insights/runs/{runId}":{"get":{"tags":["Insights"],"summary":"Get insights run","description":"Fetch a single AI insights run by ID, scoped to the authenticated team.\n\nThe `dashboard_url` field is a direct link to the Insights page in the Revenium UI for this run.\n\n**Full mode (default, `slim=false`)**: Returns all fields including `findingsJson`, `recommendationsJson`, and `batchMetadataJson` (raw JSON strings requiring `JSON.parse`), plus pre-parsed equivalents `parsedFindings`, `parsedRecommendations`, and `parsedBatchMetadata` for MCP consumers. Use `findingsCount` and `recommendationsCount` for quick metadata checks without parsing.\n\n**Slim mode (`slim=true`)**: Omits `findingsJson`, `recommendationsJson`, `parsedFindings`, and `parsedRecommendations`. Instead returns `recommendationsSummary: [{ id, title, rank, severity, monthlyImpact, confidenceBand, category }]` — a compact ranked list safe to inline in MCP tool responses without exceeding context budgets. `batchMetadataJson` and `parsedBatchMetadata` are still included. Use `findingsTruncated` and `findingsConsideredCount` to detect whether findings were capped before synthesis.","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"anyOf":[{"type":"boolean"},{"type":"string"}],"default":false},"required":false,"name":"slim","in":"query"}],"responses":{"200":{"description":"Get insights run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"number"},"triggeredBy":{"type":"string"},"triggeredByUserId":{"type":"string"},"triggeredByApiKeyHint":{"type":"string"},"status":{"type":"string","enum":["running","completed","partial","failed","cancelled"]},"statusMessage":{"type":"string"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"filterAgent":{"type":"array","items":{"type":"string"}},"filterProductId":{"type":"array","items":{"type":"string"}},"filterTraceType":{"type":"array","items":{"type":"string"}},"filterConsumingOrgId":{"type":"array","items":{"type":"string"}},"filterEnvironment":{"type":"string"},"filterIncludeCodingAssistants":{"type":"number"},"filterIncludeCodingAssistantsForCostDetectors":{"type":"number"},"findingsJson":{"type":"string"},"findingsCount":{"type":"number"},"recommendationsJson":{"type":"string"},"recommendationsCount":{"type":"number"},"failedInvestigators":{"type":"array","items":{"type":"string"},"default":[]},"batchMetadataJson":{"type":"string","default":"{}"},"llmModel":{"type":"string"},"llmInputTokens":{"type":"number"},"llmOutputTokens":{"type":"number"},"llmCost":{"anyOf":[{"type":"string"},{"type":"number"}]},"engineVersion":{"type":"string"},"modelPricingVersion":{"type":"string"},"stage0DurationMs":{"type":"number"},"stage1DurationMs":{"type":"number"},"stage2DurationMs":{"type":"number"},"stage3DurationMs":{"type":"number"},"totalDurationMs":{"type":"number"},"created":{"type":"string"},"updated":{"type":"string"},"isActive":{"type":"number"},"findingsTruncated":{"type":"boolean","default":false},"findingsConsideredCount":{"type":"number","default":0},"parsedFindings":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"parsedRecommendations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"runId":{"type":"string"},"title":{"type":"string","minLength":10,"maxLength":150},"body":{"type":"string","minLength":50,"maxLength":2000},"category":{"type":"string","enum":["waste","surprise","concentration","reliability","outcome"]},"severity":{"type":"string","enum":["info","low","medium","high","critical"]},"entities":{"type":"array","items":{"type":"object","properties":{"dimension":{"type":"string","enum":["agent","model","provider","trace_type","trace_name","operation_type","operation_subtype","task_type","product_id","product_name","subscription_id","subscriber","consuming_org_id","api_key","credential_id","squad_id","squad_name","environment","region","agentic_job_type","cost_source","coding_assistant_account_uuid"]},"value":{"type":"string","minLength":1,"maxLength":200},"displayLabel":{"type":"string","maxLength":200}},"required":["dimension","value"]},"minItems":1},"impactEstimate":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"monthlyImpact":{"type":"number"},"confidenceBand":{"type":"string","enum":["low","medium","high"]},"basis":{"type":"string","minLength":10,"maxLength":500}},"required":["currency","monthlyImpact","confidenceBand","basis"]},"suggestedAction":{"type":"object","properties":{"summary":{"type":"string","minLength":10,"maxLength":300},"accountableRole":{"type":"string","enum":["platform_engineer","ai_engineer","devops","finops_lead","product_owner","security","executive","unknown"]},"steps":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":10},"references":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["label","url"]}}},"required":["summary","accountableRole","steps"]},"citations":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1},"confidence":{"type":"number","minimum":0,"maximum":1},"rank":{"type":"integer","minimum":0,"exclusiveMinimum":true},"expiresAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","runId","title","body","category","severity","entities","impactEstimate","suggestedAction","citations","confidence","rank","createdAt"]}},"parsedBatchMetadata":{"type":"object","additionalProperties":{"nullable":true}},"recommendationsSummary":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"rank":{"type":"number"},"severity":{"type":"string"},"monthlyImpact":{"type":"number"},"confidenceBand":{"type":"string"},"category":{"type":"string"}},"required":["id","title","rank","severity","monthlyImpact","confidenceBand","category"]}},"dashboard_url":{"type":"string"},"feedback":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"number"},"runId":{"type":"string"},"recommendationId":{"type":"string"},"action":{"type":"string","enum":["acknowledged","implemented","dismissed","not_applicable","already_aware"]},"dismissalReason":{"type":"string"},"confidenceRating":{"type":"number"},"actorUserId":{"type":"string"},"actorApiKeyHint":{"type":"string"},"realizedSavings":{"anyOf":[{"type":"string"},{"type":"number"}]},"realizedSavingsCurrency":{"type":"string","minLength":3,"maxLength":3},"realizedSavingsMeasuredAt":{"type":"string","nullable":true},"created":{"type":"string"},"isActive":{"type":"number"}},"required":["id","teamId","runId","recommendationId","action","dismissalReason","confidenceRating","actorUserId","actorApiKeyHint","realizedSavings","realizedSavingsCurrency","realizedSavingsMeasuredAt","created","isActive"]}}},"required":["id","teamId","triggeredBy","triggeredByUserId","triggeredByApiKeyHint","status","statusMessage","periodStart","periodEnd","filterAgent","filterProductId","filterTraceType","filterConsumingOrgId","filterEnvironment","filterIncludeCodingAssistants","filterIncludeCodingAssistantsForCostDetectors","findingsCount","recommendationsCount","llmModel","llmInputTokens","llmOutputTokens","llmCost","engineVersion","modelPricingVersion","stage0DurationMs","stage1DurationMs","stage2DurationMs","stage3DurationMs","totalDurationMs","created","updated","isActive","feedback"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/insights/investigators":{"get":{"tags":["Insights"],"summary":"List investigators","description":"Returns the list of all registered AI cost-intelligence investigators (detectors) available for the insights engine. Each entry includes:\n\n- `id` — the stable string identifier used in `excludeInvestigatorIds` when calling `POST /insights/runs`\n- `displayName` — human-readable label for UI display\n- `category` — the finding category this investigator emits (e.g. `retry_waste`, `outdated_model`, `error_concentration`)\n- `version` — the investigator version string\n\nUse this endpoint to discover valid values for `excludeInvestigatorIds` before submitting a run. An MCP agent can call this once to build the exclusion list for the `runRecommendations` tool. The list reflects the investigators currently deployed on the server — check this endpoint rather than relying on hard-coded IDs.","responses":{"200":{"description":"List investigators","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"category":{"type":"string"},"version":{"type":"string"}},"required":["id","displayName","category","version"]}},"example":[{"id":"retry-waste","displayName":"Retry Waste","category":"retry_waste","version":"1.0.0"}]}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/insights/runs/{runId}/feedback":{"get":{"tags":["Insights"],"summary":"List insights feedback","description":"List all feedback events for an insights run, scoped to the authenticated team.","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"List insights feedback","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"number"},"runId":{"type":"string"},"recommendationId":{"type":"string"},"action":{"type":"string","enum":["acknowledged","implemented","dismissed","not_applicable","already_aware"]},"dismissalReason":{"type":"string"},"confidenceRating":{"type":"number"},"actorUserId":{"type":"string"},"actorApiKeyHint":{"type":"string"},"realizedSavings":{"anyOf":[{"type":"string"},{"type":"number"}]},"realizedSavingsCurrency":{"type":"string","minLength":3,"maxLength":3},"realizedSavingsMeasuredAt":{"type":"string","nullable":true},"created":{"type":"string"},"isActive":{"type":"number"}},"required":["id","teamId","runId","recommendationId","action","dismissalReason","confidenceRating","actorUserId","actorApiKeyHint","realizedSavings","realizedSavingsCurrency","realizedSavingsMeasuredAt","created","isActive"]}},"example":[]}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/insights/runs":{"get":{"tags":["Insights"],"summary":"List insights runs","description":"List recent AI insights runs for the authenticated team, ordered by creation date descending. Each item includes summary counts (`findingsCount`, `recommendationsCount`) without the full JSON payloads.\n\n**Pagination**: Pass the `next_cursor` from a previous response as `?cursor=` to fetch the next page. A `null` `next_cursor` means you have reached the last page.\n\n**Filters**: `?status=completed`, `?since=2024-01-01T00:00:00Z`, `?until=2024-01-31T23:59:59Z`, `?triggered_by=api`\n\nThe `status` field is one of: `running`, `completed`, `partial`, `failed`, `cancelled`.","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["running","completed","partial","failed","cancelled"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"since","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"until","in":"query"},{"schema":{"type":"string","enum":["user","system","schedule","api"]},"required":false,"name":"triggered_by","in":"query"}],"responses":{"200":{"description":"List insights runs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string"},"triggeredBy":{"type":"string"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"findingsCount":{"type":"number"},"recommendationsCount":{"type":"number"},"created":{"type":"string"},"dashboard_url":{"type":"string"}},"required":["runId","status","triggeredBy","periodStart","periodEnd","findingsCount","recommendationsCount","created"]}},"next_cursor":{"type":"string","nullable":true}},"required":["data","next_cursor"]},"example":{"data":[],"next_cursor":null}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}},"post":{"tags":["Insights"],"summary":"Trigger an insights run","description":"Trigger a new AI insights analysis run for the team. Returns `202 Accepted` immediately with the `runId` and initial `status`. Poll `GET /api/v2/insights/runs/{runId}` until `status` transitions to `completed`, `partial`, or `failed`.\n\nA `Location` response header points directly to the polling URL.\n\nIn local development (no `ANALYSIS_LAMBDA_ARN` set), the run executes synchronously and the response header `X-Local-Sync-Fallback: true` is set — the run will already be complete when the 202 is received.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"periodStart":{"type":"string","nullable":true},"periodEnd":{"type":"string","nullable":true},"filterAgent":{"type":"array","items":{"type":"string"},"default":[]},"filterProductId":{"type":"array","items":{"type":"string"},"default":[]},"filterTraceType":{"type":"array","items":{"type":"string"},"default":[]},"filterConsumingOrgId":{"type":"array","items":{"type":"string"},"default":[]},"filterEnvironment":{"type":"string","default":""},"filterIncludeCodingAssistants":{"type":"boolean","default":true},"filterIncludeCodingAssistantsForCostDetectors":{"type":"boolean","default":false},"excludeInvestigatorIds":{"type":"array","items":{"type":"string"}}},"required":["periodStart","periodEnd"]}}}},"responses":{"202":{"description":"Trigger an insights run","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string","enum":["running","completed","partial","failed"]}},"required":["runId","status"]},"example":{"runId":"550e8400-e29b-41d4-a716-446655440000","status":"running"}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}},"/api/v2/insights/feedback":{"post":{"tags":["Insights"],"summary":"Post insights feedback","description":"Record a feedback action on a specific recommendation within an insights run. Feedback events are append-only.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"recommendationId":{"type":"string"},"action":{"type":"string","enum":["acknowledged","implemented","dismissed","not_applicable","already_aware"]},"dismissalReason":{"type":"string","default":""},"confidenceRating":{"type":"integer","minimum":-1,"maximum":1},"realizedSavings":{"type":"number","nullable":true,"default":0},"realizedSavingsCurrency":{"type":"string","pattern":"^[A-Za-z]{3}$","default":"USD"},"realizedSavingsMeasuredAt":{"type":"string","nullable":true,"default":null}},"required":["runId","recommendationId","action","confidenceRating"]}}}},"responses":{"200":{"description":"Post insights feedback","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"number"},"runId":{"type":"string"},"recommendationId":{"type":"string"},"action":{"type":"string","enum":["acknowledged","implemented","dismissed","not_applicable","already_aware"]},"dismissalReason":{"type":"string"},"confidenceRating":{"type":"number"},"actorUserId":{"type":"string"},"actorApiKeyHint":{"type":"string"},"realizedSavings":{"anyOf":[{"type":"string"},{"type":"number"}]},"realizedSavingsCurrency":{"type":"string","minLength":3,"maxLength":3},"realizedSavingsMeasuredAt":{"type":"string","nullable":true},"created":{"type":"string"},"isActive":{"type":"number"}},"required":["id","teamId","runId","recommendationId","action","dismissalReason","confidenceRating","actorUserId","actorApiKeyHint","realizedSavings","realizedSavingsCurrency","realizedSavingsMeasuredAt","created","isActive"]}}}},"400":{"description":"Bad Request - Invalid input parameters or validation error","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"401":{"description":"Unauthorized - Missing or invalid API key","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"403":{"description":"Forbidden - Not authorized to access this resource","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}},"500":{"description":"Internal Server Error - An unexpected error occurred","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string"}},"required":["type","title","status","detail","code"]}}}}}}}}}