Python SDK
The axonpush Python SDK lets you publish, subscribe, and trace events from your AI agent applications.
Installation
Section titled “Installation”pip install axonpushpaho-mqtt and aiomqtt ship as runtime dependencies, so client.connect_realtime() works out of the box — see Realtime.
With framework integrations:
pip install "axonpush[langchain]" # LangChain / LangGraphpip install "axonpush[openai-agents]" # OpenAI Agents SDKpip install "axonpush[anthropic]" # Anthropic / Claudepip install "axonpush[crewai]" # CrewAIpip install "axonpush[deepagents]" # LangChain Deep AgentsQuick Start
Section titled “Quick Start”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
Section titled “Resources”| Resource | Description |
|---|---|
client.events | Publish and list events |
client.channels | Manage channels |
client.connect_realtime() | Open an MQTT-over-WSS subscription — see Realtime |
client.apps | Create and manage apps |
client.traces | List traces and get summaries |
client.webhooks | Manage webhook endpoints |
Environment Variables
Section titled “Environment Variables”The SDK reads credentials from environment variables when using the wizard:
| Variable | Description |
|---|---|
AXONPUSH_API_KEY | Your API key (starts with ak_) |
AXONPUSH_TENANT_ID | Organization/tenant ID |
AXONPUSH_BASE_URL | API base URL (default: https://api.axonpush.xyz) |