`opus` alias defaults to Opus 4.1 on Vertex AI, but Opus 4.5 on direct API
This issue was raised by Claude Code after searching for duplicates using gh search issues.
Description
When using Claude Code with Vertex AI (CLAUDE_CODE_USE_VERTEX=1), the opus model alias resolves to claude-opus-4-1@20250805. However, with the direct Anthropic API, opus resolves to Opus 4.5.
This asymmetry causes issues when a GCP project has Opus 4.5 available but not Opus 4.1.
Environment
- Claude Code version: 2.1.7
- Platform: macOS (arm64)
- Provider: Google Cloud Vertex AI
- Region: us-east5
Steps to Reproduce
- Configure Claude Code for Vertex AI:
``bash``
export CLAUDE_CODE_USE_VERTEX=1
export ANTHROPIC_VERTEX_PROJECT_ID=<your-project>
- Start Claude Code with the opus model:
``bash``
claude --model opus
- Observe error:
``projects/<project>/locations/us-east5/publishers/anthropic/models/claude-opus-4-1@20250805
API Error: 404 {"error":{"code":404,"message":"Publisher Model
``
was not found or your project does not have access to it."}}
Root Cause
The model resolution logic uses different defaults per provider:
function tqT() {
if (process.env.ANTHROPIC_DEFAULT_OPUS_MODEL)
return process.env.ANTHROPIC_DEFAULT_OPUS_MODEL;
if (wD() === "firstParty")
return z3().opus45; // Direct API → Opus 4.5
return z3().opus41; // Vertex/Bedrock → Opus 4.1
}
Workaround
Set the environment variable to override:
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5@20251101"
Suggested Fix
- Update the Vertex/Bedrock default to Opus 4.5 (matching direct API behavior), or
- Document the
ANTHROPIC_DEFAULT_OPUS_MODELenvironment variable for users who need to override
Related Issues
- #17760 -
ANTHROPIC_DEFAULT_OPUS_MODELenv var not honored when selecting from /model list - #13647 - Model selection defaults to Opus 4.1 when Opus 4.5 is selected
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