Correct max output tokens for Claude Opus 4.6, 4.7, 4.8 and Sonnet 4.6 - #7129
Conversation
These models shared the 4.5 family's 64000 token entry, but the API allows 128000 for each -- confirmed by the limit the API itself reports when the request exceeds it. The 4.5 models keep 64000, which matches theirs.
🦋 Changeset detectedLatest commit: d55805a The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This PR updates the internal getModelCapabilities mapping in @effect/ai-anthropic so that Claude Opus 4.6, 4.7, 4.8, and Sonnet 4.6 use maxOutputTokens: 128000 instead of being grouped with the 4.5 family at 64000. The 4.5 models (Opus 4.5, Sonnet 4.5, Haiku 4.5) correctly keep 64000, and the structured-output flags are unchanged.
.changeset/anthropic-stale-max-output-tokens.md— concise patch changeset for@effect/ai-anthropic.packages/ai/anthropic/src/AnthropicLanguageModel.ts— splits the 128k-capable 4.6/4.7/4.8 models into their own branch ahead of the 4.5 branch.
I cross-checked the limits against Anthropic's published models overview: the legacy models table lists 128k max output for Opus 4.6/4.7/4.8 and Sonnet 4.6, and 64k for Opus 4.5 and Sonnet 4.5. The targeted test run for AnthropicLanguageModel.test.ts in @effect/ai-anthropic passed.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Type
Description
These models share the 4.5 family's 64000 token entry in
getModelCapabilities, but each allows 128000, so requests default to half the model's real limit.Anthropic's models overview lists "Max output: 128k tokens" for Opus 4.6, 4.7, 4.8 and Sonnet 4.6, against 64k for Sonnet 4.5 and Opus 4.5. The API says the same when a request exceeds it:
The 4.5 models keep their existing 64000 entry, which is correct for them.
Related