Reset budget consumption
curl --request POST \
--url https://api.orq.ai/v2/budgets/{budget_id}/reset-consumption \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.orq.ai/v2/budgets/{budget_id}/reset-consumption', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.orq.ai/v2/budgets/{budget_id}/reset-consumption"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"budget": {
"budgetId": "<string>",
"limits": {
"period": "BUDGET_PERIOD_UNSPECIFIED",
"amount": 123,
"tokenLimit": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"scope": {
"workspace": {},
"project": {
"projectId": "<string>"
},
"identity": {
"identityExternalId": "<string>"
},
"apiKey": {
"apiKeyId": "<string>"
},
"provider": {
"provider": "<string>"
},
"model": {
"modelId": "<string>"
}
},
"match": {
"cel": "<string>"
},
"rateLimit": {
"requestsPerMinute": 123
},
"isActive": false,
"expiresAt": "2023-11-07T05:31:56Z",
"usage": {
"amount": 123,
"tokens": 123,
"requests": 123
},
"alerts": [
{
"thresholdPercent": 123,
"notifierIds": [
"<string>"
],
"id": "<string>",
"dimension": "BUDGET_ALERT_DIMENSION_UNSPECIFIED"
}
]
}
}Budgets
Reset budget consumption
Clears the current-period cost, token, and request counters for the budget. The budget record itself is preserved.
POST
/
v2
/
budgets
/
{budget_id}
/
reset-consumption
Reset budget consumption
curl --request POST \
--url https://api.orq.ai/v2/budgets/{budget_id}/reset-consumption \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.orq.ai/v2/budgets/{budget_id}/reset-consumption', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.orq.ai/v2/budgets/{budget_id}/reset-consumption"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"budget": {
"budgetId": "<string>",
"limits": {
"period": "BUDGET_PERIOD_UNSPECIFIED",
"amount": 123,
"tokenLimit": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"scope": {
"workspace": {},
"project": {
"projectId": "<string>"
},
"identity": {
"identityExternalId": "<string>"
},
"apiKey": {
"apiKeyId": "<string>"
},
"provider": {
"provider": "<string>"
},
"model": {
"modelId": "<string>"
}
},
"match": {
"cel": "<string>"
},
"rateLimit": {
"requestsPerMinute": 123
},
"isActive": false,
"expiresAt": "2023-11-07T05:31:56Z",
"usage": {
"amount": 123,
"tokens": 123,
"requests": 123
},
"alerts": [
{
"thresholdPercent": 123,
"notifierIds": [
"<string>"
],
"id": "<string>",
"dimension": "BUDGET_ALERT_DIMENSION_UNSPECIFIED"
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Budget id whose current-period counters should be cleared.
Body
application/json
The body is of type object.
Response
200 - application/json
OK
Budget after reset. The record itself is unchanged; only counters were cleared.
Show child attributes
Show child attributes
Was this page helpful?