Definir o limite mensal
curl --request PUT \
--url https://api.validator.blubash.io/v1/billing/spend-limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"monthly_limit": "2000.00",
"warning_pct": 80
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({monthly_limit: '2000.00', warning_pct: 80})
};
fetch('https://api.validator.blubash.io/v1/billing/spend-limit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.validator.blubash.io/v1/billing/spend-limit"
payload = {
"monthly_limit": "2000.00",
"warning_pct": 80
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"monthly_limit": "2000.0000",
"spent_this_month": "37.2000",
"warning_pct": 80
}Recargas e cobrança
Definir o limite mensal
Liga o limite (monthly_limit > 0) ou desliga (null). O limite conta consultas e lotes do mês de São Paulo; ao atingi-lo, consultas respondem 429 spend_limit_reached e lotes são recusados (spend_limit_reached) até o dia 1º. Ao cruzar warning_pct, enviamos uma vez por mês o evento spend.warning.
Escopo exigido: billing. Bloqueada para workspace suspenso (403 workspace_suspended).
PUT
/
v1
/
billing
/
spend-limit
Definir o limite mensal
curl --request PUT \
--url https://api.validator.blubash.io/v1/billing/spend-limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"monthly_limit": "2000.00",
"warning_pct": 80
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({monthly_limit: '2000.00', warning_pct: 80})
};
fetch('https://api.validator.blubash.io/v1/billing/spend-limit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.validator.blubash.io/v1/billing/spend-limit"
payload = {
"monthly_limit": "2000.00",
"warning_pct": 80
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"monthly_limit": "2000.0000",
"spent_this_month": "37.2000",
"warning_pct": 80
}Authorizations
Body
application/json