You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
google-vertex-anthropic provider can't use the 1M context window for Opus 4. #14003
The google-vertex-anthropic provider can't use the 1M context window for Opus 4.6. I had OpenCode explore a bit why, as I have Opus 4.6 [1M] working correctly with Claude Code on the same provider.
It seems to be because Vertex AI requires the beta flag as a body parameter ("anthropic_beta": ["context-1m-2025-08-07"]), not an HTTP header. Setting headers in provider config sends it as an HTTP header, which Vertex rejects with "Unexpected value(s) for the anthropic-beta header". There's no config option to inject body parameters. Confirmed via curl that the body param form works on the same endpoint.
# Note: I am on a regional endpoint
curl -X POST \
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
-H "Content-Type: application/json" \
"https://$GCLOUD_REGION-aiplatform.googleapis.com/v1/projects/$GCLOUD_PROJECT/locations/$GCLOUD_REGION/publishers/anthropic/models/claude-opus-4-6:rawPredict" \
-d '{"anthropic_version":"vertex-2023-10-16","anthropic_beta":["context-1m-2025-08-07"],"messages":[...],"max_tokens":20}'
Claude Code seems to handle this by auto-converting the header to a body param in its Vertex SDK adapter — the @ai-sdk/google-vertex/anthropic package used by OpenCode doesn't do this.
All these issues seem to be related, just not for Vertex but for Zen/Bedrock: #12452, #12338, #13199
Plugins
No response
OpenCode version
1.1.60
Steps to reproduce
Configure google-vertex-anthropic with claude-opus-4-6 and set limit.context: 1000000
Add "headers": {"anthropic-beta": "context-1m-2025-08-07"} to provider options
API returns 400: "Unexpected value(s) context-1m-2025-08-07 for the anthropic-beta header"
Activity
inventumamet commentedon Feb 22, 2026
i'm on 1.2.10 and it's still not fixed
fstanis commentedon Mar 27, 2026
I think this should ideally be added to https://github.com/vercel/ai?
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.