Build Low-Latency, Real-Time Poker Analysis with the PokerAI Cache API
Read saved strategies across all three streets and show action frequencies as soon as they arrive. This real 200NL 3-bet hand takes you from coverage discovery through action and board changes to on-demand EV and equity.
/cache/query returns. Fetch /cache/ev or /cache/eq only when the user opens the corresponding panel, so they can explore the strategy while a metric loads.When to use the Cache API
Use this workflow when you want to display strategy across all three streets. For a fully presolved spot, flop, turn and river are solved together in one postflop game tree. The API reads nodes from that same solution as the board and action change, preserving its equilibrium consistency across streets. The Nash approximation is bounded by the original ranges, stacks, bet tree and solver precision.
Strategy and standalone EV or equity requests require Builder or Pro. Any valid API key can check coverage for free. Only some spots are currently cached. Coverage lists available spot roots. The strategy response tells you whether a particular action or runout is available.
Quick facts: a 200NL 3-bet hand
This hand uses the 6max_RC_100bb_200NL preflop pack. MP opens, SB 3-bets and holds A♥K♥. The flop is 4♣8♦9♥, with 19 BB in the pot and 91 BB effective behind.
| Street and board | Action | Next |
|---|---|---|
| Flop4♣ 8♦ 9♥ | SB bets 13 BB MP calls | Deal A♠ |
| TurnA♠ | SB bets 14 BB MP calls | Deal 7♦ |
| River7♦ | SB bets 22 BB MP calls | Showdown |
Follow the bets of 13, 14 and 22 BB, with MP calling each one. A♥K♥ checks most of the time on the river. Here we'll follow the less frequent 22 BB branch through to showdown.
Find a covered spot
Send the preflop pack and flop to /cache/coverage to see which spots already have saved strategies. Any valid API key can use the directory. It consumes zero presolved, solve or cache queries.
curl -G 'https://pokerai.bet/v1/gto/postflop/cache/coverage' \
-H "Authorization: Bearer $POKERAI_API_KEY" \
--data-urlencode 'preflop_pack=6max_RC_100bb_200NL' \
--data-urlencode 'board=4c8d9h' \
--data-urlencode 'limit=200'
Both preflop_pack and board are required. The directory returned the following item for this hand. Original capture, including the directory response.
{
"preflop_pack": "6max_RC_100bb_200NL",
"board": "4c8d9h",
"pot_type": "3BET",
"positions": {"raiser": "MP", "three_bettor": "SB", "hero": "SB"}
}
When the user picks “MP opens · SB 3-bets”, pass those fields into the strategy root request. Keep the same pack and board when paging, and pass next_cursor unchanged as cursor. An empty items array can still have a next page. Stop at next_cursor: null. If the directory has no match, show that the spot has no saved strategy and let the user explicitly choose whether to run a solve.
Load the flop strategy
Call /cache/query from your backend and keep the API key there. Use hole_cards: "AhKh" to read the strategy for A♥K♥.
- 1. Find a covered spot
/cache/coverageFree directory lookup - 2. Load and show strategy
/cache/queryOne query for the root and each new card. Ordinary actions are free. - 3. Fetch metrics on demand
/cache/evor/cache/eqOne query for each admitted request
Opening the strategy root uses one cache query.
POST /v1/gto/postflop/cache/query
{
"preflop_pack": "6max_RC_100bb_200NL",
"board": "4c8d9h",
"pot_type": "3BET",
"positions": {"hero": "SB", "raiser": "MP", "three_bettor": "SB"},
"hole_cards": "AhKh"
}
Render strategy and keep the returned token. The response's node: "root" can label the path in your UI. To continue, put the relevant token in the next request's node field. If you already loaded the full range matrix, changing hole cards can use the corresponding row immediately. Fetch again when the action node or board changes.
Follow the action to turn and river
With A♥K♥, SB bets 13 BB about 69.02% of the time on the flop. After MP calls and A♠ lands, SB bets 14 BB 77.65% of the time. MP calls again. On 7♦, SB checks 88.63% of the time, and we'll follow the 22 BB bet (10.20%) and call.
- Check 23.53%
- Bet 6 BB 7.45%
- Bet 13 BB 69.02%
- All-in 0.00%
- Check 1.96%
- Bet 14 BB 77.65%
- Bet 31 BB 20.39%
- All-in 0.00%
- Check 88.63%
- Bet 22 BB 10.20%
- All-in 1.18%
For a bet or call, send a cached child's token as node. At a chance node, send its token with turn_card or river_card. The snippet's query helper wraps /cache/query. Full Node.js example with authentication and error handling.
const opponent = await query("flop-bet", {
node: cachedAction(flop, "bet", 13),
});
const chance = await query("flop-call", {
node: cachedAction(opponent, "call"),
});
const turn = await query("turn-deal", {
node: chance.token,
turn_card: "As",
hole_cards: "AhKh",
});
The bet and call reads are free with a valid token. Each new turn or river card uses one cache query. Keep the action path so users can return to a node they've already viewed.
Fetch EV and equity on demand
Fetch action expected values via /cache/ev and hand equity via /cache/eq. Each takes the current action node's token and a specific hand. The token resolves the pack, board and ranges.
const hand = { node: flop.token, hole_cards: "AhKh" };
const ev = await http("flop-ev", "/v1/gto/postflop/cache/ev", hand);
const actionValues = ev.ev.status === "ok" ? ev.ev.action_values : null;
const eq = await http("flop-eq", "/v1/gto/postflop/cache/eq", hand);
const equityPercent = eq.eq.status === "ok" ? eq.eq.value * 100 : null;
/cache/query returns strategy. The old include_ev:true and include_eq:true flags return HTTP 400 without charging or starting a calculation. Omit them or leave them false in an older client.
EV is the net value under the saved strategy in BB. EQ uses the current board and the opponent's saved flop root range, which is held fixed as you follow the action.
| Node and preceding action | A♥K♥ combo EV | EQ |
|---|---|---|
| Flop 4♣8♦9♥ (earlier run) | −6.4512 BB | 44.5677% |
| Turn A♠ (13 BB bet and call) | 18.8904 BB | 83.2143% |
| River 7♦ (then 14 BB bet and call) | 5.3115 BB | 73.4660% (recheck) |
Use the EV response's action_values to compare actions at the same node. Measured metric responses.
Response time and quota
In the same flop run, strategy returned in 4.425 s, EV in 14.184 s and EQ in 8.566 s. On the river recheck, the deal returned strategy in 1.319 s, while EQ took 6.827 s. Render the action frequencies as soon as they arrive. Start the separate EV or EQ request when a user opens that panel.
| Request | Time | Run | |
|---|---|---|---|
| Flop4♣ 8♦ 9♥ | |||
| Strategy · root | 4.425 s | A | |
| EV | 14.184 s | A | |
| EQ | 8.566 s | A | |
| TurnA♠ | |||
| Strategy · deal | 1.348 s | B | |
| EV | 6.983 s | B | |
| EQ | 6.482 s | B | |
| River7♦ | |||
| Strategy · deal | 1.319 s | C | |
| EV | 6.519 s | B | |
| EQ | 6.827 s | C | |
Each bar is one successful public HTTPS request, measured through the end of the response. Times vary by node and service conditions.
| API action | Cache queries used |
|---|---|
Browse /cache/coverage |
0 |
Open a strategy root with /cache/query |
1 |
| Follow an ordinary action node with a valid token | 0 |
Deal a new turn or river card with /cache/query |
1 per request |
| Submit an admitted EV or EQ request | 1 per request |
Strategy across all three streets uses three cache queries. Adding EV and EQ at all three brings the total to nine. The river recheck used four including its single EQ request. The preceding turn call read took 1.317 s and used zero.
Invalid input, expired tokens and other pre-admission rejections use no quota. An error can arrive after a charge. Check cache_quota if present and avoid automatic retries. A resubmission counts as a new request.
Run the complete example
Store the positions, hand, board and action path together. Give EV and EQ their own loading and error states so the strategy stays usable if a metric is unavailable.
Download the Node.js example. It finds the spot, follows the three bets and calls to showdown, and then reads each street's EV and EQ. With one coverage page and all requests succeeding, it makes 16 requests and uses nine cache queries.
A live run requires a Builder or Pro API key and uses that account's quota. The script stops on an error and keeps previously printed results.
export POKERAI_API_KEY='YOUR_SERVER_API_KEY'
node reproduce.mjs
Production measurements and reuse
These samples were collected on November 18, 2026. The original bet-and-call capture had 13 successful requests and one River EQ HTTP 503. In the later recheck with fresh tokens on the same path, all eight requests succeeded. The flop root, each new card and River EQ used one query apiece.
- Flop measurements and their metric responses
- Original bet-and-call request and response excerpts
- Eight River EQ recheck request and response excerpts
When citing a measurement, include the pack, board, action path, date and timing method. These are individual observed requests. This workflow is for training, research and post-session review. Real-time assistance at real-money tables is prohibited.
API docs · API reference · OpenAPI · llms.txt
Continue with the live solver when a spot is missing
If a spot has no cached result, you are on Free or Starter, or you want to change the later-street ranges or sizes, start with the presolved flop and solve the later streets as needed.
Build low-latency poker analysis with presolved data and the live solver. The companion guide uses the same 200NL 3-bet hand to show how to carry both ranges forward and display the turn and river strategies.