Why Choose Anthropic Native Mode
OpenClaw supports two ways to call Claude models. If you need tool calling (tool_use) and other advanced features, Anthropic native mode (anthropic-messages) is strongly recommended:
With
openai-completions, basic chat works fine, but multi-turn tool calling (tool_calls → tool_result → tool loop) may be rejected with a 400 error. Switching to anthropic-messages allows tool_use + tool_result format to work properly.Recommended Configuration
Edit~/.openclaw/openclaw.json and add the following provider configuration:
Critical Configuration Notes
About reasoning: false
Model Allowlist Configuration
Add models toagents.defaults.models, otherwise OpenClaw may report the model as “unregistered” and silently fall back to another model:
Comparison with OpenAI Compatible Mode
Claude Model ID List
Mixed Configuration (Recommended)
Configure both OpenAI compatible and Anthropic native providers, switching as needed:/model apiyi/gpt-5.4 or /model apiyi-claude/claude-sonnet-4-6 in chat to switch models.
Verify Configuration
After setup, verify that the configuration is working:meta.agentMeta.provider and meta.agentMeta.model match your configuration.
Troubleshooting
400 ValidationException: Operation not allowed
400 ValidationException: Operation not allowed
This is usually caused by thinking-related fields in the request. Ensure:
- Model entries have
"reasoning": falseset - Headers include
"anthropic-beta": ""correctly configured
Configuration changed but not taking effect
Configuration changed but not taking effect
Existing chat sessions may have cached the old model configuration. Two solutions:Patch the session model:Or reset the session:
Model silently falls back to another model
Model silently falls back to another model
Check if the model has been added to the
agents.defaults.models allowlist. Unregistered models will be automatically fallen back by OpenClaw.baseUrl path duplication error
baseUrl path duplication error
The Anthropic native mode
baseUrl must not include /v1. Using https://api.apiyi.com/v1 will result in .../v1/v1/messages, causing a 404 error.