通用请求说明(Base URL 与鉴权)#
1. 服务地址#
| 服务 | Base URL | 说明 |
|---|
| AI 大模型 API | https://platform.shuyanai.com | 文本、图像、视频等全 部模型接口 |
| 搜索阅读 API | https://api.shuyanai.com | /v1/search、/v1/reader、/v1/document/parse 等,须使用搜索阅读 Key |
旧文档中的 cloud.shuyanai.com 目前仍可访问,已有集成可继续使用;新接入请统一使用 platform.shuyanai.com。
2. 什么时候加 /v1#
这是接入时最常见的错误。规则:OpenAI 兼容的 SDK 和工具加 /v1,Anthropic 协议的 SDK 和工具不加。| 客户端 | 应填写的 Base URL |
|---|
| OpenAI SDK(Python / Node.js 等) | https://platform.shuyanai.com/v1 |
| Codex、Cursor、Cline、OpenCode、OpenClaw、N8N、AutoClaw 等 OpenAI 兼容工具 | https://platform.shuyanai.com/v1 |
| Anthropic SDK、Claude Code | https://platform.shuyanai.com |
| Gemini CLI、Grok CLI | https://platform.shuyanai.com |
| 直接发 HTTP 请求(cURL、Postman) | 写完整路径,如 https://platform.shuyanai.com/v1/chat/completions |
工具会在 Base URL 后自动拼接路径,多一层或少一层 /v1 都会导致 404。如果某个工具填 /v1 报 404,去掉 /v1 再试;反之亦然。
3. 鉴权#
所有接口使用 Bearer Token 鉴权,在请求头中携带 API Key(Bearer 与 Key 之间有一个空格):4. 数据格式#
除文件上传类接口外,请求与响应均为 JSON,请在请求头中带上:5. 请求示例#
下一步#
将 Key 和 Base URL 填入编程工具:开发工具接入。