Set the daily run cap and usage emails
curl --request PUT \
--url https://api.peel.sh/v1/quota \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"daily_run_cap": 500000,
"usage_alerts": [
50
],
"monthly_summary": true
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({daily_run_cap: 500000, usage_alerts: [50], monthly_summary: true})
};
fetch('https://api.peel.sh/v1/quota', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.peel.sh/v1/quota"
payload = {
"daily_run_cap": 500000,
"usage_alerts": [50],
"monthly_summary": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"plan": "<string>",
"period_end": "2023-11-07T05:31:56Z",
"runs": {
"limit": 1,
"remaining": 1,
"reset_at": "2023-11-07T05:31:56Z"
},
"builds": {
"limit": 1,
"used": 1,
"remaining": 1,
"reset_at": "2023-11-07T05:31:56Z"
},
"build_budget": {
"limit_usd": 1,
"used_usd": 1,
"remaining_usd": 1,
"reset_at": "2023-11-07T05:31:56Z"
},
"daily_runs": {
"limit": 1,
"used": 1,
"reset_at": "2023-11-07T05:31:56Z"
},
"auto_recharge": {
"enabled": true,
"monthly_limit": 1
},
"emails": {
"usage_alerts": [
50
],
"monthly_summary": true
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}Account
Set the daily run cap and usage emails
Send any of the fields. Runs past daily_run_cap answer 429 quota_exceeded with details.quota daily_runs until midnight UTC; null removes the cap. usage_alerts lists the percentages of the plan’s runs at which an email goes out, once each per period; an empty list turns them off. monthly_summary turns the email at the end of each billing period on or off. Needs a full-access key.
PUT
/
v1
/
quota
Set the daily run cap and usage emails
curl --request PUT \
--url https://api.peel.sh/v1/quota \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"daily_run_cap": 500000,
"usage_alerts": [
50
],
"monthly_summary": true
}
'const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({daily_run_cap: 500000, usage_alerts: [50], monthly_summary: true})
};
fetch('https://api.peel.sh/v1/quota', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.peel.sh/v1/quota"
payload = {
"daily_run_cap": 500000,
"usage_alerts": [50],
"monthly_summary": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"plan": "<string>",
"period_end": "2023-11-07T05:31:56Z",
"runs": {
"limit": 1,
"remaining": 1,
"reset_at": "2023-11-07T05:31:56Z"
},
"builds": {
"limit": 1,
"used": 1,
"remaining": 1,
"reset_at": "2023-11-07T05:31:56Z"
},
"build_budget": {
"limit_usd": 1,
"used_usd": 1,
"remaining_usd": 1,
"reset_at": "2023-11-07T05:31:56Z"
},
"daily_runs": {
"limit": 1,
"used": 1,
"reset_at": "2023-11-07T05:31:56Z"
},
"auto_recharge": {
"enabled": true,
"monthly_limit": 1
},
"emails": {
"usage_alerts": [
50
],
"monthly_summary": true
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}Body
application/json
Response
The quota with the new cap.
⌘I