Python SDK
Publish events, read traces and errors, manage channels and webhooks, and add passive Python tracing.
axonpush provides synchronous AxonPush and asynchronous AsyncAxonPush
clients, generated DTOs, passive framework integrations and logging/OTLP helpers.
Your model routing, authorisation and business behaviour stay unchanged.
These pages track the published release, axonpush 0.0.19 on PyPI.
Install and configure
pip install axonpushFramework integrations ship as extras, for example pip install "axonpush[otel]"
or pip install "axonpush[langchain]"; axonpush[all] pulls in every one.
Read AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL and
AXONPUSH_ENVIRONMENT from your application’s secret/configuration layer. Keep
content capture metadata_only and use separate ingestion and operator
credentials.
Publish an event
import os
from axonpush import AxonPush, EventType
channel_id = os.environ["AXONPUSH_CHANNEL_ID"]
with AxonPush(environment="production") as client:
ack = client.events.publish(
"ticket.escalated",
{"ticket": "t_42", "priority": "high"},
channel_id,
agent_id="triage-bot",
event_type=EventType.AGENT_MESSAGE,
)
if ack:
print(ack.event_id, ack.status)With fail_open=True (the default) a connection failure returns None instead
of raising; authentication and validation errors still raise. See
Client and Events.
The workspace calls (observe, observe_many, identify, group and the
workspaces, templates, observations and activity resources) are not in
the published 0.0.19 package. Until a release ships them, call the
HTTP API directly for workspace observations and profiles.
Resources
| Resource | Methods |
|---|---|
client.events | publish, search |
client.channels | list, get, create, update, delete |
client.apps | list, get, create, update, delete |
client.environments | list, create, update, delete, promote (alias promote_to_default) |
client.traces | list, get |
client.traces_v2 | Deprecated alias of client.traces |
client.errors | list, get, events, triage |
client.alerts | list, create, update, delete, occurrences |
client.analytics | timeseries, breakdown, overview, heatmap, diff, latency, ingestion_status, dimensions, dimension_values |
client.webhooks | create_endpoint, list_endpoints, delete_endpoint, deliveries |
client.organizations | list, get, update, delete, invite, cancel_invitation, accept_invitation, remove_member, transfer_ownership, leave |
client.capabilities | get |
client.dashboards | list, get, create, update, delete |
client.moderation | list_rules, create_rule, delete_rule, list_violations, efficacy |
client.govern_policies | list, create, update, delete |
client.spend_policies | list, create, update, delete |
AsyncAxonPush exposes the same accessors with awaitable methods.
dashboards, moderation, govern_policies and spend_policies are still on
the 0.0.19 client, but the current API no longer serves their routes, so calls
to them fail with NotFoundError.
Supporting telemetry
Use the framework integrations already appropriate to the application, or attach OpenTelemetry to an existing tracer provider. Logs and spans are supporting evidence; committed business transitions need an isolated allowlisted journal/exporter. Never publish synchronously inside a business transaction or treat a fail-open return as delivery confirmation.
See Client options, Events, Telemetry and API reference.
Billing, plans and quotas
Plans and prices on the hosted cloud, checkout and the billing portal, monthly usage and top-ups, the free organisation allowance, and what happens at a limit.
Client
Construct AxonPush or AsyncAxonPush, control fail-open behaviour and payload redaction, and handle the error hierarchy.