Skip to main content
Usage alerts tell your application when a customer’s metered feature crosses a threshold. Use them with any meter feature, such as API calls, credits, tokens, or storage.
A usage alert has two parts. You configure the threshold on the plan, then receive the feature.usage_alert event through a webhook. Turning on the alert does not email the customer or show an in-app message by itself. Your webhook handler decides what happens next.

How usage alerts work

  1. Your application reports usage to Kelviq with SET or DELTA behavior.
  2. Kelviq updates the customer’s meter for the current usage period.
  3. When current usage crosses a configured threshold, Kelviq creates a feature.usage_alert event.
  4. Kelviq sends the event to webhook endpoints subscribed to that event type.
  5. Your application can send an email, show an in-app warning, notify a support team, or offer an upgrade.
Usage alerts do not stop usage, change a price, or charge the customer. Use a hard limit to stop usage at zero balance, and configure usage pricing when customers should pay for additional consumption.

Choose a threshold type

Kelviq supports percentage and absolute-unit thresholds. Suppose a plan includes 10,000 API calls each month:
  • A 75% percentage threshold is crossed when current usage reaches 7,500 calls.
  • A balance threshold of 7,500 is crossed at the same usage count, but it is stored as an absolute number of calls rather than a percentage.
Percentage thresholds are easier to reuse across plans with different limits. Balance thresholds are useful when the absolute number matters, such as 10,000 API calls or 1,000 AI credits. You can add more than one threshold. For example, use 75% for an early warning and 90% for a stronger upgrade or top-up prompt.

Configure usage alerts in the dashboard

  1. Open Product Catalog → Products and select the product.
  2. Open the plan that contains the metered feature.
  3. Edit Usage pricing or open Manage features & limits.
  4. Select the meter feature and enter its usage value or pricing configuration.
  5. Turn on Usage alert.
  6. Choose Percentage or Balance as the threshold type.
  7. Click Add threshold and enter each threshold.
  8. Save the configuration. If Kelviq creates a draft version of a published plan, publish the draft before testing it.
If the Usage alert switch is disabled while managing an entitlement, make sure you selected a meter feature and entered a value. Percentage alerts also need a finite usage limit so Kelviq can calculate the percentage used.
Regional prices inherit usage alerts from the base price. Change the base price when the same alert configuration should apply to every regional price.

Configure usage alerts through the API

To update one plan entitlement, send a PATCH request to:
feature_identifier is the feature’s identifier, such as api-calls, not its UUID.
The usageAlerts object contains: Updating a published plan creates a new draft version. Publish that draft before expecting the new thresholds to apply. See Update plan entitlement for the complete request schema.

Create the webhook endpoint

The threshold configuration tells Kelviq when to create an alert. The webhook endpoint is how your application receives it.
  1. Open Settings → Webhooks in the Kelviq dashboard.
  2. Create an endpoint with a public HTTPS URL.
  3. Subscribe the endpoint to feature.usage_alert.
  4. Save the signing secret. Kelviq shows it once.
  5. Verify every delivery before reading its data.
The webhook endpoint and usage reports must use the same environment. A production webhook does not receive alerts created from sandbox usage, and a sandbox webhook does not receive production alerts. See the Webhooks guide for signature verification, retries, delivery logs, and manual resends.

Usage alert payload

The event identifies the customer, feature, usage limit, current usage, threshold, subscription, and usage period.
The fields most alert handlers use are:

Handle feature.usage_alert

This Express example verifies the request and sends the alert to an application queue. The queue can handle email or in-app notifications outside the webhook request.
Kelviq may deliver the same event more than once because of automatic retries or a manual resend. Store the top-level event id or webhook-id header before enqueueing work, and skip the event if you already processed it. Return a 2xx response quickly. Do not wait for an email provider or another slow service inside the webhook request.

Test an alert in sandbox

  1. Create a sandbox webhook endpoint subscribed to feature.usage_alert.
  2. Configure a low threshold on a sandbox plan, such as 1 unit or 1%.
  3. Report enough usage to cross the threshold.
  4. Open Settings → Webhooks, select the endpoint, and inspect the delivery log.
  5. Confirm the event’s customer, feature, threshold, and usage period.
For example, report a usage increment with the Node SDK:
If delivery fails, fix the endpoint and use Resend from the delivery log. Keep the handler idempotent because a resend can deliver the same event again.

Troubleshooting