修改令牌
▼
Authorization
在发起请求头中加入配置项 Authorization,其值为 Bearer 之后拼接 Token
用例:
Authorization: Bearer ********************
入参配置
发起请求头配置项
content-type
string
必须传入
用例: application/json
new-api-user
string
必须传入
用例: 1
Authorization
string
非必须传入
系统令牌
发起请求体配置项 application/json
name
string
必须传入
令牌名字
remain_quota
integer
必须传入
50w为1刀
expired_time
integer
必须传入
到期时间戳 单位秒 没有到期限制设定为-1
unlimited_quota
boolean
必须传入
无限额度配置
model_limits_enabled
boolean
必须传入
可用模型限制设定
model_limits
string
必须传入
可用模型列表: 模型名字按,号分割
allow_ips
string
必须传入
白名单IP列表: 按\n号分割
group
string
必须传入
全面支持分组 按,号分割
用例
{
"id": 194804,
"remain_quota": 250000000000,
"expired_time": -1,
"unlimited_quota": false,
"model_limits_enabled": false,
"model_limits": "",
"group": "",
"mj_image_mode": "default",
"mj_custom_proxy": "",
"selected_groups": [],
"name": "令牌22名字",
"allow_ips": ""
}
发起调用代码用例
curl --location --request PUT 'https://api.timrouter.com/api/token/' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 194804,
"remain_quota": 250000000000,
"expired_time": -1,
"unlimited_quota": false,
"model_limits_enabled": false,
"model_limits": "",
"group": "",
"mj_image_mode": "default",
"mj_custom_proxy": "",
"selected_groups": [],
"name": "令牌22名字",
"allow_ips": ""
}'
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer YOUR_API_KEY");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"id": 194804,
"remain_quota": 250000000000,
"expired_time": -1,
"unlimited_quota": false,
"model_limits_enabled": false,
"model_limits": "",
"group": "",
"mj_image_mode": "default",
"mj_custom_proxy": "",
"selected_groups": [],
"name": "令牌22名字",
"allow_ips": ""
});
var requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.timrouter.com/api/token/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import http.client
import json
conn = http.client.HTTPSConnection("api.timrouter.com")
payload = json.dumps({
"id": 194804,
"remain_quota": 250000000000,
"expired_time": -1,
"unlimited_quota": False,
"model_limits_enabled": False,
"model_limits": "",
"group": "",
"mj_image_mode": "default",
"mj_custom_proxy": "",
"selected_groups": [],
"name": "令牌22名字",
"allow_ips": ""
})
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
conn.request("PUT", "/api/token/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
端点响应
输出参数详细说明 🟢 200 OK · application/json
object
非必须传入
{}
用例
{}