本目录存放各中转站的 API 文档,供开发时参考。
国内 AI 中转站大多基于 NewAPI 搭建或二次开发。NewAPI 是从 OneAPI fork 而来(OneAPI 已停止维护)。
因此不同中转站的 API 格式高度相似,但仍存在细微差异,需分别记录。
docs/internal/api/
├── {中转站名}/
│ ├── README.md # 中转站概述、文档来源、目录索引
│ ├── {api格式}.md # 具体 API 文档
│ └── ...
└── README.md # 本文件
| 目录 | 中转站 | 文档来源 |
|---|---|---|
| yunwu/ | 云雾 | https://yunwu.apifox.cn/llms.txt |
| ephone/ | ephone | https://apiai.apifox.cn/ |
| aabao/ | aabao | https://apifox.newapi.ai/llms.txt |
- 来源追溯:每个文档必须在头部注明来源 URL
- 细节完整:记录所有参数、枚举值、状态码,不可省略
- 实测补充:上游文档缺失但实测发现的内容,标注"实测补充"
- 差异对比:同类 API 在不同中转站的差异,应在文档末尾对比
API 格式和模型类型的归并/拆分决策,记录在 docs/dev-spec/上游服务接口设计.md。
API 文档 代码实现
─────────────────────────────────────────────────
{中转站}/{api格式}.md → server/services/providers/{provider}.ts
├── meta.apiFormat # API 格式标识
├── meta.capabilities # 参数能力
└── createService() # 请求实现
app/shared/types.ts
├── ApiFormat # 所有 API 格式枚举
├── VideoModelType # 视频模型类型
├── SoraVideoParams # Sora 专用参数
└── ...
- 从中转站获取 API 文档,记录到
docs/internal/api/{中转站}/ - 在
app/shared/types.ts添加ApiFormat枚举值(如需要) - 在
server/services/providers/实现 Provider - 在
app/shared/registry.ts注册 Provider 元数据