{"openapi":"3.1.0","info":{"title":"Layer","version":"0","description":"The same prediction market across Kalshi, Polymarket, Polymarket US, Hyperliquid and Novig, and the trade between them after fees.","x-guidance":"Layer matches the same prediction market across Kalshi, Polymarket (polymarket.com), Polymarket US, Hyperliquid and Novig, and prices the trade between them after both venues' fees. Pay per call with x402 (USDC on Base); a 400 costs nothing. Start with GET /v0/matches (filter with q, category, from, to) to see what's matched, or GET /v0/match with venue and market_id for one market you already know: Kalshi takes the market ticker, Polymarket the conditionId or slug, Polymarket US the slug. Use POST /v0/profit and POST /v0/size with prices and order books you read from the venues. Full reference: https://uselayer.sh/docs/api. A free API key (https://uselayer.sh/dashboard) skips payment.","contact":{"name":"Layer","email":"david@uselayer.sh","url":"https://uselayer.sh"}},"servers":[{"url":"https://uselayer.sh"}],"paths":{"/v0/match":{"get":{"operationId":"getMatch","summary":"Find a prediction market's twin on another venue","description":"Find the same prediction market on another venue (Kalshi, Polymarket, Polymarket US, Hyperliquid, Novig): its twin, how confident the match is, and both venues' live prices.","tags":["layer"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"example":{"source_market":{"venue":"polymarket_us","market_id":"aec-nba-lal-bos-2026-11-08"},"matched_market":{"venue":"kalshi","market_id":"KXNBAGAME-26NOV08LALBOS-LAL"},"side":"same","tier":"human_verified","confidence":1,"prices":{"as_of":"2026-11-07T18:00:00Z","kalshi":{"yes":{"bid":{"price":0.41,"size":300},"ask":{"price":0.42,"size":120}}},"polymarket_us":{"yes":{"bid":{"price":0.43,"size":80},"ask":{"price":0.44,"size":200}}}},"checked_at":"2026-11-07T18:00:00Z"}}}},"400":{"description":"The request couldn't be read; detail says why. Not charged."},"402":{"description":"Payment required: the x402 PAYMENT-REQUIRED header carries the price."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]},"parameters":[{"name":"venue","in":"query","required":true,"schema":{"type":"string","enum":["kalshi","polymarket","polymarket_us","hyperliquid","novig"]}},{"name":"market_id","in":"query","required":true,"schema":{"type":"string"},"description":"The market's id on that venue (Kalshi ticker, Polymarket conditionId or slug, ...)"},{"name":"with","in":"query","required":false,"schema":{"type":"string"},"description":"For a Kalshi market: which venue to find its twin on"},{"name":"prices","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}]},"post":{"operationId":"postMatch","summary":"Find twins for up to 50 markets","description":"The same cross-venue lookup for up to 50 prediction markets in one call.","tags":["layer"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"example":{"results":[{"source_market":{"venue":"polymarket_us","market_id":"aec-nba-lal-bos-2026-11-08"},"matched_market":{"venue":"kalshi","market_id":"KXNBAGAME-26NOV08LALBOS-LAL"},"side":"same","tier":"human_verified","confidence":1,"prices":{"as_of":"2026-11-07T18:00:00Z","kalshi":{"yes":{"bid":{"price":0.41,"size":300},"ask":{"price":0.42,"size":120}}},"polymarket_us":{"yes":{"bid":{"price":0.43,"size":80},"ask":{"price":0.44,"size":200}}}},"checked_at":"2026-11-07T18:00:00Z"}]}}}},"400":{"description":"The request couldn't be read; detail says why. Not charged."},"402":{"description":"Payment required: the x402 PAYMENT-REQUIRED header carries the price."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.25"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"markets":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"venue":{"type":"string"},"market_id":{"type":"string"},"with":{"type":"string"}},"required":["venue","market_id"]}}},"required":["markets"]},"example":{"markets":[{"venue":"kalshi","market_id":"KXNBAGAME-26NOV08LALBOS-LAL"}]}}}}}},"/v0/matches":{"get":{"operationId":"getMatches","summary":"List every live cross-venue match with prices","description":"Every live prediction-market pair Layer has matched across Kalshi and Polymarket/Polymarket US/Hyperliquid/Novig, soonest event first, with live prices and the best trade between them.","tags":["layer"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"example":{"count":1,"total":1,"limit":50,"offset":0,"has_more":false,"next_offset":null,"matches":[{"kalshi":{"venue":"kalshi","market_id":"KXNBAGAME-26NOV08LALBOS-LAL"},"polymarket_us":{"venue":"polymarket_us","market_id":"aec-nba-lal-bos-2026-11-08"},"tier":"human_verified","confidence":1}]}}}},"400":{"description":"The request couldn't be read; detail says why. Not charged."},"402":{"description":"Payment required: the x402 PAYMENT-REQUIRED header carries the price."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.10"},"protocols":[{"x402":{}}]},"parameters":[{"name":"venue","in":"query","required":false,"schema":{"type":"string","enum":["polymarket_us","polymarket","hyperliquid","novig"]}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Words to search for in the market title"},{"name":"series","in":"query","required":false,"schema":{"type":"string"},"description":"Kalshi series, comma-separated, e.g. KXBTC15M,KXETH15M"},{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"YYYY-MM-DD"},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"YYYY-MM-DD"},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"1-200"},{"name":"offset","in":"query","required":false,"schema":{"type":"string"},"description":"Send next_offset from the last page"}]}},"/v0/settlements":{"get":{"operationId":"getSettlements","summary":"How matched pairs settled on both venues","description":"Layer's track record: how every matched pair settled on both venues, and whether they agreed.","tags":["layer"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"example":{"settlements":[]}}}},"400":{"description":"The request couldn't be read; detail says why. Not charged."},"402":{"description":"Payment required: the x402 PAYMENT-REQUIRED header carries the price."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.05"},"protocols":[{"x402":{}}]},"parameters":[{"name":"venue","in":"query","required":false,"schema":{"type":"string"}},{"name":"since","in":"query","required":false,"schema":{"type":"string"},"description":"YYYY-MM-DD"},{"name":"outcome","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}]}},"/v0/profit":{"post":{"operationId":"postProfit","summary":"Profit after fees for a Kalshi-vs-Polymarket trade","description":"Is buying YES on Kalshi and NO on Polymarket (or the reverse) profitable after both venues' fees? Send the prices; Layer applies each venue's official fee schedule.","tags":["layer"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"example":{"cost":97,"fees":1.77,"payout":100,"net_profit":1.23,"return_pct":1.25,"profitable":true}}}},"400":{"description":"The request couldn't be read; detail says why. Not charged."},"402":{"description":"Payment required: the x402 PAYMENT-REQUIRED header carries the price."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contracts":{"type":"integer"},"kalshi":{"type":"object","properties":{"price":{"type":"number"},"market_id":{"type":"string"}},"required":["price"]},"polymarket":{"type":"object","properties":{"price":{"type":"number"},"fee_rate":{"type":"number"},"category":{"type":"string"}}},"polymarket_us":{"type":"object","properties":{"price":{"type":"number"}}}},"required":["contracts","kalshi"]},"example":{"contracts":100,"kalshi":{"price":0.42},"polymarket":{"price":0.55,"fee_rate":0.05}}}}}}},"/v0/quote":{"get":{"operationId":"getQuote","summary":"How much of a matched market you can trade after fees","description":"Send a Kalshi ticker: Layer reads the live order books on Kalshi and Polymarket US (or polymarket.com) and returns the most contracts that still clear your minimum edge after both venues' fees.","tags":["layer"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"example":{"contracts":100,"limited_by":"polymarket_us_book","edge_at_best":0.016,"net_profit":1.6,"profitable":true}}}},"400":{"description":"The request couldn't be read; detail says why. Not charged."},"402":{"description":"Payment required: the x402 PAYMENT-REQUIRED header carries the price."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]},"parameters":[{"name":"market_id","in":"query","required":true,"schema":{"type":"string"},"description":"The Kalshi ticker of a live match"},{"name":"venue","in":"query","required":false,"schema":{"type":"string","enum":["polymarket_us","polymarket"]}},{"name":"min_edge","in":"query","required":false,"schema":{"type":"string"},"description":"Smallest profit per contract after fees, in dollars"},{"name":"max_contracts","in":"query","required":false,"schema":{"type":"string"}}]}},"/v0/size":{"post":{"operationId":"postSize","summary":"Largest tradeable size that clears your edge after fees","description":"How many contracts of a Kalshi-vs-Polymarket gap you can actually trade: walks both order books you send and returns the largest size that clears your minimum edge after fees.","tags":["layer"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"example":{"contracts":100,"limited_by":"kalshi_book","edge_at_best":0.012,"net_profit":1.2,"profitable":true}}}},"400":{"description":"The request couldn't be read; detail says why. Not charged."},"402":{"description":"Payment required: the x402 PAYMENT-REQUIRED header carries the price."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"min_edge":{"type":"number"},"kalshi":{"type":"object","properties":{"asks":{"type":"array"}},"required":["asks"]},"polymarket":{"type":"object","properties":{"asks":{"type":"array"}}},"polymarket_us":{"type":"object","properties":{"asks":{"type":"array"}}}},"required":["kalshi"]},"example":{"min_edge":0.01,"kalshi":{"asks":[{"price":0.42,"size":100}]},"polymarket_us":{"asks":[{"price":0.53,"size":150}]}}}}}}}}}