anthropic: Dynamically fetch models from /models (#56397)

Most compelling reason to make this change is that we don't have to ship
a new Zed binary if Anthropic releases a new model

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- anthropic: Dynamically fetch available models from Anthropic API

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
Bennet Bo Fenner 2026-05-11 15:19:20 +02:00 committed by GitHub
parent 40d444413f
commit ee309a0000
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 495 additions and 508 deletions

View file

@ -181,11 +181,6 @@ You can add custom models to the Anthropic provider by adding the following to y
"display_name": "Sonnet 2024-June",
"max_tokens": 128000,
"max_output_tokens": 2560,
"cache_configuration": {
"max_cache_anchors": 10,
"min_total_token": 10000,
"should_speculate": false
},
"tool_override": "some-model-that-supports-toolcalling"
}
]