Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A Lean API key, sent as Authorization: Bearer <key>. A test key (lean_sk_test_...) simulates orders and fills with no money; a live key (lean_sk_live_...) trades for real within the key's limits. Every successful response says which mode answered in data.livemode.

Body

application/json
market_id
string
required

The market to trade.

Required string length: 1 - 512
venue
enum<string>
required

The venue to rest the order on. Every venue runs limit chases.

Available options:
kalshi,
polymarket,
polymarket_us,
hyperliquid
action
enum<string>
required

buy or sell.

Available options:
buy,
sell
quantity
string
required

Shares to buy or sell. A sell is at most what the account holds beyond its other resting sells and stop losses.

Pattern: ^\d+(?:\.\d+)?$
offset_ticks
integer

How many price ticks behind the best price on its own side the order rests, from 0 to 10. Give offset_ticks or offset_price, not both. Defaults to 0, resting at the best price.

Required range: 0 <= x <= 10
offset_price
string

How far behind the best price on its own side the order rests, in dollars from 0 to 0.1. Give offset_ticks or offset_price, not both.

price_limit
string

The worst price the order rests at, in dollars between 0.0001 and 0.9999: a buy never rests above it and a sell never below it. Omit to follow the book wherever it goes.

expires_at
string<date-time>

When the limit chase lapses if it has not filled. Omit to keep it until canceled.

Response

The limit chase, following the book

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required