Cogine LLM Gateway

用户管理

获取当前用户分组

GET
/api/user/self/groups

Response Body

curl -X GET "https://loading/api/user/self/groups"
Empty

获取当前用户信息

GET
/api/user/self

Response Body

curl -X GET "https://loading/api/user/self"
Empty

注销当前用户

DELETE
/api/user/self

Response Body

curl -X DELETE "https://loading/api/user/self"
Empty

更新当前用户信息

PUT
/api/user/self

Request Body

application/json

username?string
display_name?string
password?string
original_password?string

Response Body

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

获取用户可用模型

GET
/api/user/models

Response Body

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

生成访问令牌

GET
/api/user/token

Response Body

curl -X GET "https://loading/api/user/token"
Empty

获取Passkey状态

GET
/api/user/passkey

Response Body

curl -X GET "https://loading/api/user/passkey"
Empty

删除Passkey

DELETE
/api/user/passkey

Response Body

curl -X DELETE "https://loading/api/user/passkey"
Empty

开始注册Passkey

POST
/api/user/passkey/register/begin

Response Body

curl -X POST "https://loading/api/user/passkey/register/begin"
Empty

完成注册Passkey

POST
/api/user/passkey/register/finish

Response Body

curl -X POST "https://loading/api/user/passkey/register/finish"
Empty

开始验证Passkey

POST
/api/user/passkey/verify/begin

Response Body

curl -X POST "https://loading/api/user/passkey/verify/begin"
Empty

完成验证Passkey

POST
/api/user/passkey/verify/finish

Response Body

curl -X POST "https://loading/api/user/passkey/verify/finish"
Empty

获取邀请码

GET
/api/user/aff

Response Body

curl -X GET "https://loading/api/user/aff"
Empty

转换邀请额度

POST
/api/user/aff_transfer

Request Body

application/json

quota?integer

Response Body

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

更新用户设置

PUT
/api/user/setting

Request Body

application/json

notify_type?string
quota_warning_threshold?number
webhook_url?string
notification_email?string

Response Body

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

获取所有充值记录

GET
/api/user/topup

Response Body

curl -X GET "https://loading/api/user/topup"
Empty

获取所有用户

GET
/api/user/

Query Parameters

p?integer
page_size?integer

Response Body

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

创建用户

POST
/api/user/

Request Body

application/json

id?integer
username?string
display_name?string
role?integer
status?integer
email?string
group?string
quota?integer
used_quota?integer
request_count?integer

Response Body

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

更新用户

PUT
/api/user/

Request Body

application/json

id?integer
username?string
display_name?string
role?integer
status?integer
email?string
group?string
quota?integer
used_quota?integer
request_count?integer

Response Body

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

管理员完成充值

POST
/api/user/topup/complete

Response Body

curl -X POST "https://loading/api/user/topup/complete"
Empty

搜索用户

GET
/api/user/search

Query Parameters

keyword?string
group?string

Response Body

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

获取指定用户

GET
/api/user/{id}

Path Parameters

id*integer

Response Body

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

删除用户

DELETE
/api/user/{id}

Path Parameters

id*integer

Response Body

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

管理员重置用户Passkey

DELETE
/api/user/{id}/reset_passkey

Path Parameters

id*integer

Response Body

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

管理员禁用用户2FA

DELETE
/api/user/{id}/2fa

Path Parameters

id*integer

Response Body

curl -X DELETE "https://loading/api/user/0/2fa"
Empty

管理用户状态

POST
/api/user/manage

Request Body

application/json

id?integer
action?string
Value in"disable" | "enable" | "delete" | "promote" | "demote"

Response Body

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