#!/bin/sh
# placeOrder: Place an order. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base.
curl -sS -X POST "${TRENDLINE_API_BASE:-https://systems.trendlinelabs.ai}/public/v1/orders" \
-H "X-Client-Id: $TRENDLINE_CLIENT_ID" \
-H "X-Api-Key: $TRENDLINE_API_KEY" \
-H "X-Api-Secret: $TRENDLINE_API_SECRET" \
-H "Content-Type: application/json" -d '{"venue":"polymarket","universal_id":"mk-btc-100k-2026","outcome":"yes","side":"buy","type":"limit","price":"0.42","size":10,"client_order_id":"s1-0001"}'"""placeOrder: Place an order. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base."""
import os
import requests
BASE = os.environ.get("TRENDLINE_API_BASE", "https://systems.trendlinelabs.ai")
HEADERS = {"X-Client-Id": os.environ["TRENDLINE_CLIENT_ID"], "X-Api-Key": os.environ["TRENDLINE_API_KEY"],
"X-Api-Secret": os.environ["TRENDLINE_API_SECRET"]}
r = requests.post(f"{BASE}/public/v1/orders", json={"venue": "polymarket", "universal_id": "mk-btc-100k-2026", "outcome": "yes", "side": "buy", "type": "limit", "price": "0.42", "size": 10, "client_order_id": "s1-0001"}, headers=HEADERS, timeout=10)
print(r.status_code, r.json())
// placeOrder: Place an order. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base.
const BASE = process.env.TRENDLINE_API_BASE ?? "https://systems.trendlinelabs.ai";
const HEADERS = { "X-Client-Id": process.env.TRENDLINE_CLIENT_ID, "X-Api-Key": process.env.TRENDLINE_API_KEY,
"X-Api-Secret": process.env.TRENDLINE_API_SECRET };
const r = await fetch(`${BASE}/public/v1/orders`, { method: "POST", headers: { ...HEADERS, "Content-Type": "application/json" }, body: JSON.stringify({"venue":"polymarket","universal_id":"mk-btc-100k-2026","outcome":"yes","side":"buy","type":"limit","price":"0.42","size":10,"client_order_id":"s1-0001"}) });
console.log(r.status, await r.json());
{
"amount_usd": null,
"avg_price": null,
"client_order_id": "s1-0001",
"created_at": "2026-10-06T05:59:59+00:00",
"expires_at": null,
"filled_size": "0",
"id": "ord_6702291f8e1c2a0012ab34cd",
"notional_reserved": "4.20",
"outcome": "yes",
"price": "0.42",
"remaining_size": "10",
"side": "buy",
"size": 10,
"status": "open",
"time_in_force": "GTC",
"type": "limit",
"universal_id": "mk-btc-100k-2026",
"updated_at": "2026-10-06T05:59:59+00:00",
"venue": "polymarket",
"venue_market_id": "bitcoin-above-100k-on-december-31",
"venue_market_title": "Bitcoin above $100,000 on December 31?",
"venue_order_id": "0x5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e",
"worst_price": null
}{
"client_order_id": "<string>",
"created_at": "<string>",
"id": "<string>",
"notional_reserved": "<string>",
"outcome": "<string>",
"side": "buy",
"status": "open",
"time_in_force": "GTC",
"type": "limit",
"universal_id": "<string>",
"updated_at": "<string>",
"venue": "kalshi",
"venue_market_id": "<string>",
"amount_usd": "<string>",
"avg_price": "<string>",
"expires_at": 123,
"filled_size": "<string>",
"price": "<string>",
"remaining_size": "<string>",
"size": 123,
"venue_market_title": "<string>",
"venue_order_id": "<string>",
"worst_price": "<string>"
}{
"client_order_id": "<string>",
"created_at": "<string>",
"id": "<string>",
"notional_reserved": "<string>",
"outcome": "<string>",
"side": "buy",
"status": "open",
"time_in_force": "GTC",
"type": "limit",
"universal_id": "<string>",
"updated_at": "<string>",
"venue": "kalshi",
"venue_market_id": "<string>",
"amount_usd": "<string>",
"avg_price": "<string>",
"expires_at": 123,
"filled_size": "<string>",
"price": "<string>",
"remaining_size": "<string>",
"size": 123,
"venue_market_title": "<string>",
"venue_order_id": "<string>",
"worst_price": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Place an order
#!/bin/sh
# placeOrder: Place an order. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base.
curl -sS -X POST "${TRENDLINE_API_BASE:-https://systems.trendlinelabs.ai}/public/v1/orders" \
-H "X-Client-Id: $TRENDLINE_CLIENT_ID" \
-H "X-Api-Key: $TRENDLINE_API_KEY" \
-H "X-Api-Secret: $TRENDLINE_API_SECRET" \
-H "Content-Type: application/json" -d '{"venue":"polymarket","universal_id":"mk-btc-100k-2026","outcome":"yes","side":"buy","type":"limit","price":"0.42","size":10,"client_order_id":"s1-0001"}'"""placeOrder: Place an order. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base."""
import os
import requests
BASE = os.environ.get("TRENDLINE_API_BASE", "https://systems.trendlinelabs.ai")
HEADERS = {"X-Client-Id": os.environ["TRENDLINE_CLIENT_ID"], "X-Api-Key": os.environ["TRENDLINE_API_KEY"],
"X-Api-Secret": os.environ["TRENDLINE_API_SECRET"]}
r = requests.post(f"{BASE}/public/v1/orders", json={"venue": "polymarket", "universal_id": "mk-btc-100k-2026", "outcome": "yes", "side": "buy", "type": "limit", "price": "0.42", "size": 10, "client_order_id": "s1-0001"}, headers=HEADERS, timeout=10)
print(r.status_code, r.json())
// placeOrder: Place an order. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base.
const BASE = process.env.TRENDLINE_API_BASE ?? "https://systems.trendlinelabs.ai";
const HEADERS = { "X-Client-Id": process.env.TRENDLINE_CLIENT_ID, "X-Api-Key": process.env.TRENDLINE_API_KEY,
"X-Api-Secret": process.env.TRENDLINE_API_SECRET };
const r = await fetch(`${BASE}/public/v1/orders`, { method: "POST", headers: { ...HEADERS, "Content-Type": "application/json" }, body: JSON.stringify({"venue":"polymarket","universal_id":"mk-btc-100k-2026","outcome":"yes","side":"buy","type":"limit","price":"0.42","size":10,"client_order_id":"s1-0001"}) });
console.log(r.status, await r.json());
{
"amount_usd": null,
"avg_price": null,
"client_order_id": "s1-0001",
"created_at": "2026-10-06T05:59:59+00:00",
"expires_at": null,
"filled_size": "0",
"id": "ord_6702291f8e1c2a0012ab34cd",
"notional_reserved": "4.20",
"outcome": "yes",
"price": "0.42",
"remaining_size": "10",
"side": "buy",
"size": 10,
"status": "open",
"time_in_force": "GTC",
"type": "limit",
"universal_id": "mk-btc-100k-2026",
"updated_at": "2026-10-06T05:59:59+00:00",
"venue": "polymarket",
"venue_market_id": "bitcoin-above-100k-on-december-31",
"venue_market_title": "Bitcoin above $100,000 on December 31?",
"venue_order_id": "0x5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e",
"worst_price": null
}{
"client_order_id": "<string>",
"created_at": "<string>",
"id": "<string>",
"notional_reserved": "<string>",
"outcome": "<string>",
"side": "buy",
"status": "open",
"time_in_force": "GTC",
"type": "limit",
"universal_id": "<string>",
"updated_at": "<string>",
"venue": "kalshi",
"venue_market_id": "<string>",
"amount_usd": "<string>",
"avg_price": "<string>",
"expires_at": 123,
"filled_size": "<string>",
"price": "<string>",
"remaining_size": "<string>",
"size": 123,
"venue_market_title": "<string>",
"venue_order_id": "<string>",
"worst_price": "<string>"
}{
"client_order_id": "<string>",
"created_at": "<string>",
"id": "<string>",
"notional_reserved": "<string>",
"outcome": "<string>",
"side": "buy",
"status": "open",
"time_in_force": "GTC",
"type": "limit",
"universal_id": "<string>",
"updated_at": "<string>",
"venue": "kalshi",
"venue_market_id": "<string>",
"amount_usd": "<string>",
"avg_price": "<string>",
"expires_at": 123,
"filled_size": "<string>",
"price": "<string>",
"remaining_size": "<string>",
"size": 123,
"venue_market_title": "<string>",
"venue_order_id": "<string>",
"worst_price": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
the key's id; public
the key's secret (tl_live_…), shown once at creation; never log or share it
the key's own client id (cli_…), different for every key; public
Body
the venue's own outcome label the order is on
yes, no buy or sell, the action on outcome
buy, sell limit (rests at price or better, per time_in_force) or market (fills now against the book, up to an optional worst price)
limit, market the venue to trade on; only venues enabled for trading are accepted (no best-venue routing)
kalshi, polymarket, limitless, predictfun buys only, instead of size: the USD to spend, at least 1, whole cents. A market buy spends it on Polymarket and predict.fun; elsewhere, and on a limit order, it buys the whole contracts it covers at price (or the worst price)
1 - 32^[0-9]+(\.[0-9]{1,2})?$an id you choose for this order (e.g. a UUID), unique per order; resend the same one only to retry the same order, which never places a second order. Optional: without it we generate one, and a retry of a lost answer may then place a second order
^[A-Za-z0-9_-]{1,64}$GTD only, required with it: when the order expires, Unix seconds, at least 180 s and at most a year ahead
limit: the limit price of outcome, required. market: optional, the worst price you accept (a buy's ceiling, a sell's floor); without it the venue's extreme price is the bound and your limits count $1 per contract. A plain decimal string on the venue's grid, refused when off it, never rounded
1 - 32^[0-9]+(\.[0-9]+)?$whole contracts, at least 5; a sell sends size, a buy sends size or amount_usd (exactly one)
1 <= x <= 1000000GTC rests until cancelled (the limit default); GTD rests until expires_at; FOK fills entirely now or not at all; FAK (alias IOC) fills what it can now and cancels the rest (the market default). A market order takes FOK or FAK/IOC only. Lower case is accepted
GTC, GTD, FOK, FAK, IOC, gtc, gtd, fok, fak, ioc the market universal id; its leg on venue is traded, so switching venue is one field. Send this, venue_market_id, or both
1 - 256the venue's own market id (on Kalshi, its ticker); with universal_id both must name the same leg, else 422, never re-routed
1 - 256Response
a reconcile's answer (the venue's state, or not_placed), or a replay of the latest answer for this client_order_id
your id for this order
when we accepted the order, ISO 8601
our id for the order, ord_ and 24 hex digits; it exists from the moment we accept the request, so an order whose status is unknown has one too
^ord_[0-9a-f]{24}$the order's maximum loss counted against your limits, USD as a decimal string
the venue's own outcome label
buy or sell, the action on outcome at price
buy, sell expired: a GTD order reached expires_at (filled_size says what filled first). unknown: the venue's answer was not received; retry with the same client_order_id or read GET /public/v1/orders/{id}, never send a new id. On a venue that cannot prove an order's absence it may stay unknown: check the venue before trading the same intent again
open, filled, partially_filled, cancelled, expired, unknown, not_placed as sent, or the type's default (GTC for limit, FAK for market)
GTC, GTD, FOK, FAK, IOC, gtc, gtd, fok, fak, ioc limit or market, as sent
limit, market the market universal id holding the leg; null when no market lists it
when we last recorded a change to the order, ISO 8601
the venue the order was sent to
kalshi, polymarket, limitless, predictfun the venue's own market id the order went to
the USD amount sent, as sent; null when size was sent
the average fill price of outcome, 0..1 as a decimal string, when the venue reported one
a GTD order's expiry, Unix seconds, as sent; null otherwise
contracts filled, an exact decimal string; null while the status is unknown. A market buy, or a limit FAK/FOK buy, can fill more contracts than size at better prices (never spending more than size × price)
as sent: a limit order's price, a market order's worst price; null on a market order sent without one
contracts still resting, an exact decimal string; null while the status is unknown
whole contracts ordered: as sent, or bought by amount_usd where the venue takes contracts; null when the venue took amount_usd itself
the leg's title on the venue, when our mirror holds it
the venue's order id; null while the status is unknown and for an order that was never placed
a market order's bound as sent to the venue: your price, else the venue's extreme price; null on a limit order