Skip to content

[Feat] Add Claude Opus 5 support across all providers#1010

Merged
edelauna merged 1 commit into
mainfrom
feature/claude-opus-5-35u2l09ejgtd3
Jul 24, 2026
Merged

[Feat] Add Claude Opus 5 support across all providers#1010
edelauna merged 1 commit into
mainfrom
feature/claude-opus-5-35u2l09ejgtd3

Conversation

@zoomote

@zoomote zoomote Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Opened on behalf of Naved Merchant. Follow up by mentioning @zoomote, in the web UI, or in Discord.

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) and anthropic.claude-opus-5 (Bedrock)
  • 1M native context window (no beta header required), 128k max output
  • Adaptive-thinking binary toggle (supportsReasoningBudget/supportsReasoningBinary); supportsTemperature: false since sampling params return a 400
  • Pricing per Anthropic docs: $5 input / $25 output / $6.25 cache writes / $0.50 cache reads per million tokens
  • Bedrock: added to BEDROCK_GLOBAL_INFERENCE_MODEL_IDS

Provider handling:

  • Added opus-5 to the Bedrock adaptive-thinking guard (safe against false positives: claude-opus-4-5-* IDs do not contain the literal substring opus-5)
  • Added anthropic/claude-opus-5 to the OpenRouter and Vercel AI Gateway prompt-caching, reasoning-budget, and vision/tools allow-lists (confirmed available on OpenRouter)
  • Applied Opus 5 overrides (maxTokens, reasoning budget/binary, temperature) in the OpenRouter, Requesty, and Vercel AI Gateway fetchers
  • Added claude-opus-5 to both Anthropic handler switch statements (cache breakpoints and prompt-caching beta header)

Test Procedure

  • Added Opus 5 test coverage mirroring the Sonnet 5 tests in every touched suite: Anthropic, Anthropic Vertex, Bedrock (model info, global inference prefix, adaptive-thinking request shape, guard predicate), Requesty, Vercel AI Gateway, all three fetcher specs, and the shared API max-output-tokens spec.
  • pnpm test passes: 6,948 tests passed, 38 skipped across 424 test files.
  • Pre-push lint and check-types hooks 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

  • No documentation updates are required. (The docs repo covers providers generically and does not maintain per-model lists; the Sonnet 5 change shipped without docs updates as well.)

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.

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
@zoomote

zoomote Bot commented Jul 24, 2026

Copy link
Copy Markdown
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 claude-sonnet-5 or claude-fable-5 now has a matching claude-opus-5 entry, and the opus-5 substring guard has no false positives among existing Bedrock model IDs. Verified locally: the 9 touched test suites pass (288 tests).

Reviewed 4903c40

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@edelauna edelauna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice and comprehensive!

@edelauna
edelauna added this pull request to the merge queue Jul 24, 2026
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Jul 24, 2026
Merged via the queue into main with commit d5a8c4a Jul 24, 2026
23 checks passed
@edelauna
edelauna deleted the feature/claude-opus-5-35u2l09ejgtd3 branch July 24, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants