Skip to content

fix(provider/anthropic): correct Claude 4 model ID format#7067

Merged
lgrammel merged 2 commits intovercel:mainfrom
mmstroik:claude-4-model-ids
Jul 7, 2025
Merged

fix(provider/anthropic): correct Claude 4 model ID format#7067
lgrammel merged 2 commits intovercel:mainfrom
mmstroik:claude-4-model-ids

Conversation

@mmstroik
Copy link
Contributor

@mmstroik mmstroik commented Jul 4, 2025

Background

Anthropic's official Claude 4 model IDs use the format claude-opus-4-20250514 and claude-sonnet-4-20250514, but the AI SDK was using the format claude-4-opus-20250514 and claude-4-sonnet-20250514.

Summary

Updated Claude 4 model ID to match Anthropic's official format:

  • claude-4-opus-20250514 --> claude-opus-4-20250514
  • claude-4-sonnet-20250514 --> claude-sonnet-4-20250514

Changes made to:

  • TypeScript model ID types in anthropic provider (AnthropicMessagesModelId type)
  • Provider documentation
  • Cookbook examples
  • Model reference tables
  • Migration guide examples

Verification

Verified against Anthropic's official documentation that the correct model IDs are claude-opus-4-20250514 and claude-sonnet-4-20250514.

Tasks

  • 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)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

Future Work

I didn't change the AI Gateway model ids since those are obviously vercel-specific ids that are routed internally, but note that those also use the older format (claude-4-sonnet rather than claude-sonnet-4)

@lgrammel lgrammel merged commit fdff8a4 into vercel:main Jul 7, 2025
8 of 9 checks passed
@mmstroik mmstroik deleted the claude-4-model-ids branch July 24, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants