import { AnthropicUsageBuckets } from '@standardagents/provider-pricing'; export { AnthropicModelPricing, AnthropicUsageBuckets, calculateAnthropicUsageCost, getAnthropicModelPricing } from '@standardagents/provider-pricing'; import Anthropic from '@anthropic-ai/sdk'; /** * Known Anthropic model pricing for request cost calculation. * * The Anthropic Messages API reports token usage (including cache buckets) * but no dollar cost, and the Models API exposes no pricing data — so cost * is derived here from the raw usage buckets and a maintained price table. * This is more accurate than a flat promptTokens * inputPrice calculation * because Anthropic bills the prompt in three differently-priced buckets: * * - uncached input tokens: base input rate * - cache writes: 1.25x input (5-minute TTL) or 2x input (1-hour TTL) * - cache reads: 0.1x input * * Thinking tokens are billed as ordinary output tokens (already included in * output_tokens), so no separate reasoning rate applies. */ type AnthropicUsage = Anthropic.Messages.Usage; /** * Extract billing buckets from an API usage object. When the per-TTL cache * creation breakdown is absent, all cache writes are assumed 5-minute TTL * (the API default and by far the most common case). */ declare function extractUsageBuckets(usage: AnthropicUsage): AnthropicUsageBuckets; export { extractUsageBuckets };