Cogine LLM Gateway

渠道管理

获取所有渠道

GET
/api/channel/

Query Parameters

p?integer
page_size?integer
id_sort?boolean
tag_mode?boolean
status?string
type?integer

Response Body

curl -X GET "https://loading/api/channel/"
Empty

添加渠道

POST
/api/channel/

Request Body

application/json

mode?string
Value in"single" | "batch" | "multi_to_single"
channel?

Response Body

curl -X POST "https://loading/api/channel/" \  -H "Content-Type: application/json" \  -d '{}'
Empty

更新渠道

PUT
/api/channel/

Request Body

application/json

id?integer
name?string
type?integer
status?integer
models?string
groups?string
priority?integer
weight?integer
base_url?string
tag?string

Response Body

curl -X PUT "https://loading/api/channel/" \  -H "Content-Type: application/json" \  -d '{}'
Empty

搜索渠道

GET
/api/channel/search

Query Parameters

keyword?string
group?string
model?string

Response Body

curl -X GET "https://loading/api/channel/search"
Empty

获取渠道模型列表

GET
/api/channel/models

Response Body

curl -X GET "https://loading/api/channel/models"
Empty

获取已启用模型列表

GET
/api/channel/models_enabled

Response Body

curl -X GET "https://loading/api/channel/models_enabled"
Empty

获取指定渠道

GET
/api/channel/{id}

Path Parameters

id*integer

Response Body

curl -X GET "https://loading/api/channel/0"
Empty

删除渠道

DELETE
/api/channel/{id}

Path Parameters

id*integer

Response Body

curl -X DELETE "https://loading/api/channel/0"
Empty

获取渠道密钥

POST
/api/channel/{id}/key

Path Parameters

id*integer

Response Body

curl -X POST "https://loading/api/channel/0/key"
Empty

测试所有渠道

GET
/api/channel/test

Response Body

curl -X GET "https://loading/api/channel/test"
Empty

测试指定渠道

GET
/api/channel/test/{id}

Path Parameters

id*integer

Response Body

curl -X GET "https://loading/api/channel/test/0"
Empty

更新所有渠道余额

GET
/api/channel/update_balance

Response Body

curl -X GET "https://loading/api/channel/update_balance"
Empty

更新指定渠道余额

GET
/api/channel/update_balance/{id}

Path Parameters

id*integer

Response Body

curl -X GET "https://loading/api/channel/update_balance/0"
Empty

删除已禁用渠道

DELETE
/api/channel/disabled

Response Body

curl -X DELETE "https://loading/api/channel/disabled"
Empty

批量删除渠道

POST
/api/channel/batch

Request Body

application/json

ids?array<integer>

Response Body

curl -X POST "https://loading/api/channel/batch" \  -H "Content-Type: application/json" \  -d '{}'
Empty

修复渠道能力

POST
/api/channel/fix

Response Body

curl -X POST "https://loading/api/channel/fix"
Empty

获取上游模型列表

GET
/api/channel/fetch_models/{id}

Path Parameters

id*integer

Response Body

curl -X GET "https://loading/api/channel/fetch_models/0"
Empty

获取模型列表

POST
/api/channel/fetch_models

Request Body

application/json

base_url?string
type?integer
key?string

Response Body

curl -X POST "https://loading/api/channel/fetch_models" \  -H "Content-Type: application/json" \  -d '{}'
Empty

批量设置渠道标签

POST
/api/channel/batch/tag

Request Body

application/json

ids?array<integer>
tag?string

Response Body

curl -X POST "https://loading/api/channel/batch/tag" \  -H "Content-Type: application/json" \  -d '{}'
Empty

获取标签模型

GET
/api/channel/tag/models

Query Parameters

tag*string

Response Body

curl -X GET "https://loading/api/channel/tag/models?tag=string"
Empty

禁用标签渠道

POST
/api/channel/tag/disabled

Request Body

application/json

tag?string

Response Body

curl -X POST "https://loading/api/channel/tag/disabled" \  -H "Content-Type: application/json" \  -d '{}'
Empty

启用标签渠道

POST
/api/channel/tag/enabled

Request Body

application/json

tag?string

Response Body

curl -X POST "https://loading/api/channel/tag/enabled" \  -H "Content-Type: application/json" \  -d '{}'
Empty

编辑标签渠道

PUT
/api/channel/tag

Request Body

application/json

tag?string
new_tag?string
priority?integer
weight?integer

Response Body

curl -X PUT "https://loading/api/channel/tag" \  -H "Content-Type: application/json" \  -d '{}'
Empty

复制渠道

POST
/api/channel/copy/{id}

Path Parameters

id*integer

Query Parameters

suffix?string
reset_balance?boolean

Response Body

curl -X POST "https://loading/api/channel/copy/0"
Empty

管理多密钥

POST
/api/channel/multi_key/manage

Request Body

application/json

channel_id?integer
action?string
Value in"get_key_status" | "disable_key" | "enable_key" | "delete_key" | "delete_disabled_keys" | "enable_all_keys" | "disable_all_keys"
key_index?integer

Response Body

curl -X POST "https://loading/api/channel/multi_key/manage" \  -H "Content-Type: application/json" \  -d '{}'
Empty