curl --request PUT \
--url https://partner-api.ochy-prod.com/settings/low-credit-alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"threshold": 100,
"webhookUrl": "https://client.example.com/webhooks/ochy-credits"
}
'import requests
url = "https://partner-api.ochy-prod.com/settings/low-credit-alerts"
payload = {
"enabled": True,
"threshold": 100,
"webhookUrl": "https://client.example.com/webhooks/ochy-credits"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
threshold: 100,
webhookUrl: 'https://client.example.com/webhooks/ochy-credits'
})
};
fetch('https://partner-api.ochy-prod.com/settings/low-credit-alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Update low-credit alert settings
Replaces the low-credit alert settings for the credit scope of your API key. All fields
are written on every call: omitting webhookUrl removes a previously saved URL.
When enabled is true and an analysis brings your balance to or below threshold,
Ochy emails the user who saved the settings and, if webhookUrl is set, sends it a
credits.low event. The alert fires once per crossing, at most once per hour, and rearms
when the balance rises above the threshold. A threshold of 0 never fires.
curl --request PUT \
--url https://partner-api.ochy-prod.com/settings/low-credit-alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"threshold": 100,
"webhookUrl": "https://client.example.com/webhooks/ochy-credits"
}
'import requests
url = "https://partner-api.ochy-prod.com/settings/low-credit-alerts"
payload = {
"enabled": True,
"threshold": 100,
"webhookUrl": "https://client.example.com/webhooks/ochy-credits"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
threshold: 100,
webhookUrl: 'https://client.example.com/webhooks/ochy-credits'
})
};
fetch('https://partner-api.ochy-prod.com/settings/low-credit-alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Authorizations
Recommended. Pass your API key as a Bearer token in the Authorization header: Authorization: Bearer YOUR_API_KEY.
Body
Whether the alert is active.
true
The alert fires when an analysis brings the balance to or below this number of credits. 0 never fires.
0 <= x <= 10000100
Optional HTTP(S) URL that receives the credits.low event. Its host must not be a
private, loopback, or link-local address. Omit it to remove a previously saved URL.
"https://client.example.com/webhooks/ochy-credits"
Response
Settings saved. Body mirrors GET /settings/low-credit-alerts.
false when the scope has unlimited credits: alerts do not apply.
true
Present when applicable is false.
unlimited Credit scope of the API key.
personal, organization "organization"
Identifier of the credit scope the API key draws from.
"org_abc123"
true
100
Omitted when no URL is saved.
"https://client.example.com/webhooks/ochy-credits"
When the settings were last saved (ISO 8601 UTC). Omitted when never saved.
"2026-10-05T10:45:00Z"