Skip to main content

获取渠道列表

GET /api/channel/?p={page}&page_size={size}

获取渠道详情

GET /api/channel/{id}

创建渠道

POST /api/channel/
{
  "name": "openai-main",
  "type": 1,
  "key": "sk-xxxxxx",
  "base_url": "https://api.openai.com",
  "models": "gpt-4o,gpt-4o-mini",
  "groups": "default,vip",
  "priority": 0,
  "weight": 1
}
字段说明
type渠道类型(1=OpenAI, 3=Azure, 14=Anthropic, 24=Gemini 等)
key上游 API Key
base_url自定义代理地址
models支持模型,逗号分隔
groups归属分组
priority优先级
weight权重

更新渠道

PUT /api/channel/

删除渠道

DELETE /api/channel/{id}

测试渠道

GET /api/channel/test/{id}?model={model}

批量删除失效渠道

DELETE /api/channel/disabled

更新渠道余额

GET /api/channel/update_balance/{id}