更新用户设置
curl --request PUT \
--url https://zero.cat/api/user/setting \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"notify_type": "email",
"quota_warning_threshold": 0,
"quota_warning_enabled": true,
"notification_email": "",
"webhook_url": "",
"webhook_secret": "",
"bark_url": "",
"gotify_url": "",
"gotify_token": "",
"gotify_priority": 5,
"accept_unset_model_ratio_model": false,
"record_ip_log": false
}
'import requests
url = "https://zero.cat/api/user/setting"
payload = {
"notify_type": "email",
"quota_warning_threshold": 0,
"quota_warning_enabled": True,
"notification_email": "",
"webhook_url": "",
"webhook_secret": "",
"bark_url": "",
"gotify_url": "",
"gotify_token": "",
"gotify_priority": 5,
"accept_unset_model_ratio_model": False,
"record_ip_log": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
notify_type: 'email',
quota_warning_threshold: 0,
quota_warning_enabled: true,
notification_email: '',
webhook_url: '',
webhook_secret: '',
bark_url: '',
gotify_url: '',
gotify_token: '',
gotify_priority: 5,
accept_unset_model_ratio_model: false,
record_ip_log: false
})
};
fetch('https://zero.cat/api/user/setting', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": ""
}用户信息
更新用户设置
需要个人访问令牌,作用域:profile:write(个人资料 → 编辑)。
会用请求体整体覆盖通知与偏好设置,未提交的字段会恢复为默认值。
PUT
/
api
/
user
/
setting
更新用户设置
curl --request PUT \
--url https://zero.cat/api/user/setting \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"notify_type": "email",
"quota_warning_threshold": 0,
"quota_warning_enabled": true,
"notification_email": "",
"webhook_url": "",
"webhook_secret": "",
"bark_url": "",
"gotify_url": "",
"gotify_token": "",
"gotify_priority": 5,
"accept_unset_model_ratio_model": false,
"record_ip_log": false
}
'import requests
url = "https://zero.cat/api/user/setting"
payload = {
"notify_type": "email",
"quota_warning_threshold": 0,
"quota_warning_enabled": True,
"notification_email": "",
"webhook_url": "",
"webhook_secret": "",
"bark_url": "",
"gotify_url": "",
"gotify_token": "",
"gotify_priority": 5,
"accept_unset_model_ratio_model": False,
"record_ip_log": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
notify_type: 'email',
quota_warning_threshold: 0,
quota_warning_enabled: true,
notification_email: '',
webhook_url: '',
webhook_secret: '',
bark_url: '',
gotify_url: '',
gotify_token: '',
gotify_priority: 5,
accept_unset_model_ratio_model: false,
record_ip_log: false
})
};
fetch('https://zero.cat/api/user/setting', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": ""
}授权
个人访问令牌(nap_ 开头),在控制台「安全与访问 → 访问令牌」中创建,不是 sk- 开头的 API 密钥。
请求体
application/json
额度预警的通知方式:email、webhook、bark、gotify
示例:
"email"
余额低于这个值时提醒,0 表示使用系统默认值
示例:
0
是否开启额度预警
示例:
true
通知邮箱,不填则使用账户邮箱
示例:
""
Webhook 地址,notify_type 为 webhook 时必填
示例:
""
Webhook 签名密钥
示例:
""
Bark 推送地址
示例:
""
Gotify 服务地址
示例:
""
Gotify 应用令牌
示例:
""
Gotify 消息优先级
示例:
5
是否接受调用未设置价格的模型
示例:
false
是否在使用日志中记录请求 IP
示例:
false

