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.
This commit is contained in:
Evan authored and GitHub committed 2026-04-20 14:15:45 +09:00
1 parent 396c88dc49
commit 80c6ee79cd
1 file changed
+24 -4
+24 -4
View File
@@ -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"