Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions content/docs/references/ai/BillingPeriod.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: BillingPeriod
description: BillingPeriod Schema Reference
---

## Allowed Values

* `hourly`
* `daily`
* `weekly`
* `monthly`
* `quarterly`
* `yearly`
* `custom`
25 changes: 25 additions & 0 deletions content/docs/references/ai/BudgetLimit.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: BudgetLimit
description: BudgetLimit Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `Enum<'global' \| 'user' \| 'agent' \| 'object' \| 'project' \| 'department'>` | ✅ | |
| **scope** | `string` | optional | Scope identifier (userId, agentId, etc.) |
| **maxCost** | `number` | ✅ | Maximum cost limit |
| **currency** | `string` | optional | |
| **period** | `Enum<'hourly' \| 'daily' \| 'weekly' \| 'monthly' \| 'quarterly' \| 'yearly' \| 'custom'>` | ✅ | |
| **customPeriodDays** | `integer` | optional | Custom period in days |
| **softLimit** | `number` | optional | Soft limit for warnings |
| **warnThresholds** | `number[]` | optional | Warning thresholds (e.g., [0.5, 0.8, 0.95]) |
| **enforced** | `boolean` | optional | Block requests when exceeded |
| **gracePeriodSeconds** | `integer` | optional | Grace period after limit exceeded |
| **allowRollover** | `boolean` | optional | Allow unused budget to rollover |
| **maxRolloverPercentage** | `number` | optional | Max rollover as % of limit |
| **name** | `string` | optional | Budget name |
| **description** | `string` | optional | |
| **active** | `boolean` | optional | |
| **tags** | `string[]` | optional | |
24 changes: 24 additions & 0 deletions content/docs/references/ai/BudgetStatus.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: BudgetStatus
description: BudgetStatus Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **budgetId** | `string` | ✅ | |
| **type** | `Enum<'global' \| 'user' \| 'agent' \| 'object' \| 'project' \| 'department'>` | ✅ | |
| **scope** | `string` | optional | |
| **periodStart** | `string` | ✅ | ISO 8601 timestamp |
| **periodEnd** | `string` | ✅ | ISO 8601 timestamp |
| **currentCost** | `number` | optional | |
| **maxCost** | `number` | ✅ | |
| **currency** | `string` | optional | |
| **percentageUsed** | `number` | ✅ | Usage as percentage (can exceed 1.0 if over budget) |
| **remainingCost** | `number` | ✅ | Remaining budget (can be negative if exceeded) |
| **isExceeded** | `boolean` | optional | |
| **isWarning** | `boolean` | optional | |
| **projectedCost** | `number` | optional | Projected cost for period |
| **projectedOverage** | `number` | optional | Projected overage |
| **lastUpdated** | `string` | ✅ | ISO 8601 timestamp |
13 changes: 13 additions & 0 deletions content/docs/references/ai/BudgetType.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: BudgetType
description: BudgetType Schema Reference
---

## Allowed Values

