get_anthropic_registry (pricing/anthropic_prices.py)

headroom · headroom/pricing/anthropic_prices.py · python · Apache-2.0
ai, tag:knn-classified

get_anthropic_registry returns a pricing registry with Anthropic model prices.

# Source: https://github.com/headroomlabs-ai/headroom | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Anthropic model pricing information."""

from datetime import date

from .registry import ModelPricing, PricingRegistry

# Last verified date for pricing information
LAST_UPDATED = date(2025, 1, 6)

# Official pricing page
SOURCE_URL = "https://www.anthropic.com/pricing"

# All prices are in USD per 1 million tokens
ANTHROPIC_PRICES: dict[str, ModelPricing] = {
    "claude-3-5-sonnet-20241022": ModelPricing(
        model="claude-3-5-sonnet-20241022",
        provider="anthropic",
        input_per_1m=3.00,
        output_per_1m=15.00,
        cached_input_per_1m=0.30,
        b

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key