Building a bot or trading for yourself? You do not need to apply for the Programmatic API. Derive a scoped API token with the
trading scope from the Authentication page and start trading immediately. The Programmatic API and the application below are for platforms and partners that need to create and manage sub-accounts on behalf of their users.Recommended architecture
Recommended setup for production integrations:
- Store the real HMAC credentials on your backend. The
tokenIdandsecretshould never leave your server infrastructure. - Use the SDK server-side to sign partner-authenticated requests. All trading, account creation, and delegated signing calls should be made from your backend.
- Expose only your own app-specific endpoints to the frontend. Your frontend talks to your backend API — your backend talks to the Limitless API.
- Keep public market reads in the browser. Unauthenticated endpoints like market data and orderbooks can be called directly from the frontend.
Overview
The programmatic API introduces three capabilities:| Capability | Description |
|---|---|
| Scoped API tokens | HMAC-SHA256 authenticated tokens with granular scopes (trading, account_creation, delegated_signing) |
| Partner sub-accounts | Create and manage user profiles linked to your partner account |
| Delegated signing | Submit orders without end users managing private keys — the server signs via a managed wallet |
Partner lifecycle
Bootstrap your partner account
Create a standard Limitless account by logging in with your wallet at limitless.exchange. This gives you a
profileId and wallet address.Get partner capabilities enabled
Apply for programmatic API access. The team will review your application and enable token management and allowed scopes on your account.
Apply for Programmatic API Access
Fill out the partner application form to get started. You’ll need your Limitless wallet address from Step 1.
Derive a scoped API token
Authenticate with your Privy identity token and call
POST /auth/api-tokens/derive to create a scoped token. The response includes a tokenId and secret — store the secret securely, it is only returned once.Create sub-accounts
Use the scoped token to create sub-accounts for your end users. Choose server wallet mode for Web2 integrations (delegated signing) or EOA mode for Web3 users who manage their own keys.
Trade on behalf of sub-accounts
With the FAK order — matches immediately up to available size and cancels any remainder:FOK order — executes immediately at market price or is cancelled entirely:
delegated_signing scope and server wallet accounts, submit unsigned orders — the server signs them automatically. GTC (resting limit), FAK (fill-and-kill limit), and FOK (fill-or-kill market) order types are supported.GTC order — stays on the orderbook until filled or cancelled:Scopes
| Scope | Description | Self-service |
|---|---|---|
trading | Place and cancel orders. Default scope. Required base for delegated_signing. | Yes |
account_creation | Create sub-account profiles linked to the partner. | Yes |
delegated_signing | Server signs orders on behalf of sub-accounts via managed wallets. Must be paired with trading. | Yes |
withdrawal | Transfer ERC20 balances from managed server-wallet sub-accounts to the partner’s own addresses. | Yes |
admin | Access admin-protected endpoints. | No (admin-provisioned only) |
Scope requirements by operation
| Operation | Required scopes |
|---|---|
Place or cancel orders (POST /orders) | trading |
Create sub-accounts (POST /profiles/partner-accounts) | account_creation |
Create sub-accounts with server wallets (createServerWallet: true) | account_creation + delegated_signing |
| Submit unsigned orders (server signs) | trading + delegated_signing |
Redeem resolved positions (POST /portfolio/redeem) | trading |
Withdraw funds (POST /portfolio/withdraw) | withdrawal |
Sub-account modes
Server wallet (Web2 partners)
SetcreateServerWallet: true when creating a sub-account. The server provisions a managed Privy wallet and links it to the profile. The partner submits unsigned orders and the server signs them via the managed wallet. Token approvals are provisioned automatically.
Lifecycle after a trade
For server wallet sub-accounts, it helps to treat trading, market resolution, and redemption as separate stages:- Order execution - Place and cancel orders through
POST /ordersor the SDKDelegatedOrderService. - Portfolio resolution state - Portfolio endpoints such as
GET /portfolio/positionsandGET /portfolio/{account}/positionsmay later showstatus: RESOLVEDandwinningOutcomeIndexonce the winning side is known. - On-chain payout settlement - Winning positions become redeemable only after the underlying conditional token payout has been reported on-chain.
payoutDenominator(conditionId) is still 0.
Redemption and withdrawal support
Server wallet partner flows now include direct endpoints for payout settlement and treasury movement:POST /portfolio/redeemto submitredeemPositionsfor a resolved condition.POST /portfolio/withdrawto transfer ERC20 funds from a managed sub-account server wallet to the partner’s own account or smart wallet.
EOA (Web3 partners)
OmitcreateServerWallet or set it to false. The partner proves wallet ownership using x-account, x-signing-message, and x-signature on POST /profiles/partner-accounts. The end user keeps their private key in their own wallet and signs each order (EIP-712) themselves — Limitless never holds their key.
Scopes: trading and account_creation are sufficient for EOA partner flows. You do not need delegated_signing unless you also use server wallet sub-accounts.
End-to-end flow
- Register the user’s wallet (once per address) —
POST /profiles/partner-accountswith EOA headers. The response returnsprofileIdand the walletaccount. If a profile already exists for that address, the API returns409 Conflict— your app should reuse the storedprofileIdinstead of re-registering. - Persist the mapping in your backend — save at least
walletAddress → profileId(and your own user id if you have one). You are not storing a Limitless “session object”; you are storing your app’s record so you know whichprofileIdto pass on orders. See What to persist below. - User signs each order — build the order per EIP-712 signing and have the user sign in the browser (e.g. wagmi/viem/ethers).
makerandsignermust be the user’s EOA address. - Submit the order from your backend (HMAC) —
POST /orderswith HMAC auth,onBehalfOfset to the user’sprofileId, andownerIdset to that sameprofileIdwhen you send a signed order body. Theorder’smaker/signermust match the sub-account wallet. (If you use delegated signing with an unsignedorder, the server setsownerIdfor you — that path is for server-wallet sub-accounts, not pure EOA signing.)
Common EOA auth error
IfPOST /orders returns Signer does not match authenticated profile account, check all three fields point to the same user account:
ownerId= user’sprofileIdonBehalfOf= same user’sprofileIdorder.makerandorder.signer= that user’s wallet address
ownerId while signing with a user wallet causes this error.
Architecture (browser + backend)
Typical layout for a Next.js (or any SPA) app:- Browser: connect wallet (e.g. wagmi + RainbowKit); sign the ownership proof for step 1; sign EIP-712 orders for step 3. Never put partner HMAC secrets in client bundles.
- Backend (Next.js Route Handlers, server actions, or a separate API): holds the scoped token
tokenId/secret; signs every request toapi.limitless.exchangewith HMAC; forwardsPOST /ordersafter the client submits the signed order payload (or proxies market data as needed).
hmacCredentials and partnerAccounts.createAccount for EOA registration.
What to persist for EOA partners
| Store in your DB | Why |
|---|---|
User’s wallet address and Limitless profileId | Needed for onBehalfOf / ownerId on every POST /orders for that user. |
Optional: feeRateBps / profile metadata | You can refetch from the API if needed. |
| Do not rely on storing | Notes |
|---|---|
| The user’s private key | Not required and not recommended; the wallet stays in the user’s client. |
| A Limitless “login session” to avoid order signing | EOA mode requires an EIP-712 signature per order (or a new signing policy you implement). You can avoid repeated registration by persisting profileId. |
Partner HMAC secret in the browser | Forbidden — keep only on the server. |
Delegated order types
Delegated orders support three execution strategies:GTC (Good-Til-Cancelled)
Limit orders that rest on the orderbook at a specified price until they are filled or explicitly cancelled. Useprice and size to specify the order.
| Parameter | Description |
|---|---|
price | Price between 0 and 1 |
size | Number of contracts |
postOnly | Optional. When true, the order is rejected if it would immediately match against existing orders. Guarantees maker-only execution. Default false. |
FAK (Fill-And-Kill)
Limit orders that useprice and size like GTC but only match immediately available liquidity. Any unmatched remainder is cancelled.
| Parameter | Description |
|---|---|
price | Price between 0 and 1 |
size | Number of contracts |
FOK (Fill-Or-Kill)
Market orders that execute immediately at the best available price or are cancelled entirely — no partial fills. Instead ofprice and size, FOK orders use makerAmount.
| Parameter | Description |
|---|---|
makerAmount | BUY: USDC amount to spend (e.g., 50 = spend $50 USDC). SELL: number of shares to sell (e.g., 18.64 = sell 18.64 shares). |
Reading sub-account data
Partners can read portfolio, order, and position data for their sub-accounts using thex-on-behalf-of header. This lets you show users their positions, trade history, and order status without requiring the sub-account to authenticate directly.
How it works
Add thex-on-behalf-of header with the sub-account’s profileId to any supported read endpoint. The response is exactly what the sub-account would see if they called the endpoint themselves.
Requirements
- Scope — your API token must include the
delegated_signingscope. - Ownership — the target profile must be a sub-account linked to your partner profile.
- Auth — use your existing HMAC flow (
lmts-api-key,lmts-signature,lmts-timestamp). Nothing new.
Supported endpoints
| Method | Path | Description |
|---|---|---|
| GET | /portfolio/positions | Sub-account’s current positions |
| GET | /portfolio/history | Sub-account’s trade history |
| GET | /markets/:slug/user-orders | Sub-account’s orders for a specific market |
| POST | /orders/status/batch | Batch order status check |
Without the header
If you omitx-on-behalf-of, these endpoints behave exactly as before — you read your own data. The header is purely additive.
Error responses
| Status | When |
|---|---|
200 | Success — data is for the target sub-account |
400 | Invalid header value or endpoint does not support delegation |
403 | Token lacks delegated_signing scope, or target profile is not your sub-account |
HMAC authentication
All day-to-day programmatic API calls use HMAC-SHA256 request signing. See the Authentication page for the signing protocol, canonical message format, and code examples.API endpoints
| Endpoint | Auth | Description |
|---|---|---|
GET /auth/api-tokens/capabilities | Privy | Check partner capability configuration |
POST /auth/api-tokens/derive | Privy | Create a scoped API token |
GET /auth/api-tokens | Any | List active tokens |
DELETE /auth/api-tokens/{tokenId} | Any | Revoke a token |
POST /profiles/partner-accounts | HMAC | Create a sub-account |
POST /orders | HMAC | Place orders (with optional delegated signing) |
GET /portfolio/positions | HMAC | Read positions (supports x-on-behalf-of for sub-accounts) |
GET /portfolio/history | HMAC | Read trade history (supports x-on-behalf-of for sub-accounts) |
GET /markets/:slug/user-orders | HMAC | Read user orders for a market (supports x-on-behalf-of for sub-accounts) |
POST /orders/status/batch | HMAC | Batch order status (supports x-on-behalf-of for sub-accounts) |
POST /portfolio/redeem | Any (apiToken, Privy, session) | Redeem resolved positions from a server wallet |
POST /portfolio/withdraw | Any (apiToken, Privy, session) | Withdraw ERC20 funds from a server wallet |
SDK support
All three official SDKs provide built-in support for the programmatic API:As of SDK v1.0.6, all three SDKs include helper methods for server wallet claim (
POST /portfolio/redeem) and withdrawal (POST /portfolio/withdraw).TypeScript
Client with hmacCredentials, ApiTokenService, PartnerAccountService, DelegatedOrderServicePython
Client with hmac_credentials, api_tokens, partner_accounts, delegated_ordersGo
Client with WithHMACCredentials, ApiTokens, PartnerAccounts, DelegatedOrders