From 80c6ee79cd9ea202817490ab3852d7ddd63c107d Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 20 Apr 2026 14:15:45 +0900 Subject: [PATCH] feat(anthropic): add Claude Opus 4.7 and fix Opus 4.6 context window (#66) Add `claude-opus-4-7`, Anthropic's current flagship model (per https://platform.claude.com/docs/en/docs/about-claude/models/overview). - Context window: 1,000,000 tokens (Opus 4.7 ships with a new tokenizer) - Max output: 128,000 tokens - Pricing: $5 / input MTok, $25 / output MTok (unchanged from 4.6) - Tier: frontier - Supports tools, vision, streaming, and adaptive thinking Move the `opus` / `claude-opus` aliases from 4.6 to 4.7 so a user asking for "opus" gets the current flagship. Opus 4.6 is now in Anthropic's "Legacy" section of the models overview; keeping it in the registry entry (for existing callers that pin the exact ID) but without the generic aliases. Also **correct Opus 4.6's `context_window`**: it was listed as 200,000 tokens but the official model page has shown 1M tokens since release. That was a pre-existing bug this PR fixes in passing since it directly affects anyone who'd have routed queries to 4.6 expecting 1M. Add a header comment pinning the source URL and explaining the "latest-first" ordering convention so future additions don't silently rebind aliases to a previous-generation snapshot. --- providers/anthropic.toml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/providers/anthropic.toml b/providers/anthropic.toml index 38b69c7..a05d71a 100644 --- a/providers/anthropic.toml +++ b/providers/anthropic.toml @@ -1,5 +1,5 @@ # Anthropic — https://anthropic.com -# Models: 6 +# Models: 7 [provider] id = "anthropic" @@ -8,11 +8,17 @@ api_key_env = "ANTHROPIC_API_KEY" base_url = "https://api.anthropic.com" key_required = true +# Source for model metadata: +# https://platform.claude.com/docs/en/docs/about-claude/models/overview +# Keep entries ordered with the currently-promoted "latest" at the top so the +# `opus` / `claude-opus` / `sonnet` / etc. aliases resolve to the current +# flagship and not a previous-generation snapshot. + [[models]] -id = "claude-opus-4-6" -display_name = "Claude Opus 4.6" +id = "claude-opus-4-7" +display_name = "Claude Opus 4.7" tier = "frontier" -context_window = 200000 +context_window = 1000000 max_output_tokens = 128000 input_cost_per_m = 5.0 output_cost_per_m = 25.0 @@ -22,6 +28,20 @@ supports_streaming = true supports_thinking = true aliases = ["opus", "claude-opus"] +[[models]] +id = "claude-opus-4-6" +display_name = "Claude Opus 4.6" +tier = "frontier" +context_window = 1000000 +max_output_tokens = 128000 +input_cost_per_m = 5.0 +output_cost_per_m = 25.0 +supports_tools = true +supports_vision = true +supports_streaming = true +supports_thinking = true +aliases = [] + [[models]] id = "claude-sonnet-4-6" display_name = "Claude Sonnet 4.6"