跳到主要内容

更新用户通知设置

PUT /api/user/setting

更新当前用户的额度预警与通知设置,支持邮件、Webhook、Bark、Gotify、短信等多种通知方式。

鉴权说明

用户控制台接口,需登录用户身份(会话 Cookie,或 Authorization: Bearer <access_token>)。此令牌与模型调用使用的 sk- 密钥不同。

请求体参数​

参数名类型必选说明
notify_typestring必选通知类型:email、webhook、bark、gotify、sms
quota_warning_thresholdnumber必选额度预警阈值,必须大于 0
notification_emailstring可选通知邮箱(notify_type=email 时使用,需含 @)
webhook_urlstring可选Webhook 地址(notify_type=webhook 时必填)
webhook_secretstring可选Webhook 密钥
bark_urlstring可选Bark 推送地址(notify_type=bark 时必填,须为 http/https)
gotify_urlstring可选Gotify 地址(notify_type=gotify 时使用)
gotify_tokenstring可选Gotify Token
gotify_priorityinteger可选Gotify 优先级
notification_phonestring可选通知手机号(notify_type=sms 时使用)
accept_unset_model_ratio_modelboolean可选是否接受未设置倍率的模型
record_ip_logboolean可选是否记录 IP 日志
请求示例
{
"notify_type": "email",
"quota_warning_threshold": 500000,
"notification_email": "user@example.com",
"accept_unset_model_ratio_model": false,
"record_ip_log": true
}

响应字段(200)​

字段名类型说明
successboolean是否成功
messagestring提示信息