claude-agent 0.2.25

Rust SDK for building AI agents with Anthropic's Claude - Direct API, no CLI dependency
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Tenant-based budget management for API cost control.

use rust_decimal::Decimal;
use rust_decimal_macros::dec;

mod manager;
pub mod pricing;
mod tracker;

pub use manager::{TenantBudget, TenantBudgetManager};
pub use pricing::{ModelPricing, PricingTable, PricingTableBuilder, global_pricing_table};
pub use tracker::{BudgetStatus, BudgetTracker, OnExceed};

/// Scale factor for storing Decimal costs as AtomicU64 (6 decimal places precision).
pub(crate) const COST_SCALE_FACTOR: Decimal = dec!(1_000_000);