Versions in this module Expand all Collapse all v0 v0.2.0 May 14, 2026 Changes in this version type Options + LogOutput io.Writer + Verbose bool v0.1.0 May 13, 2026 Changes in this version + type Metrics struct + func NewMetrics() *Metrics + func (m *Metrics) Begin(method, path string) *RequestRecord + func (m *Metrics) Finish(record *RequestRecord) + func (m *Metrics) Snapshot() Snapshot + type ModelStats struct + CachedTokens int64 + InputTokens int64 + OutputTokens int64 + Requests int64 + ThinkingTokens int64 + TotalTokens int64 + type Options struct + Config *config.Config + HTTPClient *http.Client + Metrics *Metrics + TokenProvider auth.TokenProvider + UpstreamBase string + type Proxy struct + func New(opts Options) *Proxy + func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) + type RequestRecord struct + Duration time.Duration + Error string + Method string + Model string + Path string + StartedAt time.Time + StatusCode int + Usage usage.TokenUsage + type Snapshot struct + Active int64 + CachedTokens int64 + Failures int64 + InputTokens int64 + Models map[string]ModelStats + OutputTokens int64 + Recent []RequestRecord + StatusCodes map[int]int64 + Successes int64 + ThinkingTokens int64 + TotalRequests int64 + TotalTokens int64 + func (s Snapshot) SortedModelNames() []string + type StaticTokenProvider string + func (p StaticTokenProvider) Token(ctx context.Context) (string, error)