Catalog PyPI
Back to packageRELEASE DETAILS

0.1.0

PyPI

agentaxon

Lightweight SDK for tracking AI agent costs and reliability with AgentAxon

aianthropiccost-trackinggeminillmmonitoringopenai
Published23 Jun 2026
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 0.1.0 documentation

AgentAxon Python SDK

Lightweight SDK for tracking AI agent costs, latency, and reliability with AgentAxon.

Installation

pip install agentaxon

Quick Start

from agentaxon import AgentAxon
import openai
import os

# 1. Initialize (do this once in your app)
ap = AgentAxon(
    api_key=os.environ.get("AGENTAXON_API_KEY"),
    endpoint="https://your-agentaxon-domain.com/api/events" # Your deployed dashboard URL
)

# 2. Wrap any AI call with the @ap.track decorator
@ap.track(provider="openai", agent_name="customer-support-bot")
def ask_bot(question):
    return openai.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": question}]
    )

# 3. Call your function as normal
response = ask_bot("How do I upgrade my plan?")

How it Works

The @ap.track decorator automatically intercepts the response from the LLM provider, extracts the input_tokens and output_tokens, measures the latency, and pushes the event to your AgentAxon dashboard in a background thread so it never slows down your application.

If an exception occurs during the API call, AgentAxon catches it, logs the error against the agent_name, and re-raises the exception.

Supported Providers

  • openai (Extracts tokens from standard OpenAI completions)
  • anthropic (Extracts tokens from standard Anthropic messages)
  • google (Extracts tokens from Gemini GenerationResponse)

Advanced Usage (Manual Tracking)

If you aren't using one of the supported providers or you want to track costs manually, you can use ap.log_event():

ap.log_event(
    provider="custom-llm",
    model="llama-3",
    agent_name="local-agent",
    input_tokens=150,
    output_tokens=45,
    latency_ms=1200,
    status="success"
)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

1 collected
agentaxon-0.1.0-py3-none-any.whl

bdist_wheel · 5.03 KB · Python py3

Source file

Repository

PENDING
agentaxon/agentaxon-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:31 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:13dd60583a3558306c753b23fbc652fdd79915264de3b4c6d997abfa25cbcfce

Other collected versions

View all collected versions →