Send a request through AI Gateway so the budget has spend to track:
curl -X POST "$KONNECT_PROXY_URL/v1/chat/completions" \
--no-progress-meter --fail-with-body \
-H "Accept: application/json"\
-H "Content-Type: application/json" \
--json '{
"model": "budget-gpt-4o",
"messages": [
{
"role": "user",
"content": "Say this is a test!"
}
]
}'
Next, send a test message to the Slack channel to confirm that alerts arrive:
curl -X POST "https://us.api.konghq.com/v1/ai-cost-management/notification-channels/$CHANNEL_ID/tests" \
--no-progress-meter --fail-with-body \
-H "Authorization: Bearer $KONNECT_TOKEN"
Check the Slack channel that your webhook posts to.
You should see a message titled Test message from channel "budget-alerts-slack".
Check the balance of the budget:
curl -X GET "https://us.api.konghq.com/v1/ai-cost-management/budgets/$BUDGET_ID/balance" \
--no-progress-meter --fail-with-body \
-H "Authorization: Bearer $KONNECT_TOKEN"
The response shows the limit (500 US dollars), the spend so far in consumed, the amount left in remaining, and the spend expected by the end of the budget window in projected.
Usage takes a short time to reach the service, so consumed can show no spend right after the request.
The latest_record_at field shows when the newest counted usage arrived, and it’s null until usage matches the budget.
The projected field rounds to the cent, so it can show 0 when spend is a fraction of a cent.