* `global`
* `user`
* `agent`
* `object`
* `project`
* `department`
24 changes: 24 additions & 0 deletions content/docs/references/ai/ConversationAnalytics.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: ConversationAnalytics
description: ConversationAnalytics Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **sessionId** | `string` | ✅ | |
| **totalMessages** | `integer` | ✅ | |
| **userMessages** | `integer` | ✅ | |
| **assistantMessages** | `integer` | ✅ | |
| **systemMessages** | `integer` | ✅ | |
| **totalTokens** | `integer` | ✅ | |
| **averageTokensPerMessage** | `number` | ✅ | |
| **peakTokenUsage** | `integer` | ✅ | |
| **pruningEvents** | `integer` | optional | |
| **summarizationEvents** | `integer` | optional | |
| **tokensSavedByPruning** | `integer` | optional | |
| **tokensSavedBySummarization** | `integer` | optional | |
| **duration** | `number` | optional | Session duration in seconds |
| **firstMessageAt** | `string` | optional | ISO 8601 timestamp |
| **lastMessageAt** | `string` | optional | ISO 8601 timestamp |
17 changes: 17 additions & 0 deletions content/docs/references/ai/ConversationContext.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: ConversationContext
description: ConversationContext Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **sessionId** | `string` | ✅ | Conversation session ID |
| **userId** | `string` | optional | User identifier |
| **agentId** | `string` | optional | AI agent identifier |
| **object** | `string` | optional | Related object (e.g., "case", "project") |
| **recordId** | `string` | optional | Related record ID |
| **scope** | `Record<string, any>` | optional | Additional context scope |
| **systemMessage** | `string` | optional | System prompt/instructions |
| **metadata** | `Record<string, any>` | optional | |
22 changes: 22 additions & 0 deletions content/docs/references/ai/ConversationMessage.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: ConversationMessage
description: ConversationMessage Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique message ID |
| **timestamp** | `string` | ✅ | ISO 8601 timestamp |
| **role** | `Enum<'system' \| 'user' \| 'assistant' \| 'function' \| 'tool'>` | ✅ | |
| **content** | `string \| object[]` | ✅ | Message content (text or multimodal) |
| **functionCall** | `object` | optional | Legacy function call |
| **toolCalls** | `object[]` | optional | Tool calls |
| **toolCallId** | `string` | optional | Tool call ID this message responds to |
| **name** | `string` | optional | Name of the function/user |
| **tokens** | `object` | optional | Token usage for this message |
| **pinned** | `boolean` | optional | Prevent removal during pruning |
| **importance** | `number` | optional | Importance score for pruning |
| **embedding** | `number[]` | optional | Vector embedding for semantic search |
| **metadata** | `Record<string, any>` | optional | |
22 changes: 22 additions & 0 deletions content/docs/references/ai/ConversationSession.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: ConversationSession
description: ConversationSession Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique session ID |
| **name** | `string` | optional | Session name/title |
| **context** | `object` | ✅ | |
| **modelId** | `string` | optional | AI model ID |
| **tokenBudget** | `object` | ✅ | |
| **messages** | `object[]` | optional | |
| **tokens** | `object` | optional | |
| **status** | `Enum<'active' \| 'paused' \| 'completed' \| 'archived'>` | optional | |
| **createdAt** | `string` | ✅ | ISO 8601 timestamp |
| **updatedAt** | `string` | ✅ | ISO 8601 timestamp |
| **expiresAt** | `string` | optional | ISO 8601 timestamp |
| **tags** | `string[]` | optional | |
| **metadata** | `Record<string, any>` | optional | |
17 changes: 17 additions & 0 deletions content/docs/references/ai/ConversationSummary.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: ConversationSummary
description: ConversationSummary Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **summary** | `string` | ✅ | Conversation summary |
| **keyPoints** | `string[]` | optional | Key discussion points |
| **originalTokens** | `integer` | ✅ | Original token count |
| **summaryTokens** | `integer` | ✅ | Summary token count |
| **tokensSaved** | `integer` | ✅ | Tokens saved |
| **messageRange** | `object` | ✅ | Range of messages summarized |
| **generatedAt** | `string` | ✅ | ISO 8601 timestamp |
| **modelId** | `string` | optional | Model used for summarization |
27 changes: 27 additions & 0 deletions content/docs/references/ai/CostAlert.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: CostAlert
description: CostAlert Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | |
| **timestamp** | `string` | ✅ | ISO 8601 timestamp |
| **type** | `Enum<'threshold_warning' \| 'threshold_critical' \| 'limit_exceeded' \| 'anomaly_detected' \| 'projection_exceeded'>` | ✅ | |
| **severity** | `Enum<'info' \| 'warning' \| 'critical'>` | ✅ | |
| **budgetId** | `string` | optional | |
| **budgetType** | `Enum<'global' \| 'user' \| 'agent' \| 'object' \| 'project' \| 'department'>` | optional | |
| **scope** | `string` | optional | |
| **message** | `string` | ✅ | Alert message |
| **currentCost** | `number` | ✅ | |
| **maxCost** | `number` | optional | |
| **threshold** | `number` | optional | |
| **currency** | `string` | optional | |
| **recommendations** | `string[]` | optional | |
| **acknowledged** | `boolean` | optional | |
| **acknowledgedBy** | `string` | optional | |
| **acknowledgedAt** | `string` | optional | |
| **resolved** | `boolean` | optional | |
| **metadata** | `Record<string, any>` | optional | |
12 changes: 12 additions & 0 deletions content/docs/references/ai/CostAlertType.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: CostAlertType
description: CostAlertType Schema Reference
---

## Allowed Values

* `threshold_warning`
* `threshold_critical`
* `limit_exceeded`
* `anomaly_detected`
* `projection_exceeded`
31 changes: 31 additions & 0 deletions content/docs/references/ai/CostAnalytics.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: CostAnalytics
description: CostAnalytics Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **periodStart** | `string` | ✅ | ISO 8601 timestamp |
| **periodEnd** | `string` | ✅ | ISO 8601 timestamp |
| **totalCost** | `number` | ✅ | |
| **totalRequests** | `integer` | ✅ | |
| **totalTokens** | `integer` | optional | |
| **currency** | `string` | optional | |
| **averageCostPerRequest** | `number` | ✅ | |
| **averageCostPerToken** | `number` | optional | |
| **averageRequestsPerDay** | `number` | ✅ | |
| **costTrend** | `Enum<'increasing' \| 'decreasing' \| 'stable'>` | optional | |
| **trendPercentage** | `number` | optional | % change vs previous period |
| **byModel** | `object[]` | optional | |
| **byProvider** | `object[]` | optional | |
| **byUser** | `object[]` | optional | |
| **byAgent** | `object[]` | optional | |
| **byOperation** | `object[]` | optional | |
| **byDate** | `object[]` | optional | |
| **topModels** | `object[]` | optional | |
| **topUsers** | `object[]` | optional | |
| **topAgents** | `object[]` | optional | |
| **tokensPerDollar** | `number` | optional | |
| **requestsPerDollar** | `number` | optional | |
16 changes: 16 additions & 0 deletions content/docs/references/ai/CostBreakdownDimension.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: CostBreakdownDimension
description: CostBreakdownDimension Schema Reference
---

