Set it up
Recommended path: The Toolcaise Python SDK, with an instrumented OpenAI client. You need an agent credential from Dashboard, Agents: one credential per agent.
1. Install the Toolcaise SDK
pip install openai-agents
curl -fsSLO https://toolcaise.com/downloads/toolcaise_agent.py # then: from toolcaise_agent import Toolcaise2. Instrument the client the Agents SDK uses, and wrap each run
Instrument the client before it is first used. Runner.run calls responses.create; Runner.run_streamed reads through responses.with_streaming_response.create, which the SDK records when the stream is parsed.
import asyncio
from openai import AsyncOpenAI
from agents import Agent, Runner, function_tool, set_default_openai_client
from toolcaise_agent import Toolcaise
toolcaise = Toolcaise()
set_default_openai_client(toolcaise.instrument_openai(AsyncOpenAI()))
@function_tool
async def publish_summary(text: str) -> str:
"""Publish the summary to the team channel."""
return await toolcaise.aguarded_action(
"Publish the daily summary",
{"channel": "team", "text": text},
lambda approved: post_to_channel(approved["channel"], approved["text"]),
)
agent = Agent(name="Summariser", instructions="Summarise and publish.", tools=[publish_summary])
async def main():
async with toolcaise.run("daily-summary"):
await toolcaise.acheckpoint() # waits here while a person has paused it
result = await Runner.run(agent, "Summarise today's support tickets")
toolcaise.outcome("daily summary", status="succeeded")
asyncio.run(main())Then run the agent as usual. Its runs appear in the dashboard as soon as their first report arrives.
What Toolcaise receives
| How it arrives | |
|---|---|
| Runs | One run per client.run() block, completed, failed or canceled. |
| Model calls | One model span per Responses or Chat Completions call, with the model, input and output tokens, latency and success, plus a call-scope usage sample. No prompts or output. |
| Tools and steps | Tools you wrap in client.span() or guard with guarded_action; the Agents SDK's own tool spans are not sent. |
| Decisions | Pause, resume and cancel at acheckpoint(); approvals for guarded actions. |
What this path does not give you:
- Handoffs and the Agents SDK's own trace structure, unless you add spans for them or use the OpenTelemetry path below.
Everything here is reported by your agent or its framework and stored as agent-reported. Prompts, completions and tool arguments are never read: the OpenTelemetry endpoint reads only an allow-list of attributes, and the SDK sends metadata only.
Other ways
Without code changes to your tools: OpenInference
openinference-instrumentation-openai-agents turns the Agents SDK's own traces into OpenTelemetry spans (agents, model calls, tools, handoffs). By default it replaces the SDK's upload to OpenAI; pass exclusive_processor=False to keep both. It reads model names and token counts for Responses calls from the full response, which the Agents SDK attaches only while trace_include_sensitive_data is on (the default): turn that off and those spans lose their model and tokens. Toolcaise never reads the content attributes, but they do leave the process; OPENINFERENCE_HIDE_INPUTS and OPENINFERENCE_HIDE_OUTPUTS hide them at export (not verified to keep token counts).
# pip install openinference-instrumentation-openai-agents opentelemetry-sdk opentelemetry-exporter-otlp-proto-http
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
# Endpoint, credential and compression come from the OTEL_ environment variables above.
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
trace.set_tracer_provider(provider)
from openinference.instrumentation.openai_agents import OpenAIAgentsInstrumentor
OpenAIAgentsInstrumentor().instrument(tracer_provider=provider)Caveats
- The Agents SDK still uploads its own traces to OpenAI unless you turn that off; that is separate from Toolcaise. Do not use set_tracing_disabled() with the OpenInference path: it stops the traces that path relies on.
- Streamed runs are recorded through the raw-response path of the openai package. That path was tested with stand-ins for the openai classes, not with the Agents SDK itself.
- Token counts are what OpenAI reported to your process, stored as agent-reported.
What was checked
Checked on 2026-09-22 against the openai-agents 0.22.3 source (set_default_openai_client, and how its Responses and Chat Completions models call the client) and openinference-instrumentation-openai-agents 2.4.1. The Toolcaise SDK's instrumentation is covered by its test suites; the Agents SDK was not run end to end.
Reference: SDKs, HTTP API, and the OpenTelemetry endpoint's limits and answers.