开发文档
概览
通过一个兼容 OpenAI 的 endpoint 调用 10 家服务商的模型。在现有 SDK 中只需替换 base_url 与密钥即可发出首次调用。
快速开始
在控制台创建服务 API 密钥,然后修改以下三行。在 model 中填入模型目录中的模型 ID——本站可用的 ID 请在模型页面查看。
curl https://api.alpharouter.io/v1/chat/completions \ -H "Authorization: Bearer $ALPHAROUTER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-fable-5", "messages": [{"role":"user","content":"总结季度报告"}] }'支持的 endpoint
用同一个密钥即可访问以下全部路径。每个路径只会将兼容的模型纳入候选。
| Endpoint | Method | Type |
|---|---|---|
| /chat/completions | POST | Chat, streaming, tools, vision |
| /responses | POST | Server-stored conversations, SSE |
| /messages | POST | Anthropic-native shape |
| /embeddings | POST | Embedding, reranking |
| /images/generations | POST | Image generation, editing |
| /audio/speech | POST | Text to speech |
| /audio/transcriptions | POST | Speech to text |
| /models | GET | Catalog, pricing, specs |
下一步
- 请在身份验证文档中确认密钥类型与请求头规则。
- 请在模型页面查看本站可用的模型 ID。
- 请在错误处理文档中确认重试与幂等性规则。