Update key budget
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>"
}Management
Update key budget
Updates spending controls. Changing budget does not refill existing remaining allowance. To refill, explicitly set remaining. Clearing budget requires resetPeriod=none and remaining=null. Periodic budgets must be positive.
PATCH
/
v1
/
manage
/
keys
/
{id}
/
budget
Update key budget
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>"
}Authorizations
Management key created in the console. read scope reads; write scope also changes API keys. Inference API keys are not accepted.
Path Parameters
Pattern:
^[A-Za-z0-9-]{1,80}$Body
application/json
Response
Successful response.