API
REST and WebSocket access to 1024EX perpetuals and options: base URLs, response envelope, and the map of this section.
The 1024EX API exposes the same matching engine, risk engine and market data that the web app runs on. Two venues are first-class: perpetuals (non-expiring, USDC-margined, 218 markets across crypto, US equities, ETFs and commodities) and options (dated, cash-settled, USDC-collateralized, ~24,000 live contracts on 106 underlyings). Prediction markets share the same account and the same credential.
Everything is plain HTTPS + JSON. There is no signing of order payloads with a wallet key, no nonce ladder, and no on-chain transaction to submit: you hold an API key, you sign each HTTP request with HMAC-SHA256, and the exchange settles in its database with an asynchronous on-chain audit trail.
Base URLs
| Environment | REST | WebSocket |
|---|---|---|
| Mainnet | https://api-mainnet.1024ex.com | wss://api-mainnet.1024ex.com/api/v1/ws |
| Testnet | https://api-testnet-stable.1024ex.com | wss://api-testnet-stable.1024ex.com/api/v1/ws |
Testnet is a full copy of the stack with faucet USDC. Keys are not shared between the two — mint a key separately on each.
All routes are prefixed /api/v1/. Market data endpoints are open; everything that touches an account requires the three auth headers described in Authentication.
Response envelope
Every response — success or failure, 200 or 500 — has the same three-key shape.
{
"success": true,
"data": { "serverTime": 1790094672927, "timezone": "UTC" },
"meta": { "requestId": "req_e903dea8e2d14348b2e3ea92bdecb631", "timestamp": 1790094672927 }
}{
"success": false,
"error": {
"code": "TRADE_MARKET_NOT_FOUND",
"codeNum": 13014,
"message": "Market not found: NOPE-USDC",
"details": { "market": "NOPE-USDC" }
},
"meta": { "requestId": "req_b2fbe365c9604884a4d202b451c57e45", "timestamp": 1790094673430 }
}Two rules that save debugging time:
- Unwrap
datayourself. Clients that forget this and readresponse.pricegetundefinedrather than an error. - Branch on
error.code, not on the HTTP status or onmessage. Codes are stable; messages are not. See Error responses. - Quote
meta.requestIdin any support request — it is the key to the server-side log line for that exact call.
Your first request
No credentials needed for market data:
curl -s https://api-mainnet.1024ex.com/api/v1/perp/markets/BTC-USDC/ticker{
"success": true,
"data": {
"market": "BTC-USDC",
"lastPrice": "86145.55",
"markPrice": "86148.955",
"indexPrice": "86148.955",
"bid": "86128.92",
"ask": "86166.57",
"openInterest": "0.012139",
"fundingRate": "0.00005000",
"nextFundingTime": 1790121600000,
"priceChangePercent24h": "0.31"
},
"meta": { "requestId": "req_196ded…", "timestamp": 1790094673948 }
}Then mint a key and place your first order — see Authentication for the 20-line signing helper, and Perpetuals: trading for the order body.
Cookbook
Short scripts you can paste into a terminal. Every one of them was run against
the live API before it was published, and the output shown on the page is what
it actually returned.
| Recipe | What you walk away with |
|---|---|
| Sign your first request | A signer you reuse for every private endpoint, and a clock-drift check that rules out the most common cause of AUTH_INVALID_SIGNATURE |
| Build a limit price the engine accepts | A price on the tick grid, a size on the step grid, and the notional checked before you send |
| Walk the options chain | Strikes, marks and implied vol for one expiry, with the E6 decoding done for you |
| Place, check and cancel an order | A full order lifecycle, plus the four rejections you hit first: off-grid price, too many decimals, outside the price band, reused client id |
| Stream a market and notice what you missed | A WebSocket loop that tells a heartbeat from data and knows when to resynchronize |
Five things that bite first-time integrations
Each of these is silent — you get a 200, just not the answer you expected.
/perp/marketsignoreslimit. It has no paging; you always get the
full list (218 markets today). Filter client-side.- Caps are applied without telling you. Ask klines for
limit=5000and you
get200with 1000 rows, not an error. - The book can be thinner than the
depthyou ask for.depth=100on a
market quoted 20 levels deep returns 20. That is the book, not a failure. - Options
underlyingis the full symbol.BTC-USDCworks; a bareBTC
returns an empty list rather than an error, which reads like "no options
listed" when the real answer is "wrong symbol". /options/expiriesand/options/chaindisagree on date format. The
first answers2026-09-25T08:00:00Z, the second wantsexpiry=2026-09-25.
Feeding the timestamp straight back gives400.
This section
| Page | What it covers |
|---|---|
| Notation | E6 integers vs decimal strings, symbol formats, timestamps, the snake_case bodies |
| Authentication | Minting a key, the HMAC canonical payload, worked examples, key permissions |
| Rate limits | Per-second weights, burst, daily caps, the five 429 codes |
| Error responses | The full code table by family |
| Perpetuals: market data | Markets, book, trades, klines, mark/index, funding, OI |
| Perpetuals: trading | Orders, positions, leverage, margin, TP/SL, one-way vs hedge |
| Perpetuals: advanced orders | TWAP, VWAP, POV, scale, iceberg, OCO, bracket, pegged, sniper, conditional, trailing stop |
| Options: contracts | Symbology, contract specs, marks and IV, fees, the expiry timeline |
| Options: market data | Underlyings, expiries, chain with Greeks, book, tape |
| Options: trading | Single orders, multi-leg baskets, positions, underlying-referenced TP/SL |
| Options: exercise and settlement | Manual exercise, auto-settlement, payout and fee basis |
| WebSocket | Channels, subscribe frames, socket auth, connection hygiene |
SDKs and tools
| Tool | What it is |
|---|---|
| quant1024 | open-source Python toolkit (pip install quant1024) wrapping this API |
| SDK & deployment | scaffolding and deploying a strategy built on that SDK |
| 1024Chain on GitHub | the chain the exchange settles its audit trail to |
Machine-readable spec
The OpenAPI 3.0 document is served live by the exchange and is what the API Reference section is generated from:
curl -s https://api-mainnet.1024ex.com/api-docs/openapi.jsonIt is generated from the handlers themselves, so it is always in lockstep with the deployed build. To check which build you are talking to:
curl -s https://api-mainnet.1024ex.com/version
# {"git_sha":"0159efe7…","service":"1024-public-api","source":"file"}Updated about 1 month ago
