Quick Start
Add AgentFlare to your Python agent in under 5 minutes.
1. Install the SDK
2. Get an API key
Sign in to your AgentFlare dashboard, go to API Keys, and create one (ag_...).
3. Add to your agent
Option A — LangChain / LangGraph (drop-in callback)
This is the easiest integration. Add one line to any existing LangChain chain or graph:
That's it. AgentFlare now tracks every LLM call in the chain and stops the agent if your daily budget is exceeded.
Option B — Custom / raw agent
If you're calling the LLM directly (not via LangChain), use send_event manually:
Option C — Function decorator
Wrap your entire agent function to automatically emit agent_start and agent_end events:
4. Watch it in the dashboard
Open your AgentFlare dashboard. You'll see:
- Live event feed — every LLM call as it happens
- Cost meter — cumulative USD spend in the last 24h
- Hourly chart — where your budget is going
- Pause / resume button — manual override at any time
What happens when the budget is hit?
- AgentFlare backend sets
is_paused = truefor your agent in Supabase. - The next
send_eventcall from your SDK returnsFalse. - Your agent checks the return value and stops.
- Slack alert fires (if you configured a webhook).
- The dashboard shows the agent as paused in red.
You can resume the agent from the dashboard or via POST /config/pause.