Guide
A LangChain agent or chain runs tools and calls the model in a loop. AgentPing rides the callback system, so one record lands per run with the cost, status and output behind it, no chain rewrites.
Install the SDK and point it at your LangChain agent. One record lands per run with the cost, status, latency and output behind it.
pip install agentping
import agentping
from agentping import AgentPingCallbackHandler
agentping.init(api_key="apk_…", agent="qa-chain")
# Pass the handler in callbacks; every tool and model call is captured.
result = chain.invoke(
{"question": "…"},
config={"callbacks": [AgentPingCallbackHandler()]},
)
The handler captures token usage and cost from the model calls and ties them to one run per invocation. Full reference is in the docs.
See the pillars behind these: Spend, Pulse and Verify. For why teams monitor LangChain with AgentPing, see the LangChain integration.
Add the SDK, send one run, and watch cost, status and quality land in the dashboard.