Skip to content

Python SDK

The AxonPush Python SDK lets you publish, subscribe, and trace events from your AI agent applications.

Installation

bash
pip install axonpush

With framework integrations:

bash
pip install "axonpush[langchain]"      # LangChain / LangGraph
pip install "axonpush[openai-agents]"  # OpenAI Agents SDK
pip install "axonpush[anthropic]"      # Anthropic / Claude
pip install "axonpush[crewai]"         # CrewAI
pip install "axonpush[websocket]"      # WebSocket support

Quick Start

python
from axonpush import AxonPush, EventType

with AxonPush(
    api_key="ak_...",
    tenant_id="1",
    base_url="https://api.axonpush.xyz",
) as client:
    event = client.events.publish(
        identifier="task.started",
        payload={"task": "summarize article"},
        channel_id=1,
        agent_id="research-agent",
        event_type=EventType.AGENT_START,
    )
    print(f"Published event {event.id}")

Resources

ResourceDescription
client.eventsPublish and list events
client.channelsManage channels, subscribe via SSE
client.appsCreate and manage apps
client.tracesList traces and get summaries
client.webhooksManage webhook endpoints

Environment Variables

The SDK reads credentials from environment variables when using the wizard:

VariableDescription
AXONPUSH_API_KEYYour API key (starts with ak_)
AXONPUSH_TENANT_IDOrganization/tenant ID
AXONPUSH_BASE_URLAPI base URL (default: https://api.axonpush.xyz)

Source Code

github.com/axonpush · PyPI