docs: add provider credential format guidance
This commit is contained in:
55
docs/monitor-provider-credentials.md
Normal file
55
docs/monitor-provider-credentials.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Provider 账号凭证格式(Monitor)
|
||||
|
||||
默认情况下,`credential` 可以直接填写 API Key 字符串。
|
||||
如果需要配置自定义 usage 端点,请使用 JSON 字符串。
|
||||
|
||||
## 基础格式
|
||||
```json
|
||||
{
|
||||
"api_key": "sk-...",
|
||||
"usage_url": "https://.../usage",
|
||||
"auth_header": "Authorization",
|
||||
"auth_scheme": "Bearer"
|
||||
}
|
||||
```
|
||||
|
||||
### 字段说明
|
||||
- `api_key`: API key(必填)
|
||||
- `usage_url`: 统计用量的 GET 端点(可选,minimax/kimi/qwen 推荐填写)
|
||||
- `auth_header`: 自定义鉴权头名(可选)
|
||||
- `auth_scheme`: 鉴权 scheme(如 `Bearer`),会拼成 `Bearer <api_key>`
|
||||
- `auth_value`: 直接指定头值(优先级高于 scheme)
|
||||
|
||||
## OpenAI
|
||||
默认使用 OpenAI 官方 billing endpoints(7天窗口):
|
||||
- `https://api.openai.com/v1/dashboard/billing/usage`
|
||||
- `https://api.openai.com/v1/dashboard/billing/subscription`
|
||||
|
||||
如需自定义可使用 JSON:
|
||||
```json
|
||||
{
|
||||
"api_key": "sk-...",
|
||||
"usage_url": "https://api.openai.com/v1/dashboard/billing/usage?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD",
|
||||
"subscription_url": "https://api.openai.com/v1/dashboard/billing/subscription"
|
||||
}
|
||||
```
|
||||
|
||||
## Anthropic
|
||||
官方 usage API 需要自行提供 `usage_url`(不同组织可能不同):
|
||||
```json
|
||||
{
|
||||
"api_key": "ak-...",
|
||||
"usage_url": "https://api.anthropic.com/.../usage"
|
||||
}
|
||||
```
|
||||
|
||||
## Minimax / Kimi / Qwen
|
||||
目前需要你提供 `usage_url`(具体端点取决于部署/账号):
|
||||
```json
|
||||
{
|
||||
"api_key": "...",
|
||||
"usage_url": "https://.../usage",
|
||||
"auth_header": "Authorization",
|
||||
"auth_scheme": "Bearer"
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user