Skip to content

analytics

Models for the Analytics endpoints.

Analytics provides read-only admin dashboards for message counts, token usage, user activity, and model performance. All endpoints require admin privileges.

Classes

ModelAnalyticsEntry

Bases: BaseModel

Message count for a single model.

Attributes

model_id
model_id: str

Identifier of the model (e.g. 'gpt-4o', 'llama3').

count
count: int

Number of messages sent using this model.

ModelAnalyticsResponse

Bases: BaseModel

Response from the model analytics endpoint.

Attributes

models
models: list[ModelAnalyticsEntry]

List of models sorted by message count descending.

UserAnalyticsEntry

Bases: BaseModel

Message count and token usage for a single user.

Attributes

user_id
user_id: str

Unique identifier of the user.

name
name: Optional[str] = None

Display name of the user.

email
email: Optional[str] = None

Email address of the user.

count
count: int

Number of messages sent by this user.

input_tokens
input_tokens: int = 0

Total input (prompt) tokens consumed.

output_tokens
output_tokens: int = 0

Total output (completion) tokens consumed.

total_tokens
total_tokens: int = 0

Sum of input and output tokens.

UserAnalyticsResponse

Bases: BaseModel

Response from the user analytics endpoint.

Attributes

users
users: list[UserAnalyticsEntry]

List of users sorted by message count descending, limited by the request limit.

SummaryResponse

Bases: BaseModel

Dashboard summary statistics.

Attributes

total_messages
total_messages: int

Total number of messages across all models.

total_chats
total_chats: int

Total number of distinct chats.

total_models
total_models: int

Number of distinct models used.

total_users
total_users: int

Number of distinct users who sent messages.

DailyStatsEntry

Bases: BaseModel

Message counts per model for a single date (or hour).

Attributes

date
date: str

Date string in 'YYYY-MM-DD' format, or 'YYYY-MM-DD HH:00' for hourly granularity.

models
models: dict[str, int]

Message counts keyed by model ID.

Dict Fields

Keys are model ID strings (e.g. 'gpt-4o'). Values are the number of messages sent using that model on this date/hour.

DailyStatsResponse

Bases: BaseModel

Response from the daily (or hourly) stats endpoint.

Attributes

data
data: list[DailyStatsEntry]

Time-series entries sorted chronologically.

TokenUsageEntry

Bases: BaseModel

Token usage for a single model.

Attributes

model_id
model_id: str

Identifier of the model.

input_tokens
input_tokens: int

Total input (prompt) tokens consumed by this model.

output_tokens
output_tokens: int

Total output (completion) tokens consumed by this model.

total_tokens
total_tokens: int

Sum of input and output tokens for this model.

message_count
message_count: int

Number of messages sent using this model.

TokenUsageResponse

Bases: BaseModel

Response from the token usage endpoint.

Attributes

models
models: list[TokenUsageEntry]

List of models sorted by total tokens descending.

total_input_tokens
total_input_tokens: int

Aggregate input tokens across all models.

total_output_tokens
total_output_tokens: int

Aggregate output tokens across all models.

total_tokens
total_tokens: int

Aggregate total tokens across all models.

ModelChatEntry

Bases: BaseModel

Preview of a chat that used a specific model.

Attributes

chat_id
chat_id: str

Unique identifier of the chat.

user_id
user_id: Optional[str] = None

ID of the user who sent the first user message in the chat.

user_name
user_name: Optional[str] = None

Display name of the user.

first_message
first_message: Optional[str] = None

Truncated preview (up to 200 chars) of the first user message content.

updated_at
updated_at: int

Unix timestamp of the most recent message in the chat.

ModelChatsResponse

Bases: BaseModel

Response from the model chats browser endpoint.

Attributes

chats
chats: list[ModelChatEntry]

List of chats that used the specified model.

total
total: int

Total number of chats returned.

HistoryEntry

Bases: BaseModel

Daily feedback counts (thumbs up / thumbs down).

Attributes

date
date: str

Date string in 'YYYY-MM-DD' format.

won
won: int = 0

Number of positive (thumbs up / rating=1) feedbacks on this date.

lost
lost: int = 0

Number of negative (thumbs down / rating=-1) feedbacks on this date.

TagEntry

Bases: BaseModel

A chat tag and its usage count.

Attributes

tag
tag: str

Tag label.

count
count: int

Number of chats with this tag.

ModelOverviewResponse

Bases: BaseModel

Model overview with feedback history and top chat tags.

Attributes

history
history: list[HistoryEntry]

Daily feedback counts, with gaps filled (zero-count days included).

tags
tags: list[TagEntry]

Top 10 chat tags sorted by count descending.