Skip to content

added anthropic cache ttl pricing#627

Open
Devansh0012 wants to merge 1 commit intomainfrom
fix/anthropic-cache-ttl
Open

added anthropic cache ttl pricing#627
Devansh0012 wants to merge 1 commit intomainfrom
fix/anthropic-cache-ttl

Conversation

@Devansh0012
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Anthropic’s pricing data to include a separate cache-write input token price for a 1-hour TTL, enabling more granular cache cost modeling for Anthropic models.

Changes:

  • Added cache_write_input_token_1h pricing entries to Anthropic model rate tables (and default rates).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +17 to 21
"cache_write_input_token_1h": {
"price": 0
}
},
"calculate": {
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cache_write_input_token_1h is added to the default rate table, but calculate.request still only uses cache_write_tokens * rates.cache_write_input_token. Unless the downstream calculator dynamically switches rate keys, 1h cache-write usage will never be billed (or will be billed at the wrong rate). Consider extending the calculation to include a separate term for 1h cache writes (with a distinct usage field) multiplied by rates.cache_write_input_token_1h.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants