Skip to main content

AnoSys SDK for OpenAI Agents

Automatically capture and send OpenAI Agents SDK traces to AnoSys for monitoring, analytics, and observability.

Features

  • Automatic Agent Tracing - Captures all agent runs, tool calls, and handoffs
  • TracingProcessor Integration - Native integration with OpenAI Agents SDK
  • Structured Span Data - Captures agent, function, guardrail, and generation spans
  • User Context Support - Associate traces with user sessions

Installation

Requires Python 3.10 or later.

pip install anosys-sdk-openai-agents

Quick Start

import os
from agents import Agent, Runner, add_trace_processor
from anosys_sdk_openai_agents import AnosysOpenAIAgentsLogger

os.environ["OPENAI_API_KEY"] = "your-openai-key"
os.environ["ANOSYS_API_KEY"] = "your-anosys-key"

# Set up the tracing processor
add_trace_processor(AnosysOpenAIAgentsLogger())

# Create and run an agent
agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant."
)

result = Runner.run_sync(agent, "Hello!")
print(result.final_output)

User Context

Associate traces with user sessions:

def get_user_context():
    return {
        "session_id": "user-123",
        "token": "auth-token"
    }

processor = AnosysOpenAIAgentsLogger(get_user_context=get_user_context)
add_trace_processor(processor)

Span Types Captured

  • agent - Agent execution spans
  • function - Tool/function calls
  • generation - LLM generation calls
  • guardrail - Guardrail checks
  • handoff - Agent handoffs
  • response - Response spans
  • custom - Custom spans

Environment Variables

Variable Required Description
ANOSYS_API_KEY Yes Your AnoSys API key
OPENAI_API_KEY Yes Your OpenAI API key

License

Apache 2.0

Content controls

See the content-controls reference for encryption coverage, default columns, size limits, and limitations. Encryption is opt-in and applies to selected string fields; it does not encrypt the complete record.

Collection follows one level for every AnoSys SDK: ANOSYS_COLLECTION_LEVEL=full (default), metadata (no prompts, completions or tool data) or off, a project .anosys file can only lower it, and ANOSYS_DISABLE=1 stops all sending. Without an API key nothing is sent. Telemetry is sent in the background and never delays your calls. See the data-collection policy.

Metadata

Release files for anosys-sdk-openai-agents 1.1.0

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

Source distribution (sdist)

Source distribution for anosys-sdk-openai-agents 1.1.0
File Size Uploaded Provenance Actions
anosys_sdk_openai_agents-1.1.0.tar.gz 26.9 kB Without provenance Details for anosys_sdk_openai_agents-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anosys-sdk-openai-agents 1.1.0
File Interpreter ABI Platform Actions
anosys_sdk_openai_agents-1.1.0-py3-none-any.whl Python 3 none any Details for anosys_sdk_openai_agents-1.1.0-py3-none-any.whl

Total release size: 50.1 kB

Release files / anosys_sdk_openai_agents-1.1.0.tar.gz

Download URL anosys_sdk_openai_agents-1.1.0.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
62d2619c27bcd4966ee6f537107a7d6ae142279cadb57d191cccf49ad89afd17
BLAKE2b-256 checksum
How to use checksums
2bd3ad594ab9956308c536e70f220849049babfa63ce211eafce04d2da3f96e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / anosys_sdk_openai_agents-1.1.0-py3-none-any.whl

Download URL anosys_sdk_openai_agents-1.1.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b419a977d8ef248f02afe488b2f98ae765b454c5a747e5c1d07834bae97910c
BLAKE2b-256 checksum
How to use checksums
734c16691fd009924b1a53d028e9d5ae3e35f0891c2f4ab1f5b1f43b3c676a2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for anosys-sdk-openai-agents 1.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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