Shared runtime helpers for the Sendmux Python SDK packages.
- Sendmux docs: sendmux.ai/docs
- Source repository: Sendmux/sendmux-sdk
- Python 3.10 or newer.
- A surface package such as
sendmux-sending,sendmux-mailbox, orsendmux-managementfor API operations.
pip install sendmux-coreValidate an API key prefix and prepare request headers before calling a surface package.
import os
from sendmux_core import conditional_headers, idempotency_headers, validate_api_key
validate_api_key(os.environ["SENDMUX_MAILBOX_API_KEY"], surface="mailbox")
headers = {
**idempotency_headers("idem_123"),
**conditional_headers(if_none_match='W/"etag"'),
}validate_api_keycheckssmx_root_*prefixes for root clients, send-capablesmx_mbx_*prefixes or owner-approved Sending-resourcesmx_agent_*tokens for Sending clients, and mailbox-compatiblesmx_mbx_*orsmx_agent_*prefixes for Mailbox clients.configure_authapplies bearer auth to generated client configuration objects.idempotency_headersandconditional_headersprepare request headers.iter_cursor_pagesiterates cursor-paginated list responses.RetryOptionsconfigures retry behaviour for generated clients.SendmuxApiErrornormalises API errors and request IDs.
Open an issue in Sendmux/sendmux-sdk with the package name, version, and request ID from any API error.
MIT. See the licence file.