docs: add anthropic-messages protocol examples to README and config
Add configuration examples and documentation for the new anthropic-messages protocol: - config.example.json: Add claude-opus-4.6 example with anthropic-messages - README.md: Add "Anthropic Messages API (native format)" section - README.zh.md: Add Chinese version of the documentation This helps users understand when to use anthropic-messages vs anthropic protocol and fixes issue #269. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c602550576
commit
27a626c4d9
3 changed files with 43 additions and 0 deletions
18
README.md
18
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.
|
> 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)**
|
**Ollama (local)**
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|
|
||||||
18
README.zh.md
18
README.zh.md
|
|
@ -593,6 +593,24 @@ Agent 读取 HEARTBEAT.md
|
||||||
|
|
||||||
> 运行 `picoclaw auth login --provider anthropic` 来设置 OAuth 凭证。
|
> 运行 `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 (本地)**
|
**Ollama (本地)**
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,13 @@
|
||||||
"api_base": "https://api.anthropic.com/v1",
|
"api_base": "https://api.anthropic.com/v1",
|
||||||
"thinking_level": "high"
|
"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_name": "gemini",
|
||||||
"model": "antigravity/gemini-2.0-flash",
|
"model": "antigravity/gemini-2.0-flash",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue