Skip to main content

pytracer-openai-agents

pyTracer adapter for the OpenAI Agents SDK. It auto-instruments an agent through the SDK's built-in tracing, so you do not add @op by hand: agent runs, model generations, tool (function) calls, and handoffs are captured as pyTracer spans.

import pytracer_sdk as pytracer
from pytracer_openai_agents import install

pytracer.configure(
    pytracer.HTTPTransport("https://gateway.internal", api_key="YOUR_KEY"),
    service_name="my-agent", branch="main", commit="abc123",
)

install()   # now every agent run is captured, and only pyTracer receives traces

install() uses the SDK's set_trace_processors to make pyTracer the only trace processor. Do not use add_trace_processor: it appends, leaving the SDK's default processor in place, which uploads every trace to OpenAI when OPENAI_API_KEY is set. If you deliberately want both destinations, add the processor yourself with add_trace_processor(PyTracerTracingProcessor()).

Agent spans map to agent spans, generations and responses to LLM spans, function calls to tool spans, and handoffs to handoff spans, all linked into one trace by the SDK's own span tree.

Alongside other frameworks

CrewAI requires openai<3, so with CrewAI in the same environment pip and uv install OpenAI Agents 0.20.0, the last release that accepts openai 2.x; this adapter supports it (0.20.0 is also its minimum). Asking for a newer OpenAI Agents SDK beside pyTracer's CrewAI adapter is reported as a conflict, not settled by installing an old CrewAI. For a newer OpenAI Agents SDK, run it in an environment without CrewAI. See using several frameworks in one environment.

One trace per request

Each run starts its own trace. To keep a request that makes several runs, or also uses another framework, in one trace, wrap it in a pyTracer span; the run nests under the span that is open when it starts:

with pytracer.start_span("answer-question"):
    await Runner.run(agent, question)
    ...  # further runs, other adapters, or @op calls join the same trace

Replay

Install with replayable=True and a captured run replays without adding @op to anything:

install(replayable=True)   # also routes model calls and function tools through pyTracer

The SDK's model calls (get_response / stream_response on every Model, including custom ones) and function tools (FunctionTool.on_invoke_tool, including tools created before install) then run through pyTracer, so the replay engine can return their recorded results: in full mode neither the model nor the tools run again, in partial mode the tools stay frozen while the model runs live. Hosted tools (web search, file search) run inside the model call, so the recorded model response covers them. Each model call is matched on what was asked (instructions, conversation so far, tools, settings), not on per-run ids. uninstall_seams() removes the routing again.

Without replayable=True the adapter only captures, and replaying an adapter-only trace is flagged (the run has recordings but hits no @op seam) rather than silently running live. See the main README for the replay workflow.

Metadata

Release files for pytracer-openai-agents 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytracer-openai-agents 0.1.4
File Size Uploaded Provenance Actions
pytracer_openai_agents-0.1.4.tar.gz 12.5 kB With provenance Details for pytracer_openai_agents-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytracer-openai-agents 0.1.4
File Interpreter ABI Platform Actions
pytracer_openai_agents-0.1.4-py3-none-any.whl Python 3 none any Details for pytracer_openai_agents-0.1.4-py3-none-any.whl

Total release size: 21.9 kB

Release files / pytracer_openai_agents-0.1.4.tar.gz

Download URL pytracer_openai_agents-0.1.4.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
086e322a4e93c81ec6e521068ca5816df3def7fc0c9e80f7990e7d535ad90cbb
BLAKE2b-256 checksum
How to use checksums
31c34c3983893ab5ce02c83f6f1c1de801c2a6b3aa6a38c31ce870048c400372
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / pytracer_openai_agents-0.1.4-py3-none-any.whl

Download URL pytracer_openai_agents-0.1.4-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f56f0974ac8ce1b720b233ac70eccabe56c3c17f04f49ee3102dc7427e3b62d6
BLAKE2b-256 checksum
How to use checksums
977be73107c6422df1e1c75df58000c5098646eb0b720106d7cabb2c21861e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for pytracer-openai-agents 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytracer_openai_agents-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page