On this site
POST /v1/strategy
Send the real table and get a decision: the solver tree answers when the spot fits it, the fallback engine answers otherwise.
Who answers
You send the whole hand: real stacks, real bet sizes, the preflop summary and, if you have them, the tree coordinates (situation, position, node). The API picks who decides:
- The solver tree (engine: gtokiller) when the spot really is the tree's spot: tree coordinates sent, heads-up, the preflop scenario, positions and aggressor match the tree pair, the node line matches your history (streets, board cards, number and type of actions, all-ins) and the hero is the player to act. data is exactly what GET /v1/strategy returns for the same coordinates
- The fallback engine (engine: fallback) in every other case: multiway, heads-up tables, limped or 4-bet pots, no node, a line or size the tree does not hold, a hand outside the range, any preflop decision. It decides with your real table, not with the tree's fixed pot and stacks
Both answer with the tree shape (data.actions[] with frequencies and data.context) plus engine. The X-Engine and X-Fallback-Reason headers say who answered and why. With node: "auto" the API finds the tree node from your hand; without node, the engine answers.
Four body shapes
The server picks the shape from the body itself:
- With flop: a postflop decision. Stacks when the flop opened, initial_pot_bb, the preflop summary, the flop, turn and river history and, optionally, the tree coordinates
- Without flop: a preflop decision. Stacks at the start of the hand and the preflop history without the blinds (they come from the sb and bb positions). Always answered by the engine
- With discovery: true: the structure of a tree node, no table and no hand. Same response as GET /v1/strategy?discovery=true and free of charge
- With actions: the full hand in big blinds. Every seat, the button and every action since the deal; the API works out positions, pot, who is still in and the preflop summary, and answers as with the other shapes
Postflop body
JSON, at most 32 KiB. The schema is strict: an unknown key answers 422 validation_error.
| Parameter | Type | Description |
|---|---|---|
platformRequired | string | Pool or site identifier (e.g. gg). Same rules as in GET |
stakesRequired | string | <sb>_<bb> (e.g. 10_50). Must be in your stake allowlist or the request answers 403 stake_not_allowed |
player_type | "regs" | "fish" | regs (default) or fish. Note the snake case: the GET query parameter is playerType |
flopRequired | string | 3 cards as 6 chars, any suit order (e.g. AsKcQd) |
turn | string | Turn card, 2 chars |
river | string | River card, 2 chars. Requires turn |
handRequired | string | Hero's combo, 4 chars. No card may repeat between hand and board |
hero_seatRequired | int 0..9 | Hero's seat. Must be in players and still in the hand |
initial_pot_bbRequired | number > 0 | Pot in BB when the flop opened |
players[]Required | array 2..10 | Each player: seat (0 to 9), position, stack_bb when the flop opened and an optional in_hand (false for a player no longer in the hand). Position is the one our preflop answer gave that seat (context.players of the preflop response): positions are decided once, by the engine, on the preflop call, and every later street uses them. Without a preflop call, name the seats as your room does (utg, hj, co, btn, sb, bb...). Distinct seats, at least 2 in the hand, listed in postflop acting order |
history[]Required | array 0..200 | Flop, turn and river actions so far, in order: street, seat, kind (check, call, fold, bet, raise) and amount_bb on bet and raise. Empty at the first flop decision |
preflop | object | How the pot got to the flop: aggressor_seat, raises, callers, limpers, scenario (limped, iso, srp, 3bet, 4bet, 5bet), open_size_bb, last_raise_to_bb, squeeze. The tree needs it to answer; without scenario it is derived from raises and limpers |
situation | string | Tree coordinate, as in GET (srp, 3bet...). With a node path, situation, position and node go together or not at all. With node: "auto" they are optional (situation and position together): the API derives them from preflop and the seats |
position | string | Tree pair <aggressor>_<caller> (e.g. btn_bb), as in GET |
node | string | "auto" (recommended) or a tree node path. With "auto" the API walks the tree with your history: each real bet or raise maps to the nearest tree size when it is within 0.08 of the pot (compared as a fraction of the pot on each side) and otherwise to one of the two neighbouring tree sizes; an all-in, or an opponent's bet or raise of 85% or more of the effective stack, maps to the tree all-in; the node found comes back as node_id. A node path goes in the suit basis of your flop, already fitted to the tree sizes. Max 200 chars |
verbosity | "brief" | "full" | brief (default) or full. Same meaning as in GET |
audit | boolean | true adds the audit block: who answered, why and which checks failed |
hand_id | string | Your hand identifier for tracing, 1 to 128 chars. Not echoed |
curl -X POST 'https://api.gtokiller.com/v1/strategy' \
-H "X-API-Key: $GTOKILLER_KEY" \
-H 'Content-Type: application/json' \
-d '{
"platform": "gg",
"stakes": "10_50",
"node": "auto",
"flop": "AsKcQd",
"hand": "QhJc",
"hero_seat": 1,
"initial_pot_bb": 5.5,
"players": [
{ "seat": 1, "position": "bb", "stack_bb": 97.5 },
{ "seat": 6, "position": "btn", "stack_bb": 97.5 }
],
"history": [],
"preflop": { "aggressor_seat": 6, "raises": 1 }
}'Preflop body
Same as the postflop body without flop, turn, river, initial_pot_bb, preflop, situation, position and node. Always answered by the engine. The fields that change:
| Parameter | Type | Description |
|---|---|---|
players[]Required | array 2..10 | seat, position and stack_bb at the START of the hand (greater than 0). No in_hand: folds go in history |
history[]Required | array 0..200 | Preflop actions so far, in order and without the blinds: seat, kind (fold, check, call, raise) and amount_bb on raise, as the raise-to total. street is optional and only accepts preflop |
ante_bb | number | Ante per player in BB, if the table plays with antes |
posts[] | array 0..20 | Optional. Blinds beyond the small and big blind, each { seat, amount_bb, live }. live (the default) is a big blind posted out of turn by a player joining the table, who keeps the option to check; live: false is a dead blind that goes to the pot |
Full-hand body
Send what you see at the table, in big blinds, and the API works out everything the other shapes ask you to compute: positions, pot, who is still in, whose turn it is and the preflop summary. It is recognized by the actions field. The other shapes keep working.
| Parameter | Type | Description |
|---|---|---|
players[]Required | array 2..10 | Every occupied seat: seat, stack_bb at the start of the hand (before blinds and antes) and has_cards (true dealt, false sitting out; absent or null means unknown and counts as dealt). stack_bb is required unless has_cards is false |
button_seatRequired | int 0..9 | Seat of the dealer button as shown at the table. It may be an empty seat |
actions[]Required | array 0..300 | Everything since the deal, in order, each with street and seat: blinds (post_sb, post_bb, post for a dead blind, post_ante) and decisions (fold, check, call, bet, raise). A big blind posted out of turn by a player joining the table is a post_bb from that seat. Up to 300, at most 200 of them decisions |
actions[].amount_bb | number | On bet, raise and call: the player's total on the street after the action (raise-to). On blinds: the amount posted. all_in is optional |
flop, turn, river | string | flop, turn and river up to the street of the decision. Without flop, it is a preflop decision |
ante_bb | number | Ante per dealt seat in BB, if the table plays with antes |
pot_bb | number | Optional check: the pot in the middle at the start of the current street, without the bets of this street. If it does not match, a warning is returned; it never blocks the answer |
hand, hero_seat, hand_id, platform, stakes, player_type, coverage, verbosity, audit | | Work as in the other shapes |
curl -X POST 'https://api.gtokiller.com/v1/strategy' \
-H "X-API-Key: $GTOKILLER_KEY" \
-H 'Content-Type: application/json' \
-d '{
"platform": "gg",
"stakes": "10_50",
"hand": "AhKd",
"hero_seat": 6,
"button_seat": 4,
"players": [
{ "seat": 1, "stack_bb": 100 }, { "seat": 2, "stack_bb": 100 }, { "seat": 3, "stack_bb": 100 },
{ "seat": 4, "stack_bb": 100 }, { "seat": 5, "stack_bb": 100 }, { "seat": 6, "stack_bb": 100 }
],
"actions": [
{ "street": "preflop", "seat": 5, "kind": "post_sb", "amount_bb": 0.5 },
{ "street": "preflop", "seat": 6, "kind": "post_bb", "amount_bb": 1 },
{ "street": "preflop", "seat": 1, "kind": "fold" },
{ "street": "preflop", "seat": 2, "kind": "raise", "amount_bb": 2.5 },
{ "street": "preflop", "seat": 3, "kind": "fold" },
{ "street": "preflop", "seat": 4, "kind": "call" },
{ "street": "preflop", "seat": 5, "kind": "fold" }
]
}'With audit: true, the response adds audit.replay: the position the API gave each dealt seat, the pot at the start of the street, the preflop summary, the result of the pot_bb check, the warnings and the hand in one line.
{
"data": { "context": { "street": "preflop", "pot_bb": 6.5, "to_call_bb": 1.5, "hero_position": "BB" }, "actions": [ ... ] },
"engine": "fallback",
"engine_version": "abc1234",
"audit": {
"replay": {
"format": "hand",
"positions": { "1": "UTG", "2": "HJ", "3": "CO", "4": "BTN", "5": "SB", "6": "BB" },
"dealt": [1, 2, 3, 4, 5, 6],
"round_start_pot_bb": 0,
"line": "UTG F · HJ R2.5 · CO F · BTN C · SB F · BB ?",
"warnings": [],
"repair_count": 0
}
}
}Discovery body
discovery: true plus platform, stakes, player_type, situation, position, flop, turn, river and node (no table, no hand). The response is the same flat body as GET /v1/strategy?discovery=true. Free: it does not count against the monthly quota or the hard cap; the per-second limit still applies.
Response
Always the tree shape. Postflop, the engine returns ONE action at frequency 1; preflop it returns its mix. With verbosity full and three or more players in the hand, the engine context carries format: multiway and players instead of stacks_bb and positions.
{
"data": {
"context": { "round_start_pot_bb": 5.5, "to_act": "oop" },
"actions": [
{ "type": "check", "node_token": "x", "frequency": 0.62 },
{ "type": "bet", "node_token": "b1.82", "frequency": 0.38, "amount": 1.82, "pot_pct": 0.33 }
]
},
"node_id": "root",
"source": "custom",
"engine": "gtokiller"
}{
"data": {
"context": {
"street": "flop",
"hand": "AhKd",
"board": ["9h", "7d", "2c"],
"round_start_pot_bb": 8,
"spr": 12.19,
"to_act": "oop",
"format": "multiway",
"players_in_hand": 3,
"hero_position": "co",
"players": [
{ "seat": 1, "position": "bb", "stack_bb": 97.5 },
{ "seat": 3, "position": "co", "stack_bb": 97.5 },
{ "seat": 6, "position": "btn", "stack_bb": 120 }
]
},
"actions": [
{ "type": "bet", "node_token": "b2.64", "frequency": 1, "amount": 2.64, "pot_pct": 0.33 }
]
},
"engine": "fallback",
"engine_version": "abc1234"
}{
"data": {
"context": {
"street": "preflop", "pot_bb": 4, "to_call_bb": 1.5, "hero_position": "BB",
"players": [
{ "seat": 1, "position": "UTG" }, { "seat": 2, "position": "HJ" }, { "seat": 3, "position": "CO" },
{ "seat": 4, "position": "BTN" }, { "seat": 5, "position": "SB" }, { "seat": 6, "position": "BB" }
]
},
"actions": [
{ "type": "fold", "node_token": "f", "frequency": 0.25 },
{ "type": "call", "node_token": "c", "frequency": 0.5, "amount": 1.5 },
{ "type": "raise", "node_token": "r11", "frequency": 0.25, "amount": 11 }
]
},
"engine": "fallback",
"engine_version": "abc1234"
}- engine: gtokiller (solver tree) or fallback (engine). Same value as the X-Engine header. Absent on discovery
- data.actions[]: same fields as in GET (type, node_token, frequency, amount, pot_pct, and raise_ratio in full). The engine keys an all-in raise over a bet as b<total>, like the tree, so node_id + "-" + node_token stays a valid child
- data.context: brief carries round_start_pot_bb and to_act; preflop it carries street, pot_bb, to_call_bb, hero_position and players, the position our engine gave each player of your request (uppercase, in your order). Full carries the GET context heads-up, the multiway context with three or more players, and adds effective_stack_bb and players_in_hand preflop
- node_id: always on tree answers. On engine answers it echoes your node, except when node is missing or does not match your history (no_node, line_mismatch, street_mismatch, board_card_mismatch, allin_mismatch, hero_not_to_act, heads_up_table): then it is absent, so you never append a token to a node that is not your hand
- source: tree answers only (custom or v1). engine_version: engine answers only; quote it with X-Request-ID when you report a decision
- audit (with audit: true): request_id, coverage (covered or fallback), coverage_reason (null when the tree answered), fallback_triggers and shadow_triggers, each a list of { rule, detail } with the real and tree figures compared, and on preflop answers preflop: { level, spot } (level 1 = your custom trees' ranges, 2 = 6-max GTO tree, 3 = heuristic engine), and with node: "auto" node_derivation: { situation, position, node, steps, reason }, each step with the real amount, the tree token it mapped to and the drift. Ignore keys you do not know: the block can grow
Fallback reasons
When the engine answers, X-Fallback-Reason and audit.coverage_reason carry the reason. The list can grow: treat an unknown value as a generic engine decision. Checks in observation are measured and reported in audit.shadow_triggers but never send the request to the engine.
| Reason | Status | Meaning |
|---|---|---|
street_preflop | active | Preflop body: the tree starts on the flop |
no_node | active | No tree coordinates in the body |
spot_not_configured | active | The situation and position pair is not served |
heads_up_table | active | The two players in the hand are the SB and the BB and the BB acts first after the flop: only possible at a table where two players were dealt in, which the 6-max trees do not serve |
not_heads_up | active | More than two players in the hand, or a fold in history |
preflop_missing | active | No preflop summary |
scenario_mismatch | active | The preflop scenario is not the tree's situation |
position_mismatch | active | The two live seats are not the pair in position |
aggressor_mismatch | active | The preflop aggressor is not the first seat of the pair |
street_mismatch | active | The node street is not the board street |
board_card_mismatch | active | A turn or river card in node is not the board card |
line_mismatch | active | node and history differ in number, order or type of actions |
allin_mismatch | active | All-in on one side only (tree or table) |
hero_not_to_act | active | The hero is not the player to act at node |
pot_ratio_out_of_band | active | The real pot at the start of the decision street is below 0.55× or above 1.8× the tree pot |
spr_out_of_window | active | The real flop SPR (effective stack / pot) is outside the tree's window: the SPR of a hand starting with 80 and with 130 BB that plays the tree's preflop line |
*_drift | observation | pot_drift, stack_drift, size_drift, pot_at_node_drift: real pot, effective stack, a bet size or the pot at the node too far from the tree's |
flop_not_covered, line_not_in_tree, off_tree_sizing, illegal_action, unknown | active | The tree has no node for that line. Same meanings as the 404 reason |
size_off_tree | active | node: "auto" only: the tree has no bet or raise of that kind at that node (a lead where the tree only checks, a non-all-in raise where it only has all-in, or an opponent's near all-in, 85% or more of the effective stack, where it has no all-in) |
size_out_of_range | active | node: "auto" only: a real bet or raise is more than 2× the largest tree size at that node, or less than half the smallest. Bets compare overbets only with overbets and the rest only with the rest |
action_not_in_tree, node_not_in_tree, street_closed, tree_unavailable | active | node: "auto" only: a check or call the tree does not offer there, a line the tree does not continue, a street already closed with no next card, or the tree could not be read |
combo_not_in_range | active | The node exists but your hand is not in the range there |
malformed_node | active | The tree node could not be read |
Response headers
The same headers as GET /v1/strategy (X-Request-ID, rate limit, HSTS), plus:
| Header | Value | Description |
|---|---|---|
X-Engine | gtokiller | fallback | Who answered. On decisions only, not on discovery |
X-Fallback-Reason | string | Only when X-Engine is fallback: why the tree did not answer (table above) |
X-Cache | HIT | MISS | Tree answers: HIT when the node came from the in-memory cache. Engine answers: always MISS |
Server-Timing | metrics | The GET stages plus tree_match (the fit checks) and fallback (the engine call). 200 responses only |
Billing and quota
One call per postflop 200, whoever decided. Preflop decisions (no flop) and discovery are free: they do not count against the monthly quota or the hard cap. 422 no_decision and 503 fallback_unavailable are not billed. Rate limits are the same as for GET.
Errors
A postflop body never gets a 404 for a node the tree lacks: the engine answers instead. The only 404 is a line with nothing left to decide: reason terminal (the hand is over) or street_closed (append the next card). Discovery keeps the full 404 taxonomy. Specific to POST: 422 no_decision (the engine replayed your table and found no decision: impossible line, repeated card or no legal action for the hero; fix the state you send) and 503 fallback_unavailable (the tree could not answer and the engine did not respond; retry or use a local fallback). Plus the usual 401, 403, 422 validation_error and 429.