For API-key authentication, Sending clients accept a send-capable
smx_mbx_ key or owner-approved Sending-resource smx_agent_ token. Mailbox clients accept
smx_mbx_ keys or scoped smx_agent_ tokens. Management API-key clients require
team-scoped smx_root_ keys.Requirements
- Go 1.23 or newer.
- An API key or REST OAuth grant for the surface you are calling.
Install
The Go SDK is one module with surface subpackages.OAuth access tokens
UseNewWithAccessToken for a bare token or NewWithTokenProvider for a function that receives the request context.
Create a client
Import the surface package directly.Choose a surface
Durable
smx_agent_ tokens are mailbox-compatible and include mailbox.read
and email.receive, not email.send. After owner acceptance and approval,
exchange the durable token for a one-hour Sending-resource token before sending.https://smtp.sendmux.ai/api/v1 by default. Mailbox and Management use https://app.sendmux.ai/api/v1.
Shared API behaviour
Surface packages validate API key prefixes, attach bearer auth, and wrap an HTTP client with retry behaviour.Pagination
List responses use cursor pagination withpagination.has_more and pagination.next_cursor. The core package exports IterateCursor() for cursor iteration when you wrap a page-fetching function.
Retries and rate limits
Surface clients usecore.NewHTTPClient() by default. It retries safe requests and requests that carry Idempotency-Key, then honours Retry-After and X-RateLimit-Reset response headers.
Pass WithRetryOptions(core.RetryOptions{...}) into a surface factory to change attempts and backoff.
Idempotency and ETags
Use surface header helpers when a generated operation accepts optional header values.Idempotency-Key for retry-safe mutating requests. Use If-Match and If-None-Match with single-resource endpoints that support ETags.
Errors
Thecore package defines core.APIError. Surface packages expose APIErrorFromResponse() to map generated error responses into the typed API error shape.
Keep the request ID from the API response when contacting support.
Next steps
SDK overview
Choose the right package family and API surface.
Versioning and support
Check compatibility, support, and upgrade guidance.
Management API
Review the Management API contract used by
sendmux.ai/go/management.API keys
Create and scope the credentials used by SDK clients.