Observed since 20 Oct, 21:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Production monitoring for AI agents. Heartbeat monitoring, cost tracking, failure detection.
Production monitoring for AI agents. Know when your agents fail, overspend, or go silent.
Website: agentbeat.dev
pip install agentbeat
from agentbeat import AgentBeat
# Initialize with your agent's slug and token from agentbeat.dev/dashboard
ab = AgentBeat("https://api.agentbeat.dev", "my-agent", "your-agent-token")
# Option 1: Context manager (recommended)
# Automatically marks the run as completed or failed
with ab.run() as ctx:
result = my_agent_function()
ctx.items_processed = len(result)
ctx.add_cost(0.12)
ctx.model = "gpt-4o"
ctx.confidence = 0.95
# Option 2: Simple heartbeat (for cron jobs, scripts)
ab.heartbeat()
# Option 3: Manual start/complete
run_id = ab.start()
# ... your code ...
ab.complete(run_id=run_id, items_processed=42, cost_usd=0.05)
with ab.run() as ctx:
with ctx.timed_step("fetch_data"):
data = fetch_from_api()
with ctx.timed_step("process", model="gpt-4o"):
result = llm_process(data)
ctx.add_cost(0.08)
ctx.add_tokens(input_tokens=1200, output_tokens=350)
with ctx.timed_step("save_results"):
save_to_db(result)
ctx.items_processed = len(result)
from agentbeat import AgentBeat
from openai import OpenAI
ab = AgentBeat("https://api.agentbeat.dev", "my-openai-agent", "token")
client = OpenAI()
with ab.run() as ctx:
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}]
)
ctx.model = "gpt-4o"
ctx.add_tokens(
input_tokens=response.usage.prompt_tokens,
output_tokens=response.usage.completion_tokens
)
ctx.add_cost(response.usage.prompt_tokens * 0.0025 / 1000
+ response.usage.completion_tokens * 0.01 / 1000)
from agentbeat import AgentBeat
from langchain_openai import ChatOpenAI
from langchain.agents import create_react_agent, AgentExecutor
ab = AgentBeat("https://api.agentbeat.dev", "my-langchain-agent", "token")
with ab.run() as ctx:
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)
result = executor.invoke({"input": "research AI trends"})
ctx.items_processed = 1
ctx.model = "gpt-4o"
from agentbeat import AgentBeat
from crewai import Crew
ab = AgentBeat("https://api.agentbeat.dev", "my-crew", "token")
with ab.run() as ctx:
crew = Crew(agents=[...], tasks=[...])
result = crew.kickoff()
ctx.items_processed = len(result.tasks_output)
ctx.model = "gpt-4o"
# Add this one line at the end of your script
curl -s https://api.agentbeat.dev/a/my-cron-job/heartbeat \
-H "X-Agent-Token: your-token" > /dev/null
Or in Python:
from agentbeat import AgentBeat
ab = AgentBeat("https://api.agentbeat.dev", "daily-etl", "token")
# At the end of your script
ab.heartbeat()
# The context manager automatically reports failures
with ab.run() as ctx:
raise ValueError("something broke")
# AgentBeat records: status=failed, error_message="something broke"
# Manual failure reporting
run_id = ab.start()
try:
do_work()
ab.complete(run_id=run_id, items_processed=100)
except Exception as e:
ab.fail(run_id=run_id, error_message=str(e))
raise
from agentbeat import AgentBeat, track_run
ab = AgentBeat("https://api.agentbeat.dev", "my-agent", "token")
@track_run(ab)
def my_agent_task(ctx):
ctx.items_processed = 50
ctx.add_cost(0.12)
ctx.model = "gpt-4o"
my_agent_task() # Automatically tracked
Create a client for a specific agent.
Start a new run. Returns run_id.
Complete a run with metrics. If run_id is None, completes the latest run.
Mark a run as failed.
Send a simple heartbeat ping. Use for cron jobs and scripts.
Report a step within a run.
Context manager that auto-calls start/complete/fail. Yields a RunContext with:
ctx.items_processed - number of items processedctx.items_failed - number of items that failedctx.cost_usd - total cost in USDctx.model - model name (e.g. "gpt-4o")ctx.confidence - confidence score 0.0-1.0ctx.add_cost(usd) - accumulate costctx.add_tokens(input_tokens, output_tokens) - accumulate token usagectx.timed_step(name) - context manager for timed stepsNo SDK required. Use any language with HTTP:
# Start a run
curl -X POST https://api.agentbeat.dev/a/{slug}/start \
-H "X-Agent-Token: {token}"
# Complete a run
curl -X POST https://api.agentbeat.dev/a/{slug}/complete \
-H "X-Agent-Token: {token}" \
-H "Content-Type: application/json" \
-d '{"items_processed": 42, "cost_usd": 0.12, "model": "gpt-4o"}'
# Report failure
curl -X POST https://api.agentbeat.dev/a/{slug}/fail \
-H "X-Agent-Token: {token}" \
-H "Content-Type: application/json" \
-d '{"error_message": "API timeout"}'
# Simple heartbeat
curl https://api.agentbeat.dev/a/{slug}/heartbeat \
-H "X-Agent-Token: {token}"
pip install agentbeatDownload counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.1 | 25 Mar 2026 | 1 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 21:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:02e96dca54e4c597d674442f21b40fbffbc69107542abd7153c489b4289437d9