## Allowed Values

* `model`
* `provider`
* `user`
* `agent`
* `object`
* `operation`
* `date`
* `hour`
* `tag`
17 changes: 17 additions & 0 deletions content/docs/references/ai/CostBreakdownEntry.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: CostBreakdownEntry
description: CostBreakdownEntry Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **dimension** | `Enum<'model' \| 'provider' \| 'user' \| 'agent' \| 'object' \| 'operation' \| 'date' \| 'hour' \| 'tag'>` | ✅ | |
| **value** | `string` | ✅ | Dimension value (e.g., model ID, user ID) |
| **totalCost** | `number` | ✅ | |
| **requestCount** | `integer` | ✅ | |
| **totalTokens** | `integer` | optional | |
| **percentageOfTotal** | `number` | ✅ | |
| **periodStart** | `string` | optional | |
| **periodEnd** | `string` | optional | |
29 changes: 29 additions & 0 deletions content/docs/references/ai/CostEntry.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: CostEntry
description: CostEntry Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique cost entry ID |
| **timestamp** | `string` | ✅ | ISO 8601 timestamp |
| **modelId** | `string` | ✅ | AI model used |
| **provider** | `string` | ✅ | AI provider (e.g., "openai", "anthropic") |
| **operation** | `string` | ✅ | Operation type (e.g., "chat_completion", "embedding") |
| **promptTokens** | `integer` | optional | |
| **completionTokens** | `integer` | optional | |
| **totalTokens** | `integer` | optional | |
| **requestCount** | `integer` | optional | |
| **promptCost** | `number` | optional | Cost of prompt tokens |
| **completionCost** | `number` | optional | Cost of completion tokens |
| **totalCost** | `number` | ✅ | Total cost in base currency |
| **currency** | `string` | optional | |
| **sessionId** | `string` | optional | Conversation session ID |
| **userId** | `string` | optional | User who triggered the request |
| **agentId** | `string` | optional | AI agent ID |
| **object** | `string` | optional | Related object (e.g., "case", "project") |
| **recordId** | `string` | optional | Related record ID |
| **tags** | `string[]` | optional | |
| **metadata** | `Record<string, any>` | optional | |
13 changes: 13 additions & 0 deletions content/docs/references/ai/CostMetricType.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: CostMetricType
description: CostMetricType Schema Reference
---

## Allowed Values

* `token`
* `request`
* `character`
* `second`
* `image`
* `embedding`
24 changes: 24 additions & 0 deletions content/docs/references/ai/CostOptimizationRecommendation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: CostOptimizationRecommendation
description: CostOptimizationRecommendation Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | |
| **type** | `Enum<'switch_model' \| 'reduce_tokens' \| 'batch_requests' \| 'cache_results' \| 'adjust_parameters' \| 'limit_usage'>` | ✅ | |
| **title** | `string` | ✅ | |
| **description** | `string` | ✅ | |
| **estimatedSavings** | `number` | optional | |
| **savingsPercentage** | `number` | optional | |
| **priority** | `Enum<'low' \| 'medium' \| 'high'>` | ✅ | |
| **effort** | `Enum<'low' \| 'medium' \| 'high'>` | ✅ | |
| **actionable** | `boolean` | optional | |
| **actionSteps** | `string[]` | optional | |
| **targetModel** | `string` | optional | |
| **alternativeModel** | `string` | optional | |
| **affectedUsers** | `string[]` | optional | |
| **status** | `Enum<'pending' \| 'accepted' \| 'rejected' \| 'implemented'>` | optional | |
| **implementedAt** | `string` | optional | |
25 changes: 25 additions & 0 deletions content/docs/references/ai/CostQueryFilters.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: CostQueryFilters
description: CostQueryFilters Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **startDate** | `string` | optional | ISO 8601 timestamp |
| **endDate** | `string` | optional | ISO 8601 timestamp |
| **modelIds** | `string[]` | optional | |
| **providers** | `string[]` | optional | |
| **userIds** | `string[]` | optional | |
| **agentIds** | `string[]` | optional | |
| **operations** | `string[]` | optional | |
| **sessionIds** | `string[]` | optional | |
| **minCost** | `number` | optional | |
| **maxCost** | `number` | optional | |
| **tags** | `string[]` | optional | |
| **groupBy** | `Enum<'model' \| 'provider' \| 'user' \| 'agent' \| 'object' \| 'operation' \| 'date' \| 'hour' \| 'tag'>[]` | optional | |
| **orderBy** | `Enum<'timestamp' \| 'cost' \| 'tokens'>` | optional | |
| **orderDirection** | `Enum<'asc' \| 'desc'>` | optional | |
| **limit** | `integer` | optional | |
| **offset** | `integer` | optional | |
Loading
Loading