AutoGen
Instrument AutoGen conversable agents with a one-line patch.
AutoGen instruments through a single patch call. It wraps ConversableAgent, so each agent’s LLM turn in a conversation becomes a TokenJam span without changes to your agent setup.
Setup
from tokenjam.sdk.integrations.autogen import patch_autogen
patch_autogen()
Call it once at startup, before you build your agents or start a conversation.
What gets captured
Every turn a ConversableAgent takes emits a span with token usage, timing, and the model behind it. In a multi-agent conversation you get one trace covering the exchange, with each agent’s turns as spans you can attribute cost to individually.
The patch is framework-agnostic and composes with the provider patches. When an AutoGen agent reaches an API client tj already patches, inner spans are de-duplicated so nothing is double-counted. See the Frameworks overview for the full picture.