修改 Key 预算
curl --request PATCH \
--url https://api.omnirelay.ai/v1/manage/keys/{id}/budget \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"budget": 50000000,
"remaining": 50000000,
"resetPeriod": "monthly"
}
'import requests
url = "https://api.omnirelay.ai/v1/manage/keys/{id}/budget"
payload = {
"budget": 50000000,
"remaining": 50000000,
"resetPeriod": "monthly"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({budget: 50000000, remaining: 50000000, resetPeriod: 'monthly'})
};
fetch('https://api.omnirelay.ai/v1/manage/keys/{id}/budget', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}管理 API
修改 Key 预算
修改预算控制;修改 budget 不补充当前剩余额度,补充时显式设置 remaining。清除预算须设 resetPeriod=none、remaining=null,周期预算必须大于零。
PATCH
/
v1
/
manage
/
keys
/
{id}
/
budget
修改 Key 预算
curl --request PATCH \
--url https://api.omnirelay.ai/v1/manage/keys/{id}/budget \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"budget": 50000000,
"remaining": 50000000,
"resetPeriod": "monthly"
}
'import requests
url = "https://api.omnirelay.ai/v1/manage/keys/{id}/budget"
payload = {
"budget": 50000000,
"remaining": 50000000,
"resetPeriod": "monthly"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({budget: 50000000, remaining: 50000000, resetPeriod: 'monthly'})
};
fetch('https://api.omnirelay.ai/v1/manage/keys/{id}/budget', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "model_unavailable",
"message": "The model does not exist or is disabled.",
"type": "not_found_error",
"param": "<string>"
},
"request_id": "<string>"
}授权
在控制台创建的管理密钥;read 可读取,write 还可修改 API Key。不接受推理 API Key。
路径参数
Pattern:
^[A-Za-z0-9-]{1,80}$请求体
application/json
响应
请求成功。