How to Use AgentsFlare Webhooks: Stay on Top of Your Account in Real Time
Author
Agentsflare Admin
Date Published
If you read nothing else this week:
- AgentsFlare Webhooks use a proactive notification mechanism. When an alert is triggered or an API request is completed, the platform automatically sends relevant information to a designated system, removing the need to continuously check the dashboard.
- Two main callback types are supported: alert-triggered callbacks and successful API request callbacks. The former is suitable for spending, usage, and metric alerts, while the latter records information such as the model, project, token usage, cost, and request duration.
- Webhooks are useful for cost monitoring and anomaly alerts. For example, teams can respond immediately when project spending rises unexpectedly, an API key generates abnormal requests, or request volume suddenly increases.
- They can be integrated with WeCom, DingTalk, Slack, and internal systems, allowing different teams to receive alerts for their respective projects while reducing manual monitoring and cross-team communication costs.
- They support detailed cost allocation by sending model, usage, and cost data from each API request to financial systems, BI dashboards, or data warehouses for reporting by project, department, or customer.
- Configuration is straightforward: open the Webhooks page in the AgentsFlare dashboard, enter an HTTPS callback URL, and select either the alert-triggered or API request completion callback type. Alert messages can also be customised.
- Webhooks are best suited to teams managing multiple projects, high request volumes, or strict cost controls. For smaller teams with stable usage and budgets, monitoring data directly through the dashboard may be sufficient.
What are Webhooks?
Think of Webhooks as a "proactive notification" system. In the traditional model, an application keeps polling the server to check whether an event has happened. That's like calling a restaurant over and over to ask, "Is my order ready?" With a Webhook, the application simply provides a receiving address in advance. When the event happens, the server pushes the result over, just like a restaurant calling you the moment your food is ready. This event-driven approach removes the need for constant polling and makes systems faster and more efficient.
When you use AI model services, knowing your account status and request activity in time matters. AgentsFlare's Webhooks feature pushes information to an address you specify whenever certain events happen, so you don't have to check the dashboard manually.
(Webhooks main page)
What Webhooks can do
AgentsFlare Webhooks support two main scenarios:
The first is alert-triggered callbacks. When a monitoring alert you set up fires (say, spend crosses a threshold, or a metric hits its warning line), the system pushes a notification to your specified address using the message template you configured in advance. The benefit here is flexible message content. The system automatically fills the template with the trigger source, metric name, current value, alert threshold, and trigger time, making it easy to plug into collaboration tools like WeCom, DingTalk, or Slack.
The second is API request completion callbacks. After each API call finishes, the system can push a notification with the request details, including the model called, the project it belongs to, token usage, cost, and request duration. These callbacks use a fixed, standard data format. You can't customize the message template, but the structure is clean and well suited for feeding into your own analytics or finance systems to track usage and cost automatically.
Note that for both callback types, the target address must use HTTPS to keep data transmission secure.
When you need Webhooks
Webhooks aren't something every customer has to configure. But in the following scenarios, they deliver a clear efficiency boost:
Real-time alerts on spend and usage
If your business is cost-sensitive, you may worry that a project or API key racks up runaway charges from abnormal calls, like a code bug causing an infinite request loop, or a sudden traffic spike. With alert-triggered callbacks, you get notified the moment a metric crosses its threshold and can step in right away, instead of discovering the problem when the monthly bill arrives.
Ops coordination across teams and projects
If multiple teams share one AgentsFlare account and each manages its own projects, alert callbacks can go straight to each team's group chat (WeCom, DingTalk, Slack, and so on). The right people find out immediately, and no one has to sit watching the dashboard.
Fine-grained cost accounting and internal chargeback
If you need to split AI costs by project, department, or customer, API request completion callbacks sync the model, usage, and cost of every call to your own finance or data systems in real time. No more exporting bills on a schedule and reconciling them by hand, and the data stays fresh and accurate.
Further processing and analysis of usage data
If you want to feed call data into your own BI dashboard or data warehouse for usage trend analysis or model distribution analysis, API request completion callbacks work as a data source that continuously and automatically syncs every call record.
Unattended, automated operations
For teams that want less manual monitoring, alert callbacks can pair with automation scripts. For example, automatically pausing an API key when spend crosses a threshold, or auto-creating a ticket for the owner. This gives you a basic automated response system.
If your use case is simple, your call volume is modest, and your budget is stable, you can use the platform perfectly well without Webhooks. Checking the dashboard is enough.
How to set it up
Setting up a Webhook is straightforward. On the Webhooks management page in the AgentsFlare dashboard, you can see all the Webhooks you've created. Click the create button, fill in the target callback URL, and pick one of the two types: alert-triggered or API request completion. That's it. If you choose the alert-triggered type, you can also edit the message content and insert variables like the trigger source, metric value, and threshold as needed.
(Create Webhook page)
Delivery logs: every push is on record
Networks are unpredictable, and a push doesn't always succeed on the first try. AgentsFlare provides full delivery logs so you can check the details of every Webhook push at any time: push time, target address, the HTTP status code returned, a summary of the response, retry count, and final delivery status. If a push fails, the system retries automatically and records the outcome. You can trace exactly what happened instead of wondering whether a message vanished into thin air.
Who it's for
Webhooks are a great fit if your team needs to:
Get notified the moment spend or usage looks abnormal, instead of finding out from the bill;
Automatically sync the cost and usage of every API call to internal systems for fine-grained cost control;
Feed alerts into your existing collaboration tools or ops workflows and cut down on manual monitoring.
If that sounds like you, Webhooks will help you weave AgentsFlare's runtime status seamlessly into the business systems you already have.