iFlow Provider 支持两种认证方式:OAuth 和 Cookie。
iFlow 是一个 AI 服务提供商,ProxyCast 支持通过 OAuth 或 Cookie 方式使用其服务。
通过 OAuth 协议认证,支持自动刷新 Token。
通过导入浏览器 Cookie 认证,适用于不支持 OAuth 的场景。
credential_pool:
iflow:
- id: "iflow-oauth"
token_file: "iflow/oauth.json"
auth_type: "oauth"
disabled: false
proxy_url: "http://proxy:8080" # 可选
credential_pool:
iflow:
- id: "iflow-cookie"
auth_type: "cookie"
cookies: "session_id=abc123; auth_token=xyz789"
disabled: false
proxy_url: "http://proxy:8080" # 可选
| 配置项 | 类型 | 必填 | 说明 |
|---|---|---|---|
| id | string | ✅ | 凭证唯一标识 |
| auth_type | string | ✅ | 认证类型:oauth 或 cookie |
| token_file | string | OAuth | Token 文件路径(OAuth 模式必填) |
| cookies | string | Cookie | Cookie 字符串(Cookie 模式必填) |
| disabled | boolean | ❌ | 是否禁用此凭证 |
| proxy_url | string | ❌ | 单独的代理 URL |
{
"access_token": "eyJ...",
"refresh_token": "eyJ...",
"expires_at": "2025-01-01T00:00:00Z"
}
session_id=abc123; auth_token=xyz789; user_id=12345
curl http://127.0.0.1:8999/v1/chat/completions \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "iflow-model",
"messages": [{"role": "user", "content": "Hello!"}]
}'
将 iFlow 模型路由到 iFlow Provider:
routing:
rules:
- pattern: "iflow-*"
provider: "iflow"
priority: 1
credential_pool:
iflow:
# OAuth 账号
- id: "iflow-oauth-1"
token_file: "iflow/account1.json"
auth_type: "oauth"
# Cookie 账号
- id: "iflow-cookie-1"
auth_type: "cookie"
cookies: "session_id=abc123"