Overview
About the API
The Starzip trading API lets a program read markets and order books, place and cancel signed orders, and stream book and order updates. Every endpoint lives under the /v1 path. Paths on these pages omit that prefix, so /book means /v1/book.
Orders are matched off-chain and settled on-chain. You sign each order with your wallet, so the API never holds your keys.
Start Trading
A trading program usually goes through these steps once, then repeats steps 5 to 8.
- Sign in to your Starzip account and connect the wallet you will trade with. API keys are issued only to a signed-in member, and only for the wallet connected to the account.
- Create an API key in the Starzip app, or with your account token and a wallet signature. See Create a Key in the App and Create or Derive a Key.
- Read
GET /timeand keep your clock within 30 seconds of it. Every signed request carries a timestamp. - From your wallet, approve the Exchange contract to spend your collateral token, and to transfer your outcome tokens if you will sell. The addresses are in Network and Contracts.
- Find a market with
GET /markets, then read its tick size, minimum order size, fee rate, and order book. See Market Data. - Read your current order nonce with
nonces(maker)on the Exchange contract. - Sign an order with your wallet and send it with
POST /order. See Orders. - Follow fills on the user WebSocket channel, and send heartbeats so your orders are canceled if your program stops. See WebSocket and Heartbeats.
Access Levels
Endpoints fall into three access levels.
| Level | Credential | Used for |
|---|---|---|
| Public | None | Server time, markets, order books, prices, price history, indices, and the market WebSocket channel |
| L1 | EIP-712 signature from your wallet. Creating or retrieving a key also needs your Starzip account token | Creating, retrieving, listing, or revoking API keys without an existing key |
| L2 | API key plus an HMAC-SHA256 request signature | Placing and canceling orders, reading your orders, trades, and balances, heartbeats, and key management |
See Authentication for both signing schemes.
Network and Contracts
During the preview, the API runs on BNB Smart Chain Testnet. Use these values to sign orders, read your nonce, and set approvals.
| Item | Value |
|---|---|
| API host | https://por.dev.starzip.io |
| Account sign-in | https://auth.dev.starzip.io, which issues the account token used to create API keys |
| Chain ID | 97 (BNB Smart Chain Testnet) |
| Exchange | 0x20769ADbD470C180949226C5Db04dBf0cAF212A3. The verifyingContract of the order domain, the spender to approve, and the source of nonces(maker) |
| Conditional Tokens | 0x2D99C26B753f2B33885a2dA31783f4dbd85A5b08. Holds the outcome tokens. Call setApprovalForAll(Exchange, true) before you sell |
| Collateral | USDT 0x71ad9ce2bDD4537ff6F964c3905D660cF92DcFBa, 18 decimals. Call approve(Exchange, amount) before you buy |
These values apply to the preview only and will change at general availability. Only the collateral token above counts toward your balance. Another USDT token on the same chain does not.
Responses and Errors
Every REST response, and every error message on the WebSocket, is wrapped in the same envelope. Exactly one of payload and error is null.
// success
{ "payload": 1792565372, "error": null }
// failure
{ "payload": null, "error": { "code": 4004, "message": "market not found for tokenId" } }The response shapes on these pages describe payload. Branch on error.code or the HTTP status, which always agree. Treat error.message as text for logs and people.
| Code | Status | Meaning | Example messages |
|---|---|---|---|
4001 | 400 | The request is malformed or fails validation | price off tick grid, postOnly and deferExec are not supported |
4002 | 401 | Missing or invalid authentication headers | POLY_API_KEY required, invalid API key or signature, POLY_TIMESTAMP is more than 30s from server time, bearer token required, access token expired, invalid access token |
4003 | 403 | The wallet is not allowed for this request: the order maker is not the wallet that owns the API key, or the wallet signing for a new key is not the one connected to your account | order maker is not the API key's wallet, POLY_ADDRESS is not the wallet connected to this account |
4004 | 404 | The market, token, order, or route does not exist, or the book has no orders on the side you asked for | market not found for conditionId, route not found |
4005 | 405 | The route exists but not for this HTTP method | method not allowed |
4006 | 409 | The wallet already holds the maximum number of API keys | wallet already has 5 API keys; revoke one first |
4007 | 503 | Temporarily unavailable. Retry shortly | order books are loading, retry shortly, chain unavailable |
4008 | 500 | Internal error | internal error (always this text) |
- Error messages are written for people and may change. Do not parse them. The examples above are representative, not a complete list.
- Some errors add an
error.dataobject with the value you need to retry, for example the expectedfeeRateBpsorheartbeatId. - A batch order request (
POST /orders) returns 200 even when items fail. Each failed item reports its reason inerrorMsg, with no status of its own. See Place a Batch. - Retry 503 after a short wait. Do not retry 400, 401, 403, or 409 unchanged; fix the request first.
- WebSocket errors use the same envelope. Fatal ones close the connection with code
1008. See Errors and Closing. - Unknown fields in a request body are ignored.
Data Formats
- JSON keys are camelCase in every request, response, and WebSocket message.
- Amounts, sizes, prices, and token IDs are decimal strings, for example
"1.5"or"0.55". Sizes and prices are in whole tokens with trailing zeros removed. - Addresses, transaction hashes, order IDs, and signatures are
0xhex strings. - API key IDs, trade IDs, and heartbeat IDs are 26-character ULID strings, not UUIDs.
A few fields differ from these defaults:
| Field | Format |
|---|---|
minimumOrderSize, minimumTickSize on markets and /tick-size | JSON number |
p and t in /prices-history | JSON numbers. t is Unix seconds |
createdAt on orders | JSON number, Unix seconds |
expiration, matchTime, lastUpdate | String, Unix seconds |
timestamp on books and WebSocket messages | String, Unix milliseconds |
endDateIso on markets | RFC 3339 in UTC, or an empty string |
balance, allowance | Decimal string in base units, not whole tokens |
Pagination
List endpoints (/markets, /data/orders, /data/trades, /activity) return pages of up to 100 items, newest first, inside payload. The page size is fixed.
{
"limit": 100,
"nextCursor": "MDFKOVo...",
"count": 100,
"data": [ ... ]
}- Request the first page without a cursor, or with
nextCursor=MA==. - Pass the returned
nextCursoras a query parameter to get the next page. - A
nextCursorofLTE=means there are no more pages. - Only send cursors that the API returned. Any other value is rejected with 400.
Request Limits
- Request bodies are limited to 64 KiB. Larger bodies are rejected with 400.
- Each request must complete within 12 seconds.
- Batch endpoints have their own item limits, listed with each endpoint.
- Request-rate limits are not published during the preview. Responses carry no rate-limit headers.
- The WebSocket refuses new connections with 503 when it is at capacity. Retry with backoff.
Compatibility
The API follows the shape of the Polymarket CLOB API: the same POLY_* authentication headers, the same two-level key scheme, and a similar endpoint layout. It is not a drop-in replacement. Clients built for Polymarket need these changes:
- All keys are camelCase, including WebSocket messages, so stock Polymarket SDKs do not work without modification.
- Every response is wrapped in the
{"payload":...,"error":...}envelope. Unwrappayloadbefore reading the shapes Polymarket clients expect. - Orders use the original CTF Exchange order layout, which includes
taker,nonce, andfeeRateBps. They are signed against the Starzip Exchange domain. - Only externally owned account (EOA) signatures are accepted. Proxy wallet and Safe signatures are not supported.
- Fees are a per-market taker rate. Each order's
feeRateBpsmust equal the market's current rate fromGET /fee-rate. - Post-only orders, deferred execution, and negative-risk markets are not supported.
Store Tokens and STAR are utility tokens. They are not securities, equity, or investment contracts, and they confer no ownership, dividends, revenue share, or guaranteed returns.
This page is informational only and is not an offer or solicitation. Access is restricted in some jurisdictions.