GTOkiller
  • Home
  • Solver
  • MDA
  • Pricing
  • Invite a Friend
  • Blog
On this site
GTOKiller API
v1
Getting started
  • Quickstart
  • Authentication
Core concepts
  • Inputs
  • node id
  • Outputs
  • Discovery mode
  • Stateless mode
Reference
  • POST /v1/strategy
  • GET /v1/strategy
  • GET /v1/health
  • Errors
Need a key?

Request a trial key on Discord.

GTOKiller API
v1
Getting started
  • Quickstart
  • Authentication
Core concepts
  • Inputs
  • node id
  • Outputs
  • Discovery mode
  • Stateless mode
Reference
  • POST /v1/strategy
  • GET /v1/strategy
  • GET /v1/health
  • Errors
Need a key?

Request a trial key on Discord.

  1. Docs
  2. Reference
  3. POST /v1/strategy

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.

POST/v1/strategyX-API-Key
The recommended way to ask for a decision
GET /v1/strategy keeps working exactly as before. New integrations should use this POST: you no longer have to fit every spot to the tree yourself, and multiway pots, limped pots, odd sizes and preflop decisions get an answer instead of a 404.

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.

ParameterTypeDescription
platformRequired
stringPool 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
string3 cards as 6 chars, any suit order (e.g. AsKcQd)
turn
stringTurn card, 2 chars
river
stringRiver card, 2 chars. Requires turn
handRequired
stringHero's combo, 4 chars. No card may repeat between hand and board
hero_seatRequired
int 0..9Hero's seat. Must be in players and still in the hand
initial_pot_bbRequired
number > 0Pot in BB when the flop opened
players[]Required
array 2..10Each 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..200Flop, 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
objectHow 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
stringTree 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
stringTree 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
booleantrue adds the audit block: who answered, why and which checks failed
hand_id
stringYour hand identifier for tracing, 1 to 128 chars. Not echoed
Amounts and order
In bet and raise, amount_bb is the TOTAL for the street (raise-to), never the increment. players goes in postflop acting order, first to act first: that order says who is in position.
Request: BB to act on the flop, BTN vs BB single-raised pot
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:

ParameterTypeDescription
players[]Required
array 2..10seat, position and stack_bb at the START of the hand (greater than 0). No in_hand: folds go in history
history[]Required
array 0..200Preflop 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
numberAnte per player in BB, if the table plays with antes
posts[]
array 0..20Optional. 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.

ParameterTypeDescription
players[]Required
array 2..10Every 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..9Seat of the dealer button as shown at the table. It may be an empty seat
actions[]Required
array 0..300Everything 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
numberOn 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
stringflop, turn and river up to the street of the decision. Without flop, it is a preflop decision
ante_bb
numberAnte per dealt seat in BB, if the table plays with antes
pot_bb
numberOptional 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
Repairs and warnings
If the hand does not add up (a missing fold, a missing blind, an amount above the stack), the API repairs it and still answers. Each repair is listed with a code in audit.replay.warnings. It returns 422 validation_error only when there is no decision to make: the hero already folded or is all-in, it is not the hero's turn, the hand is over or a board card is missing. The code is in details[].code
Full hand: the big blind faces an open and a call
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.

200Full hand with audit: true (excerpt) · 200
{
  "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.

See Discovery mode →

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.

200The tree answered (brief) · 200
{
  "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"
}
200The engine answered a multiway flop (full) · 200
{
  "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"
}
200The engine answered preflop (brief) · 200
{
  "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.

ReasonStatusMeaning
street_preflop
activePreflop body: the tree starts on the flop
no_node
activeNo tree coordinates in the body
spot_not_configured
activeThe situation and position pair is not served
heads_up_table
activeThe 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
activeMore than two players in the hand, or a fold in history
preflop_missing
activeNo preflop summary
scenario_mismatch
activeThe preflop scenario is not the tree's situation
position_mismatch
activeThe two live seats are not the pair in position
aggressor_mismatch
activeThe preflop aggressor is not the first seat of the pair
street_mismatch
activeThe node street is not the board street
board_card_mismatch
activeA turn or river card in node is not the board card
line_mismatch
activenode and history differ in number, order or type of actions
allin_mismatch
activeAll-in on one side only (tree or table)
hero_not_to_act
activeThe hero is not the player to act at node
pot_ratio_out_of_band
activeThe real pot at the start of the decision street is below 0.55× or above 1.8× the tree pot
spr_out_of_window
activeThe 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
observationpot_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
activeThe tree has no node for that line. Same meanings as the 404 reason
size_off_tree
activenode: "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
activenode: "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
activenode: "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
activeThe node exists but your hand is not in the range there
malformed_node
activeThe tree node could not be read

Response headers

The same headers as GET /v1/strategy (X-Request-ID, rate limit, HSTS), plus:

HeaderValueDescription
X-Engine
gtokiller | fallbackWho answered. On decisions only, not on discovery
X-Fallback-Reason
stringOnly when X-Engine is fallback: why the tree did not answer (table above)
X-Cache
HIT | MISSTree answers: HIT when the node came from the in-memory cache. Engine answers: always MISS
Server-Timing
metricsThe 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.

See the Errors page →

Previous
Stateless mode
Next
GET /v1/strategy