-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
When params.context1m: true is set in model config for an OAuth token (subscription auth via sk-ant-oat-*), the API returns:
HTTP 401: authentication_error: OAuth authentication is currently not supported.
The mergeAnthropicBetaHeader in OpenClaw correctly merges the context-1m-2025-08-07 beta alongside the existing OAuth betas (claude-code-20250219,oauth-2025-04-20). The issue is on Anthropic's server side — the context-1m beta header triggers a code path that rejects OAuth tokens entirely.
Claude Code CLI apparently gets 1M context for Max subscribers without using this explicit beta header (possibly granted implicitly through claude-code-20250219 or account tier).
Suggestion: Add a warning or guard in resolveAnthropicBetas to skip context-1m when the auth token is an OAuth token (sk-ant-oat-*), or document the incompatibility.
Environment:
- OpenClaw 2026.2.17
- Model: anthropic/claude-opus-4-6
- Auth: OAuth subscription token (Claude Max)