{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dialogbrain-com/json-schema/dialogbrain-com-analytics-response-schema.json",
  "title": "AnalyticsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dialogbrain-com-billing-api-openapi.yml#/components/schemas/AnalyticsResponse",
  "properties": {
    "ai_actions_used": {
      "type": "integer",
      "title": "Ai Actions Used"
    },
    "ai_actions_limit": {
      "type": "integer",
      "title": "Ai Actions Limit"
    },
    "ai_actions_remaining": {
      "type": "integer",
      "title": "Ai Actions Remaining"
    },
    "ai_usage_percent": {
      "type": "number",
      "title": "Ai Usage Percent"
    },
    "ai_breakdown": {
      "items": {},
      "type": "array",
      "title": "Ai Breakdown"
    },
    "days_until_reset": {
      "type": "integer",
      "title": "Days Until Reset"
    },
    "storage_used_bytes": {
      "type": "integer",
      "title": "Storage Used Bytes"
    },
    "storage_limit_gb": {
      "type": "integer",
      "title": "Storage Limit Gb"
    },
    "files_count": {
      "type": "integer",
      "title": "Files Count"
    },
    "rag_queries_total": {
      "type": "integer",
      "title": "Rag Queries Total"
    },
    "rag_queries_30d": {
      "type": "integer",
      "title": "Rag Queries 30D"
    },
    "total_threads": {
      "type": "integer",
      "title": "Total Threads"
    },
    "active_threads_30d": {
      "type": "integer",
      "title": "Active Threads 30D"
    },
    "total_messages": {
      "type": "integer",
      "title": "Total Messages"
    },
    "messages_30d": {
      "type": "integer",
      "title": "Messages 30D"
    },
    "messages_by_channel": {
      "items": {
        "$ref": "#/$defs/ChannelStats"
      },
      "type": "array",
      "title": "Messages By Channel"
    },
    "recent_activity": {
      "items": {
        "$ref": "#/$defs/RecentActivity"
      },
      "type": "array",
      "title": "Recent Activity"
    },
    "plan_name": {
      "type": "string",
      "title": "Plan Name"
    }
  },
  "type": "object",
  "required": [
    "ai_actions_used",
    "ai_actions_limit",
    "ai_actions_remaining",
    "ai_usage_percent",
    "ai_breakdown",
    "days_until_reset",
    "storage_used_bytes",
    "storage_limit_gb",
    "files_count",
    "rag_queries_total",
    "rag_queries_30d",
    "total_threads",
    "active_threads_30d",
    "total_messages",
    "messages_30d",
    "messages_by_channel",
    "recent_activity",
    "plan_name"
  ],
  "$defs": {
    "ChannelStats": {
      "properties": {
        "channel": {
          "type": "string",
          "title": "Channel"
        },
        "threads_count": {
          "type": "integer",
          "title": "Threads Count"
        },
        "messages_count": {
          "type": "integer",
          "title": "Messages Count"
        }
      },
      "type": "object",
      "required": [
        "channel",
        "threads_count",
        "messages_count"
      ],
      "title": "ChannelStats"
    },
    "RecentActivity": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "type": {
          "type": "string",
          "title": "Type"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail"
        },
        "timestamp": {
          "type": "string",
          "title": "Timestamp"
        }
      },
      "type": "object",
      "required": [
        "id",
        "type",
        "label",
        "detail",
        "timestamp"
      ],
      "title": "RecentActivity"
    }
  }
}