API Reference
The base URL is https://api.inklemarket.com. Every response is wrapped in an envelope, so your payload always lives under data.
Interactive Swagger / OpenAPI
Explore and try every endpoint in the interactive Swagger UI, or feed the machine-readable OpenAPI spec to a client generator:
- Swagger UI: api.inklemarket.com/v1/docs
- OpenAPI 3.0 spec (JSON): api.inklemarket.com/v1/docs-json
Generate a client in any language straight from the spec:
npx @openapitools/openapi-generator-cli generate \ -i https://api.inklemarket.com/v1/docs-json \ -g typescript-fetch -o ./inkle-client
Response envelope
Success and failure share the same shape:
// success
{ "status": "SUCCESS", "data": { "id": "…" } }
// failure
{ "status": "FAIL", "errorCode": "…", "error": "insufficient $USDI balance" }The error field carries a human-readable message. Match on the HTTP status for programmatic handling (see error codes).
Markets (public read)
/v1/usdi/market?status=open&limit=5PublicList markets. Filters: status (open/closed/resolved/void), kind (flash/pvp_lmsr/pvp_direct), page, limit (max 100).
Response
{
"status": "SUCCESS",
"data": {
"items": [
{
"id": "5605577f-1af3-41ab-904d-ca3ca1c8926c",
"kind": "pvp_lmsr",
"question": "Will BTC close above $100k in July?",
"status": "open",
"outcomeLabels": ["Yes", "No"],
"closesAt": "2026-08-01T00:00:00.000Z",
"totalPool": 259.94,
"betCount": 8,
"lmsr": { "prices": [0.62, 0.38], "seed": 50, "alpha": 0.05 }
}
],
"count": 112,
"page": 1,
"limit": 5
}
}/v1/usdi/market/:idPublicFull market detail with per-outcome pools and live LMSR state.
Response
{
"status": "SUCCESS",
"data": {
"id": "5605577f-…",
"kind": "pvp_lmsr",
"question": "Will BTC close above $100k in July?",
"outcomes": [
{ "index": 0, "label": "Yes", "pool": 130, "impliedProbability": 0.62 },
{ "index": 1, "label": "No", "pool": 125, "impliedProbability": 0.38 }
],
"lmsr": { "prices": [0.62, 0.38], "qShares": [311.46, 233.79] }
}
}/v1/usdi/market/:id/lmsr-quote?outcomeIndex=0&collateral=10PublicPreview a trade before placing it. For a sell, pass side=sell&shares= instead of collateral.
Response
{
"status": "SUCCESS",
"data": {
"outcomeIndex": 0,
"collateral": 10,
"shares": 16.35,
"avgPrice": 0.6116,
"priceBefore": 0.60,
"priceAfter": 0.63
}
}/v1/usdi/market/:id/price-ticks?limit=200PublicFull-vector price history. Every outcome's price at each tick, oldest first.
Response
{
"status": "SUCCESS",
"data": {
"marketId": "5605577f-…",
"ticks": [
{ "ts": "2026-07-12T05:12:22Z", "prices": [0.53, 0.47], "outcomeIndex": null, "side": null },
{ "ts": "2026-07-12T05:13:02Z", "prices": [0.62, 0.38], "outcomeIndex": 0, "side": "buy", "execPrice": 0.58 }
]
}
}/v1/usdi/market/:id/bets?limit=20PublicRecent public trades with identity-safe user info.
Response
{
"status": "SUCCESS",
"data": [
{
"id": "27385e0a-…",
"outcomeIndex": 0,
"side": "buy",
"stake": 5,
"shares": 8.3,
"createdAt": "2026-07-12T05:13:02Z",
"user": { "displayName": "alice", "avatarUrl": null, "isTwitterVerified": true }
}
]
}Trading (API key with the trade scope)
/v1/usdi/market/pvp-lmsrAPI key · tradeCreate an open LS-LMSR pool that anyone can trade. Your seed becomes the pool's initial liquidity.
Request body
{
"question": "Will it rain in Seoul tomorrow?",
"outcomeLabels": ["Yes", "No"],
"closesAt": "2026-08-01T00:00:00Z",
"seed": 50
}Response
{
"status": "SUCCESS",
"data": { "id": "4a3af3ec-…", "kind": "pvp_lmsr", "status": "open" }
}/v1/usdi/market/pvp-directAPI key · tradeCreate a fixed-odds duel: you take one side, the field takes the other.
Request body
{
"question": "Will Team A win?",
"outcomeLabels": ["A", "B"],
"closesAt": "2026-08-01T00:00:00Z",
"creatorOutcome": 0,
"creatorStake": 20,
"creatorOdds": 2.0
}Response
{
"status": "SUCCESS",
"data": { "id": "…", "kind": "pvp_direct", "status": "open" }
}/v1/usdi/market/flashAPI key · tradeOpen a 10-minute UP/DOWN pool priced against a live Pyth feed.
Request body
{ "asset": "BTC" }Response
{
"status": "SUCCESS",
"data": { "id": "…", "kind": "flash", "asset": "BTC", "status": "open" }
}/v1/usdi/market/:id/betAPI key · tradeBuy outcome shares with $USDI. Debits your balance.
Request body
{ "outcomeIndex": 0, "stake": 5 }Response
{
"status": "SUCCESS",
"data": {
"id": "…", "outcomeIndex": 0, "side": "buy",
"stake": 5, "shares": 8.3, "costPaid": 5, "status": "active"
}
}/v1/usdi/market/:id/sellAPI key · tradeSell LMSR shares back to the pool for a $USDI refund.
Request body
{ "outcomeIndex": 0, "shares": 2.5 }Response
{
"status": "SUCCESS",
"data": { "id": "…", "side": "sell", "shares": 2.5, "costPaid": -1.4 }
}/v1/usdi/market/:id/my-betsAPI key · readYour positions on a market.
Response
{
"status": "SUCCESS",
"data": [
{ "id": "…", "outcomeIndex": 0, "side": "buy", "shares": 8.3, "status": "active" }
]
}Flash pools (on-chain, public read)
/v1/flashPublicList on-chain flash pools.
Response
{
"status": "SUCCESS",
"data": {
"items": [
{
"id": "e5fa00bd-…",
"asset": "BTC",
"status": "open",
"poolCap": 100,
"creatorSide": "up",
"basePrice": 64978.78,
"bettingEndsAt": "2026-07-12T05:20:00Z",
"betCount": 3,
"poolTokenSymbol": "USDC"
}
]
}
}/v1/flash/:idPublicPool detail.
Response
{
"status": "SUCCESS",
"data": {
"id": "e5fa00bd-…", "asset": "BTC", "status": "open",
"basePrice": 64978.78, "settlePrice": null, "poolCap": 100,
"creatorSide": "up", "betCount": 3, "poolTokenSymbol": "USDC"
}
}/v1/flash/:id/betsPublicRecent bets on a flash pool.
Response
{
"status": "SUCCESS",
"data": [{ "id": "…", "side": "down", "amount": 10, "createdAt": "2026-07-12T05:14:00Z" }]
}/v1/flash/:id/quote?amount=10PublicEstimated payout for a bet of the given size.
Response
{
"status": "SUCCESS",
"data": { "estPayout": 18.4, "probabilityAfter": 0.54 }
}/v1/flash/price/:assetPublicLive Pyth price for BTC / ETH / BNB / SOL.
Response
{ "status": "SUCCESS", "data": { "asset": "BTC", "price": 98450.12 } }Account (API key with the read scope)
/v1/user/meAPI key · readYour profile and identity.
Response
{
"status": "SUCCESS",
"data": { "id": 3, "walletAddress": "0xa77d…", "displayName": "alice" }
}Discovery (public read)
/v1/market/search?q=bitcoinPublicFull-text search across on-chain markets.
Response
{
"status": "SUCCESS",
"data": [
{
"id": "5605577f-…",
"topic": "Will BTC close above $100k in July?",
"category": "crypto",
"status": "active",
"outcomeCount": 2,
"totalPool": "500.00",
"deadline": "2026-07-19T14:59:00Z"
}
]
}/v1/market/trendingPublicMarkets ranked by recent activity.
Response
{
"status": "SUCCESS",
"data": [
{
"id": "7cc68e4b-…",
"topic": "Will the US confirm aliens exist before 2027?",
"category": "politics",
"status": "active",
"participantCount": 24,
"betCount": 61,
"deadline": "2027-02-26T14:59:00Z"
}
]
}/v1/leaderboard?rail=usdi&limit=50PublicTop users on one asset rail. Query: rail (usdi | onchain, defaults to onchain), sortBy (totalWon | winRate | roi | marketsCreated), limit (max 200). Each rail is its own board because USDC and $USDI are different currencies; amounts are denominated in the rail you asked for.
Response
{
"status": "SUCCESS",
"data": [
{
"rank": 1,
"id": "3",
"displayName": "Inkle Traders",
"walletAddress": "0xa77d…",
"totalWon": 467.34,
"winRate": 11.11,
"betsPlaced": 9,
"marketsCreated": 9
}
]
}Portfolio (API key with the read scope)
Portfolio responses span both rails. On-chain markets settle in USDC against a contract; $USDI markets settle on our off-chain ledger. Tell them apart by tokenSymbol, and note that the two are different currencies, so do not add their amounts together.
$USDI rows carry market.isUsdi: true and a null txHash, and no onChainId at all, since a ledger market has none. Winnings are credited to the ledger balance at settlement and come back with status: "claimed", so there is nothing to claim on-chain and no transaction to send. Filter by status=claimed to list $USDI wins; status=won covers on-chain wins awaiting a claim.
/v1/user/me/positionsAPI key · readYour open positions on both rails, aggregated per outcome with live mark-to-market P&L. Settled $USDI positions are not listed: the ledger pays them out at resolution, so they appear in the bet history instead.
Response
{
"status": "SUCCESS",
"data": [
{
"marketId": "170faa44-…",
"marketTopic": "Junwoo",
"marketStatus": "closed",
"tokenSymbol": "USDC",
"outcomeIndex": 1,
"outcomeLabel": "No",
"totalSharesBought": 4675.89,
"totalCost": 2500,
"avgCost": 0.5347,
"currentPrice": 0.5248,
"currentValue": 2453.75,
"unrealizedPnL": -46.25,
"unrealizedPnLPct": -1.85
},
{
"marketId": "6a129a59-…",
"marketTopic": "2026 World Cup Final: Spain vs Argentina",
"marketStatus": "active",
"tokenSymbol": "USDI",
"outcomeIndex": 0,
"outcomeLabel": "Spain",
"totalSharesBought": 164.24,
"totalCost": 70,
"avgCost": 0.4262,
"currentPrice": 0.3723,
"currentValue": 61.15,
"unrealizedPnL": -8.85,
"unrealizedPnLPct": -12.64
}
]
}/v1/user/me/betsAPI key · readYour bet history on both rails, newest first.
Response
{
"status": "SUCCESS",
"data": [
{
"id": "9c878f7c-…",
"marketId": "5605577f-…",
"outcomeIndex": 0,
"outcomeLabel": "Yes",
"amount": "17.55",
"tokenSymbol": "USDC",
"sharesBought": "-92.40",
"status": "confirmed",
"txHash": "0xc3a5f6…",
"createdAt": "2026-07-13T10:25:32Z"
},
{
"id": "6b2c1d90-…",
"marketId": "6a129a59-…",
"outcomeIndex": 0,
"outcomeLabel": "Spain",
"amount": "70.0000",
"tokenSymbol": "USDI",
"sharesBought": "164.2421426016",
"status": "claimed",
"payout": "164.2421",
"txHash": null,
"createdAt": "2026-07-19T21:14:08Z",
"market": { "isUsdi": true, "kind": "pvp_lmsr", "tokenSymbol": "USDI" }
}
]
}/v1/user/me/marketsAPI key · readMarkets you created on either rail.
Response
{
"status": "SUCCESS",
"data": [
{
"id": "5605577f-…",
"topic": "clever test",
"category": "crypto",
"status": "active",
"outcomeCount": 2,
"totalMarketSize": "500.00",
"deadline": "2026-07-19T14:59:00Z"
},
{
"id": "6a129a59-…",
"topic": "2026 World Cup Final: Spain vs Argentina",
"category": "sports",
"status": "resolved",
"tokenSymbol": "USDI",
"outcomeCount": 2,
"totalMarketSize": "5480.0000",
"deadline": "2026-07-19T22:00:00Z",
"isUsdi": true,
"kind": "pvp_lmsr"
}
]
}Key management (session only)
These need a signed-in web session, not an API key, so a key can never mint another key. Manage them under Settings > API Keys.
/v1/api-keysSession onlyCreate a key. The raw key is returned exactly once.
Request body
{ "name": "trading bot", "scopes": ["read", "trade"] }Response
{
"status": "SUCCESS",
"data": {
"id": "…", "name": "trading bot", "scopes": ["read", "trade"],
"key": "ik_live_ab12cd34ef56_…"
}
}/v1/api-keysSession onlyList your keys. Hashes never leave the server.
Response
{
"status": "SUCCESS",
"data": [
{
"id": "…", "name": "trading bot", "keyPreview": "ik_live_ab12cd34ef56_…",
"scopes": ["read", "trade"], "lastUsedAt": "2026-07-13T02:00:00Z",
"revokedAt": null, "createdAt": "2026-07-13T01:00:00Z"
}
]
}/v1/api-keys/:idSession onlyRevoke a key. Takes effect immediately.
Response
{ "status": "SUCCESS", "data": { "id": "…", "revokedAt": "2026-07-13T02:05:00Z" } }/v1/api-keys/:id/usageSession onlyTrading volume attributed to a key (builder program).
Response
{
"status": "SUCCESS",
"data": { "keyId": "…", "name": "trading bot", "attributedTrades": 42, "attributedVolumeUsdi": 1830.5 }
}