diff --git a/README.md b/README.md index 5f2bcd88..867f4b28 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,14 @@ CLIProxyAPI includes integrated support for [Amp CLI](https://ampcode.com) and A - **Model mapping** to route unavailable models to alternatives (e.g., `claude-opus-4.5` → `claude-sonnet-4`) - Security-first design with localhost-only management endpoints +When you need the request/response shape of a specific backend family, use the provider-specific paths instead of the merged `/v1/...` endpoints: + +- Use `/api/provider/{provider}/v1/messages` for messages-style backends. +- Use `/api/provider/{provider}/v1beta/models/...` for model-scoped generate endpoints. +- Use `/api/provider/{provider}/v1/chat/completions` for chat-completions backends. + +These routes help you select the protocol surface, but they do not by themselves guarantee a unique inference executor when the same client-visible model name is reused across multiple backends. Inference routing is still resolved from the request model/alias. For strict backend pinning, use unique aliases, prefixes, or otherwise avoid overlapping client-visible model names. + **→ [Complete Amp CLI Integration Guide](https://help.router-for.me/agent-client/amp-cli.html)** ## SDK Docs diff --git a/README_CN.md b/README_CN.md index 9b47ef3e..28179194 100644 --- a/README_CN.md +++ b/README_CN.md @@ -77,6 +77,14 @@ CLIProxyAPI 已内置对 [Amp CLI](https://ampcode.com) 和 Amp IDE 扩展的支 - 智能模型回退与自动路由 - 以安全为先的设计,管理端点仅限 localhost +当你需要某一类后端的请求/响应协议形态时,优先使用 provider-specific 路径,而不是合并后的 `/v1/...` 端点: + +- 对于 messages 风格的后端,使用 `/api/provider/{provider}/v1/messages`。 +- 对于按模型路径暴露生成接口的后端,使用 `/api/provider/{provider}/v1beta/models/...`。 +- 对于 chat-completions 风格的后端,使用 `/api/provider/{provider}/v1/chat/completions`。 + +这些路径有助于选择协议表面,但当多个后端复用同一个客户端可见模型名时,它们本身并不能保证唯一的推理执行器。实际的推理路由仍然根据请求里的 model/alias 解析。若要严格钉住某个后端,请使用唯一 alias、前缀,或避免让多个后端暴露相同的客户端模型名。 + **→ [Amp CLI 完整集成指南](https://help.router-for.me/cn/agent-client/amp-cli.html)** ## SDK 文档 diff --git a/README_JA.md b/README_JA.md index 8d5cb2bc..41a438eb 100644 --- a/README_JA.md +++ b/README_JA.md @@ -78,6 +78,14 @@ CLIProxyAPIは[Amp CLI](https://ampcode.com)およびAmp IDE拡張機能の統 - 利用できないモデルを代替モデルにルーティングする**モデルマッピング**(例:`claude-opus-4.5` → `claude-sonnet-4`) - localhostのみの管理エンドポイントによるセキュリティファーストの設計 +特定のバックエンド系統のリクエスト/レスポンス形状が必要な場合は、統合された `/v1/...` エンドポイントよりも provider-specific のパスを優先してください。 + +- messages 系のバックエンドには `/api/provider/{provider}/v1/messages` +- モデル単位の generate 系エンドポイントには `/api/provider/{provider}/v1beta/models/...` +- chat-completions 系のバックエンドには `/api/provider/{provider}/v1/chat/completions` + +これらのパスはプロトコル面の選択には役立ちますが、同じクライアント向けモデル名が複数バックエンドで再利用されている場合、それだけで推論実行系が一意に固定されるわけではありません。実際の推論ルーティングは、引き続きリクエスト内の model/alias 解決に従います。厳密にバックエンドを固定したい場合は、一意な alias や prefix を使うか、クライアント向けモデル名の重複自体を避けてください。 + **→ [Amp CLI統合ガイドの完全版](https://help.router-for.me/agent-client/amp-cli.html)** ## SDKドキュメント diff --git a/config.example.yaml b/config.example.yaml index 42867ecb..1b365d87 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -281,6 +281,10 @@ nonstream-keepalive-interval: 0 # These aliases rename model IDs for both model listing and request routing. # Supported channels: gemini-cli, vertex, aistudio, antigravity, claude, codex, qwen, iflow, kimi. # NOTE: Aliases do not apply to gemini-api-key, codex-api-key, claude-api-key, openai-compatibility, vertex-api-key, or ampcode. +# NOTE: Because aliases affect the merged /v1 model list and merged request routing, overlapping +# client-visible names can become ambiguous across providers. /api/provider/{provider}/... helps +# you select the protocol surface, but inference backend selection can still follow the resolved +# model/alias. For strict backend pinning, use unique aliases/prefixes or avoid overlapping names. # You can repeat the same name with different aliases to expose multiple client model names. # oauth-model-alias: # gemini-cli: