Table of Contents

Namespace JD.AI.Core.Usage

Classes

BudgetConfig

Budget configuration with limit thresholds.

BudgetStatus

Budget status check result.

CostRateEntry

A cost rate entry for a provider/model combination.

CostRateProvider

Configurable cost rate lookup for provider/model combinations. Supports exact match, glob patterns, provider defaults, and a global fallback.

DefaultCostEstimator

Default turn-cost estimator. Prefers model metadata, falls back to CostRateProvider, then zero.

InMemoryUsageMeter

In-memory usage meter for testing and single-node deployments. Thread-safe via ConcurrentBag<T>.

ProviderUsageBreakdown

Per-provider usage breakdown.

SqliteUsageMeter

SQLite-backed usage metering service. Stores turn-level usage records in a dedicated usage.db and provides aggregation queries.

TurnUsageRecord

Record of token usage for a single agent turn.

UsageSummary

Aggregated usage summary for queries.

Interfaces

ICostEstimator

Estimates token spend for a model/provider pair and exposes the resolved rates.

IUsageMeter

Centralized usage metering service for tracking token consumption, cost estimation, and budget enforcement across all providers.

Enums

BudgetPeriod

Budget time periods.

UsageExportFormat

Export formats for usage data.