Skip to main content
The official Python SDK wraps HMAC signing, REST, and WebSocket so agents and bots can trade without assembling headers by hand.

Install

Requires Python 3.10+.

Prerequisites

  1. Sign in at omnibook.xyz.
  2. Deposit USDC (bot keys cannot withdraw).
  3. Create a key under Settings → API keys. Copy the key ID and secret (shown once).
The SDK talks to the venue (https://api.omnibook.xyz), not the browser session proxy. Pass the base64 secret from Settings — the client decodes it to the raw 32-byte HMAC key for you.

Quick start

Place an order

On a 504 sequencing timeout, retry with the same client_order_id — see Orders.

Async

WebSocket

One signed connection multiplexes public and private channels. Pass market_ids for orderbook_delta, trades, and ticker.
Channel details: WebSocket overview and Channels.

Environments

Errors

The SDK raises typed exceptions from the venue envelope: Branch on exc.code, not the message. Full list: Errors.

What the SDK covers

  • Exchange status / schedule
  • Markets, orderbook, trades
  • Rounds and oracle price
  • Portfolio balance, positions, fills, orders
  • Place / batch / cancel / mass-cancel / decrease
  • Deposit address (read)
  • WebSocket subscribe / unsubscribe / stream
Withdrawals and account signup are intentionally out of scope for bot keys.

Running the tests

From the SDK repository:
Live venue tests (auth, market data, place+cancel, WebSocket subscribe):
Prefer the local venue when available. Place-order tests use tiny post_only sizes and cancel in teardown.

Prefer raw HTTP?

See Authentication for HMAC header details in Python, TypeScript, and cURL without the SDK.