Set or clear the organisation's daily AI caps (a key not sent is kept)
import requests
url = "https://platform.ankra.app/api/v1/org/billing/ai-spend-cap"
payload = {
"daily_chat_usd_cap": 123,
"daily_token_soft_cap": 123,
"daily_token_hard_cap": 123
}
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({daily_chat_usd_cap: 123, daily_token_soft_cap: 123, daily_token_hard_cap: 123})
};
fetch('https://platform.ankra.app/api/v1/org/billing/ai-spend-cap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/billing/ai-spend-cap \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"daily_chat_usd_cap": 123,
"daily_token_soft_cap": 123,
"daily_token_hard_cap": 123
}
'{
"daily_chat_usd_cap": 123,
"plan_default_usd": 123,
"effective_usd": 123,
"spent_today_usd": 123,
"daily_token_soft_cap": 123,
"daily_token_hard_cap": 123,
"tokens_today": 123,
"token_budget_state": "unlimited",
"monthly_free_usd": 123,
"monthly_plan_default_usd": 123,
"monthly_override_usd": 123,
"monthly_platform_spent_usd": 123,
"monthly_resets_at": "<string>",
"monthly_exhausted": true,
"allowance_exempt": true,
"byok_configured": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}billing
Set or clear the organisation's daily AI caps (a key not sent is kept)
PUT
/
api
/
v1
/
org
/
billing
/
ai-spend-cap
Set or clear the organisation's daily AI caps (a key not sent is kept)
import requests
url = "https://platform.ankra.app/api/v1/org/billing/ai-spend-cap"
payload = {
"daily_chat_usd_cap": 123,
"daily_token_soft_cap": 123,
"daily_token_hard_cap": 123
}
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({daily_chat_usd_cap: 123, daily_token_soft_cap: 123, daily_token_hard_cap: 123})
};
fetch('https://platform.ankra.app/api/v1/org/billing/ai-spend-cap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/billing/ai-spend-cap \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"daily_chat_usd_cap": 123,
"daily_token_soft_cap": 123,
"daily_token_hard_cap": 123
}
'{
"daily_chat_usd_cap": 123,
"plan_default_usd": 123,
"effective_usd": 123,
"spent_today_usd": 123,
"daily_token_soft_cap": 123,
"daily_token_hard_cap": 123,
"tokens_today": 123,
"token_budget_state": "unlimited",
"monthly_free_usd": 123,
"monthly_plan_default_usd": 123,
"monthly_override_usd": 123,
"monthly_platform_spent_usd": 123,
"monthly_resets_at": "<string>",
"monthly_exhausted": true,
"allowance_exempt": true,
"byok_configured": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Null clears the money cap back to the plan default.
Past it every unattended run degrades to the quick tier for the rest of the UTC day; null clears.
Past it new unattended runs are refused until midnight UTC; null clears. Never below the soft cap.
Response
Successful Response
Null when today's usage could not be read.
Available options:
unlimited, under, soft, hard, unknown