Skip to content

feat(provider/anthropic): add support for claude-opus-4-8#15674

Merged
gr2m merged 10 commits into
mainfrom
add-opus-4-8
May 28, 2026
Merged

feat(provider/anthropic): add support for claude-opus-4-8#15674
gr2m merged 10 commits into
mainfrom
add-opus-4-8

Conversation

@felixarntz
Copy link
Copy Markdown
Collaborator

Background

Anthropic released claude-opus-4-8, available on the first-party API as well as on Bedrock, Vertex, and the AI Gateway. Opus 4.8 is the first Claude model to support mid-conversation system messages.

Summary

  • Add claude-opus-4-8 (and Bedrock / Vertex / Gateway variants) to provider model ID unions.
  • Wire claude-opus-4-8 into getModelCapabilities with the same profile as claude-opus-4-7 (128k output, adaptive thinking, xhigh effort, structured output, sampling parameters rejected).
  • Drop the UnsupportedFunctionalityError for "Multiple system messages that are separated by user/assistant messages", since the API will reject unsupported messages anyway. A second system block is now emitted inline in messages as { role: 'system', content: [{ type: 'text', text }] }, and the converter adds the mid-conversation-system-2026-04-07 beta header automatically. The first system block still flows into the top-level system field — so existing prompts hit a byte-identical request.
  • Refresh docs and a handful of examples (anthropic xhigh-effort / task-budget, bedrock anthropic-reasoning) to use the new model, and add a new mid-conversation-system example.

Manual Verification

Run the relevant Opus 4.8 examples modified, including the new ones for mid-conversation system message.

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

@gr2m gr2m enabled auto-merge (squash) May 28, 2026 17:09
@gr2m gr2m merged commit e02f041 into main May 28, 2026
50 checks passed
@gr2m gr2m deleted the add-opus-4-8 branch May 28, 2026 17:14
gr2m pushed a commit that referenced this pull request May 28, 2026
…#15675)

## Summary

Manual backport of #15674.
## Checklist

<!--
Do not edit this list. Leave items unchecked that don't apply. If you
need to track subtasks, create a new "## Tasks" section

Please check if the PR fulfills the following requirements:
-->

- [x] All commits are signed (PRs with unsigned commits cannot be
merged)
- [x] Tests have been added / updated (for bug fixes / features)
- [x] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 7.0.0-canary.157 github npm
@ai-sdk/amazon-bedrock 5.0.0-canary.73 github npm
@ai-sdk/angular 3.0.0-canary.157 github npm
@ai-sdk/anthropic 4.0.0-canary.61 github npm
@ai-sdk/anthropic-aws 1.0.0-canary.2 github npm
@ai-sdk/gateway 4.0.0-canary.93 github npm
@ai-sdk/google-vertex 5.0.0-canary.97 github npm
@ai-sdk/langchain 3.0.0-canary.157 github npm
@ai-sdk/llamaindex 3.0.0-canary.157 github npm
@ai-sdk/otel 1.0.0-canary.103 github npm
@ai-sdk/react 4.0.0-canary.159 github npm
@ai-sdk/rsc 3.0.0-canary.158 github npm
@ai-sdk/svelte 5.0.0-canary.157 github npm
@ai-sdk/vue 4.0.0-canary.157 github npm
@ai-sdk/workflow 1.0.0-canary.74 github npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants