diff --git a/README.md b/README.md index 5cf9f6143..bc7376b8e 100644 --- a/README.md +++ b/README.md @@ -1097,6 +1097,24 @@ This design also enables **multi-agent support** with flexible provider selectio > Run `picoclaw auth login --provider anthropic` to paste your API token. +**Anthropic Messages API (native format)** + +For direct Anthropic API access or custom endpoints that only support Anthropic's native message format: + +```json +{ + "model_name": "claude-opus-4-6", + "model": "anthropic-messages/claude-opus-4-6", + "api_key": "sk-ant-your-key", + "api_base": "https://api.anthropic.com" +} +``` + +> Use `anthropic-messages` protocol when: +> - Connecting directly to Anthropic's API (fixes 404 errors with `/v1/messages` endpoint) +> - Using custom endpoints that only support Anthropic's native format +> - Avoiding OpenAI-compatible wrapper layers + **Ollama (local)** ```json diff --git a/README.zh.md b/README.zh.md index c744e0d20..29ebbc8aa 100644 --- a/README.zh.md +++ b/README.zh.md @@ -593,6 +593,24 @@ Agent 读取 HEARTBEAT.md > 运行 `picoclaw auth login --provider anthropic` 来设置 OAuth 凭证。 +**Anthropic Messages API(原生格式)** + +用于直接访问 Anthropic API 或仅支持 Anthropic 原生消息格式的自定义端点: + +```json +{ + "model_name": "claude-opus-4-6", + "model": "anthropic-messages/claude-opus-4-6", + "api_key": "sk-ant-your-key", + "api_base": "https://api.anthropic.com" +} +``` + +> 使用 `anthropic-messages` 协议的场景: +> - 直接连接 Anthropic API(修复 `/v1/messages` 端点的 404 错误) +> - 使用仅支持 Anthropic 原生格式的自定义端点 +> - 避免 OpenAI 兼容包装层 + **Ollama (本地)** ```json diff --git a/config/config.example.json b/config/config.example.json index 0e2cae8e5..4ae461381 100644 --- a/config/config.example.json +++ b/config/config.example.json @@ -25,6 +25,13 @@ "api_base": "https://api.anthropic.com/v1", "thinking_level": "high" }, + { + "_comment": "Anthropic Messages API - use native format for direct Anthropic API access", + "model_name": "claude-opus-4-6", + "model": "anthropic-messages/claude-opus-4-6", + "api_key": "sk-ant-your-key", + "api_base": "https://api.anthropic.com" + }, { "model_name": "gemini", "model": "antigravity/gemini-2.0-flash",