Skip to main content

Module api

Module api 

Source
Expand description

Shared API response types for Otelite

This module defines the canonical API response structures used across otelite-server, otelite-cli, and otelite-tui. All types derive both Serialize and Deserialize to support both server-side serialization and client-side deserialization.

Structs§

CacheHitRateByModel
Cache token efficiency per model. hit_rate = cache_read_tokens / (cache_read_tokens + input_tokens). Only set when at least one of the token counts is non-zero.
CallsSeriesPoint
Single time-bucket point for calls-over-time series.
ConversationCostRow
Aggregated cost/token row for a single conversation.
ConversationDepthStats
Turn-count distribution across all observed conversations.
CostSeriesPoint
A single time-bucketed cost/usage data point
ErrorRateByModel
Error-rate summary for LLM spans grouped by model.
ErrorResponse
Standard error response for all API endpoints
ErrorTypeBreakdown
Per-(model, error_type) breakdown of error spans, bucketed into actionable categories.
FinishReasonCount
Distribution entry for a single finish reason
HistogramBucket
Histogram bucket
HistogramValue
Histogram value
LatencyStats
Latency / TTFT percentile statistics for LLM spans, grouped by model.
LogEntry
Individual log entry for API response
LogsResponse
Response for log listing
MaxTokensBucket
Distribution of gen_ai.request.max_tokens values across LLM calls.
MetricResponse
Metric response
ModelDriftPair
A (request_model → response_model) pair that providers actually served. differs == true means the provider silently rerouted to a different model snapshot.
ModelUsage
Token usage for a specific model
Quantile
Quantile
RequestParamProfile
Distribution of request parameter settings (temperature, max_tokens).
Resource
Resource information
RetrievalStats
Retrieval / RAG statistics aggregated across retriever spans.
RetryStats
Retry statistics across LLM spans.
SessionCostRow
Aggregated cost/token row for a single session.
SpanEntry
Individual span entry
SpanEvent
Span event
SpanStatus
Span status
SummaryValue
Summary value
SystemUsage
Token usage for a specific system (provider)
TemperatureBucket
Distribution of gen_ai.request.temperature values across LLM calls.
TokenUsageResponse
Token usage summary response for GenAI/LLM spans
TokenUsageSummary
Overall token usage summary
ToolUsage
Aggregated per-tool usage for tool-execution spans.
TopRetrievalQuery
A single grouped retrieval query with aggregate stats.
TopSpan
A single top-N expensive LLM span
TraceDetail
Detailed trace with all spans
TraceEntry
Individual trace entry (aggregated from spans)
TracesResponse
Response for trace listing
TruncationRateByModel
Truncation rate (finish_reason = max_tokens/length) per model.

Enums§

MetricValue
Metric value (can be different types)
TopSpanSort
Sort dimension for top-N span queries.