Setup
Install with the Agents extra (pip install "tokeven[openai-agents]"), set TOKEVEN_INGEST_TOKEN to your ingest token, then add the processor:
from agents import add_trace_processor
from tokeven.integrations.openai_agents import TokevenTracingProcessor
add_trace_processor(TokevenTracingProcessor())The SDK's own tracing keeps working; Tokeven is added beside it.
What it captures
One event per model generation, for both Chat Completions and Responses API models. Only the model name and usage counters are read, never span inputs or outputs.
Budget guard
The Agents SDK catches processor errors, so the processor records spend but cannot stop a run. To enforce a budget, pass the ready-made hooks to your run: Runner.run(agent, input, hooks=guard_run_hooks()) (importable from tokeven.integrations.openai_agents).