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.
The SDK can lag the OpenAPI. New endpoints and fields land in the venue spec first. For production bots that must track every surface on day one, generate a client from venue-openapi.yaml (and venue-asyncapi.yaml for WS) rather than waiting on a package release. The SDK remains the fastest path for common flows.

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 API key and secret (shown once).
The SDK talks to the venue (https://api.omnibook.xyz), not the browser session proxy. Pass the 64-character hex secret from Settings, the client hex-decodes it to the raw 32-byte HMAC key for you (legacy base64 secrets still work).

Quick start

Prices are pip ticks (3500 = 35.00¢). Do not send 1–99. Helpers live in omnibook.ticks — see Ticks, pips, and subcents.
Multi-asset support is partial in the SDK. get_rounds(category=...) scopes to one series, but get_oracle_price() takes no feed argument and therefore always answers feed 0 (BTC). For gold or crude, call the route directly until a release adds the parameter:
first_trading_market() likewise returns whichever live slot comes first — with nine series that is not necessarily the asset you want. Read the round’s category to confirm. See Series, assets, and categories.

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_snapshot / orderbook_delta and trades. Live channels also include oracle, rounds, and user. (ticker is not implemented.) oracle and rounds are global across all nine series — the SDK hands you every frame. Filter on msg["msg"]["feed"] and msg["msg"]["category"] yourself.
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 / retention
  • Account limits (scopes, read/write/cancel buckets, trailing volume, batch cap)
  • Markets, orderbook, trades
  • Rounds (with category filter) and oracle price (feed 0 only — see above)
  • Portfolio balance, positions, fills, orders, queue position
  • Place / batch / cancel / cancel-batch / cancel-all / decrease
  • Pip tick helpers (cents_to_tick, on_grid, implied_ask, first_trading_market)
  • Dead-man switch (arm / disarm)
  • Deposit address (read)
  • WebSocket subscribe / unsubscribe / update_subscription / 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 (pip ticks, e.g. 100 = 1.00¢) and cancel in teardown.

Prefer raw HTTP?

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