A LangChain run can fan out across chains, tools and models. AgentPing rolls that up into one run record so you can see cost, status and quality at the level that matters: the agent, not the call.
LangChain makes it easy to compose chains and tools, which makes it easy to lose track of what a single run cost and whether it behaved. The provider bill is a single total; your logs show steps, not run-level cost or quality.
Initialise once, then pass the callback handler. Every tool and model call in the chain or agent is captured, and cost is priced server side from the model and token counts.
pip install agentping
import agentping
from agentping import AgentPingCallbackHandler
agentping.init(api_key="apk_…", agent="qa-chain")
# Works with LCEL chains, agents and LangGraph.
result = chain.invoke(
{"question": "…"},
config={"callbacks": [AgentPingCallbackHandler()], "metadata": {"customer_id": "acme-corp"}},
)
Full setup, environment variables and options are in the Python SDK docs.
Send one run from LangChain and see cost, status and latency. Then add an alert for cost spikes or missed runs.
Spend, cost attribution → Verify, quality scoring → Pulse, live monitoring →