Skip to content

docs(anthropic): 1M context window section should clarify API key requirement #3

@jtil4201

Description

@jtil4201

Problem

The 1M context window (beta) section's warning only mentions "Legacy token auth (sk-ant-oat-*)" as unsupported, but the actual OpenClaw runtime rejects the context-1m beta header for all non-API-key auth, including Claude CLI. The runtime log reads:

ignoring context1m for Anthropic Claude CLI or legacy token auth

This can mislead Claude CLI users into thinking context1m: true will work for them when it silently falls back to standard context.

Suggested changes

1. Update the warning to lead with the API key requirement:

Current:

Requires long-context access on your Anthropic credential. Legacy token auth (`sk-ant-oat-*`) is rejected for 1M context requests...

Suggested:

Requires an Anthropic API key. Claude CLI auth and OAuth/subscription tokens (`sk-ant-oat-*`) do not support 1M context. OpenClaw silently falls back to the standard context window and logs a warning. If you are using Claude CLI as your auth method, this param has no effect.

2. Add a line listing supported models:

Supported models: `anthropic/claude-opus-4-6` and `anthropic/claude-sonnet-4-6`.

The code accepts both via isAnthropic1MModel(), but the current example only shows Opus.

3. Branch with fix available:

A branch with these changes is at jtil4201:fix/anthropic-1m-context-docs if you'd prefer to pull directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions