Skip to content
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions config/config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading
Loading