[Feat] Add Claude Opus 5 support across all providers#1010
Merged
Conversation
Add full Claude Opus 5 support across all provider paths with correct model definitions, adaptive-thinking handling, fetcher overrides, and accurate pricing from Anthropic's published docs. Model definitions (anthropic.ts, bedrock.ts, vertex.ts): - 1M native context window (no beta header required) - Adaptive-thinking binary toggle (supportsReasoningBudget/Binary) - supportsTemperature: false (sampling params return a 400) - Pricing: input $5.0, output $25.0, cacheWrites $6.25, cacheReads $0.50 per million tokens Provider handling: - Add opus-5 to the Bedrock adaptive-thinking guard - Add claude-opus-5 to OpenRouter and Vercel AI Gateway allow-lists - Apply Opus 5 overrides (maxTokens, reasoning budget, temperature) in the openrouter, requesty, and vercel-ai-gateway fetchers Tests: - Add Opus 5 coverage across provider and fetcher test suites
Contributor
Author
|
No code issues found. See task Reviewed the Opus 5 model definitions (Anthropic/Bedrock/Vertex), the Bedrock adaptive-thinking guard, the Anthropic handler switch cases, and the OpenRouter/Requesty/Vercel AI Gateway fetcher overrides against the existing Sonnet 5 / Fable 5 patterns — every location that references Reviewed 4903c40 |
navedmerchant
marked this pull request as ready for review
July 24, 2026 20:04
navedmerchant
requested review from
JamesRobert20,
edelauna,
hannesrudolph,
navedmerchant and
taltas
as code owners
July 24, 2026 20:04
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
edelauna
approved these changes
Jul 24, 2026
edelauna
left a comment
Contributor
There was a problem hiding this comment.
Nice and comprehensive!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
No dedicated issue exists for Claude Opus 5 yet. This PR mirrors the approved Claude Sonnet 5 work: #777 / #778.
Description
Adds full Claude Opus 5 support across all provider paths, mirroring how Claude Sonnet 5 was added in #778, with pricing and parameters researched from Anthropic's published docs.
Model definitions (
packages/types— anthropic, bedrock, vertex):claude-opus-5(Anthropic/Vertex) andanthropic.claude-opus-5(Bedrock)supportsReasoningBudget/supportsReasoningBinary);supportsTemperature: falsesince sampling params return a 400BEDROCK_GLOBAL_INFERENCE_MODEL_IDSProvider handling:
opus-5to the Bedrock adaptive-thinking guard (safe against false positives:claude-opus-4-5-*IDs do not contain the literal substringopus-5)anthropic/claude-opus-5to the OpenRouter and Vercel AI Gateway prompt-caching, reasoning-budget, and vision/tools allow-lists (confirmed available on OpenRouter)claude-opus-5to both Anthropic handler switch statements (cache breakpoints and prompt-caching beta header)Test Procedure
pnpm testpasses: 6,948 tests passed, 38 skipped across 424 test files.check-typeshooks pass across all 14 packages.Pre-Submission Checklist
Screenshots / Videos
Not applicable — provider/model-registry change with no UI surface (model becomes selectable in the existing provider pickers through the standard model registries).
Documentation Updates
Additional Notes
Pricing researched from Anthropic's models overview and pricing pages: Opus 5 is $5/$25 per MTok with $6.25/$0.50 cache rates (no introductory pricing, unlike Sonnet 5), adaptive thinking only, no extended-thinking
budget_tokens, and no sampling parameters.Get in Touch
@navedmerchant on GitHub; Naved Merchant on Discord.