Skip to main content
The Python SDK wraps the gateway so you write trading logic, not HTTP. It handles auth, venue signing, idempotency keys, pagination, retries, and typed errors. The only configuration is an API key.

Quickstart

Typed responses

Responses are Pydantic models — autocomplete and validation included, unknown fields preserved so a new API field never breaks you:
List endpoints return a Page (a list with .has_more / .next_cursor). .iterate() walks every page for you:

Errors

Failed calls raise typed exceptions carrying code, message, and request_id:
MithrilError is the base; subclasses include AuthenticationError, NotFoundError, BadRequestError, RiskLimitExceeded, RateLimitError, and ServerError. 429s are retried automatically.

Idempotency, handled for you

orders.create and complex_orders.create attach an idempotency-key automatically, so a retry after a timeout never double-places. For safe retries across process restarts, pass your own stable key:

API surface

Configuration

Runnable examples

Six scripts — one per stack layer — all built on the SDK.