# GTO Gecko AI Solver API > An HTTP API that solves heads-up postflop no-limit hold'em spots. One request describes a spot (board, pot, stack, two ranges, bet sizes). The answer is the solution of one street: for every decision, the strategy, the range and the EV of every hand. Provider: GTO Solutions AS, Norway. Base address: https://api.gtogecko.com Version: /v1 (first release 30 November 2026) Format: JSON over HTTPS. Every POST with a body needs `Content-Type: application/json`. Documentation: https://api.gtogecko.com/docs (one page for each topic; the list is below) ## Authentication - Header: `Authorization: Bearer `. Keys come from the console: https://api.gtogecko.com/console - `gecko_test_...` keys are free and work at once. They run a sandbox: the real result format, betting tree and exits, with placeholder strategies (every action equally likely, every EV zero). - `gecko_live_...` keys give real solutions. One solve of one street costs 1 call (the API field is `credits`). Live keys work as soon as the account has calls (a monthly plan or pay per call, bought by card in the console): https://api.gtogecko.com/docs/keys#go-live - Keep keys on a server. Never put a key in a browser page or an app. ## Core idea - One solve is one street: a flop (3 board cards), a turn (4) or a river (5). No preflop, no three-player spots. - A flop or turn solve lists its exits: the lines that end the street with chips behind. The next street starts from one exit and one card. - Lines are lists of tokens: `c` (check or call), `f` (fold), `b33` (bet or raise; the number is the chips the player has put in on the street). Example: `["c", "b33", "c"]`. - Ranges: out of position first, then in position. A map such as `{"AA": 1, "AKs": 0.5, "AhKh": 1}` or a list of 1,326 weights in the order of `GET /v1/hands`. ## Main routes - `POST /v1/solves`: solve a spot; or the next street with `{"parent", "line" | "exit_id", "card"}`; or a whole line with `then`; or many lines and cards with `expand`; or many boards with `boards`. Answers 202 with a solve object. `Prefer: wait=30` holds the answer up to 30 seconds. `Idempotency-Key` makes a repeat safe for 24 hours. - `GET /v1/solves/{id}`: status (`pending`, `queued`, `running`, `complete`, `failed`, `skipped`, `cancelled`), `queue`, and for a request with many solves a `tree` block (`running`, `complete`, `stopped`, `cancelled`). - `GET /v1/solves/{id}/result`: the whole solution of one street (JSON, up to 16 MiB, gzip). - `GET /v1/solves/{id}/nodes` and `GET /v1/solves/{id}/nodes/{node_id}?hands=AhKh,QhQd`: one decision without the whole result. `hands` takes hands (`AhKh`; `KhAh` is the same hand) and hand classes (`AKs`, `AKo`, `AA`); an unknown name is `422 invalid_request`. - `GET /v1/solves/{id}/exits`, `GET /v1/solves/{id}/children?scope=tree`, `POST /v1/solves/{id}/cancel`, `GET /v1/solves`. - `POST /v1/estimates`: solves and calls a request needs. Free. `POST /v1/trees`: the betting tree and exits of a spot. Free. - `POST /v1/warmup`: start a solver before the first solve. Free. - `GET /v1/account`, `GET /v1/ledger`: calls left, limits, usage, every change of the balance. - Open routes, no key: `GET /v1/health`, `GET /v1/hands`, `GET /v1/pricing`. ## Minimal example ``` curl -X POST https://api.gtogecko.com/v1/solves \ -H "Authorization: Bearer $GECKO_KEY" \ -H "Content-Type: application/json" \ -H "Prefer: wait=30" \ -d '{"board": ["As", "Ks", "7h"], "pot": 100, "stack": 300, "ranges": [{"AA": 1, "AKs": 1, "QQ": 1}, {"KK": 1, "AQs": 1, "JTs": 1}], "bet_sizes": [0.33], "raise_sizes": [1.0]}' ``` Then read `GET /v1/solves/{id}/result`. In the result, `tree` is the first decision; each decision has `strategy.actions`, and per hand `strategy.strategy[hand]` (one probability for each action), `strategy.evs[hand]` and `strategy.range[hand]`; `childrens` maps an action to the next node. Find a node by its `node_id` (for example `r:0:c:b33`). A hand, a node or an exit that no hand reaches can be absent. ## Rules a client must follow - Errors are `application/problem+json` with a stable `code`, a `detail` sentence and a `request_id` (also the `Request-Id` header). The `type` of an error is the address of its row: `https://api.gtogecko.com/docs/errors#error-`. A field name the API does not know is refused with `422 invalid_request`. - Retry only `429` (wait `Retry-After`), `503` (back off 1, 2, 4, 8 seconds, at most 5 tries) and lost answers. Do not retry `500` or other `4xx` unchanged. - `POST /v1/solves` is safe to repeat only with an `Idempotency-Key`. - Set the client time-out to at least 35 seconds with `Prefer: wait=30`. Allow about 90 seconds for a first solve after a quiet period (the solver starts on demand). - There are no webhooks: wait with `Prefer: wait` or poll every 0.5 to 1 second. - Results can be read for 6 days. Store what you need. - Rate limit: 120 requests a minute for a key (`RateLimit-Limit`, `RateLimit-Remaining`). One solve at a time for an account by default. - Fair use: business use only; never real-time help to a player during a hand; no resale of results as data or as a solver service; no use of results to train, tune or test a competing model or solver. No personal data in requests, also not in `metadata`. ## Speed and accuracy Heads-up no-limit hold'em, warm solver. Solver time is the time the solver works on one street (`timing.solve_seconds` in a result). Request to result is the time from the request to the finished result with no other solve ahead. | Street and bet sizes | Solver time, 500 iterations | Request to result, 500 iterations | Solver time, 2,000 iterations | |---|---|---|---| | Flop, one bet size | 1.4–1.8 s | 4.4–4.7 s | 5.0–6.7 s | | Flop, two bet sizes | 2.6 s | 4.8 s | 9.8 s | | Flop, three bet sizes | 3.1 s | 4.5 s | 11.9 s | | Flop, three bet sizes and two raises | 4.8 s | 8.5 s | 18.5 s | | Turn, any of these menus | 0.8–0.9 s | 2.5–2.9 s | 2.7–3.1 s | | River, any of these menus | 0.4–0.6 s | 2.2–2.7 s | 1.5–1.9 s | - Average EV loss as a % of the pot (what a strategy gives up against the best reply to it): flop 0.51%, turn 0.99%, river 0.48%. - A cold solver adds about 45 seconds to the first solve after a quiet period. ## Get started - [Overview](https://api.gtogecko.com/docs): what the API does, how it works, and the map of the documentation - [Speed and accuracy](https://api.gtogecko.com/docs/performance): solver times for a flop, a turn and a river, and the average EV loss of each street as a % of the pot - [Quick start](https://api.gtogecko.com/docs/quick-start): the first solve in five steps, in curl, Python and JavaScript - [Words and first principles](https://api.gtogecko.com/docs/concepts): street, range, position, exit, EV; how to choose sizes, iterations and accuracy - [Keys and authentication](https://api.gtogecko.com/docs/keys): test keys against live keys, live access, limits on a key, rotation ## Solving - [The spot](https://api.gtogecko.com/docs/spot): every request field and its limits: board and money, ranges, the betting tree, settings, rake and ICM, locks - [Exits and lines](https://api.gtogecko.com/docs/exits): the core idea: one solve is one street, a street ends in exits, a line is a list of action tokens - [Later streets](https://api.gtogecko.com/docs/streets): the three ways to the next street (`parent`, `then`, `expand`) - [Requests with many solves](https://api.gtogecko.com/docs/requests): many boards, the `tree` block, reading the solves of a request, cancel - [Estimates and budgets](https://api.gtogecko.com/docs/estimates): estimates, `max_credits`, `allow_partial`, tree preview - [Results](https://api.gtogecko.com/docs/results): the result format, how to read one hand, what a result can leave out ## Running it - [Waiting for a result](https://api.gtogecko.com/docs/waiting): the states of a solve, `Prefer: wait`, polling, the queue, warm and cold solver, warm-up - [Going to production](https://api.gtogecko.com/docs/production): time-outs, retries, idempotency, rate limits, throughput, go-live checklist - [Limits](https://api.gtogecko.com/docs/limits): every limit, in four tables - [Errors](https://api.gtogecko.com/docs/errors): every code, with "retry" and "charged" ## Billing - [Calls and prices](https://api.gtogecko.com/docs/pricing): the live price list, and when a call is charged - [Payments](https://api.gtogecko.com/docs/payments): monthly plans, pay per call (packs of calls, no plan needed), discount codes for plans, invoices, automatic top-up, the ledger ## API reference - [All routes](https://api.gtogecko.com/docs/api): every route in four groups, the headers - [Solves](https://api.gtogecko.com/docs/api-solves): create, read, result, nodes, exits, children, cancel, list; the solve object - [Planning](https://api.gtogecko.com/docs/api-planning): estimates, trees, warm-up - [Account and billing](https://api.gtogecko.com/docs/api-account): account, ledger, billing checkout - [Service](https://api.gtogecko.com/docs/api-service): health, hands, pricing - [The result format](https://api.gtogecko.com/docs/api-result): every field of a result: the document, the nodes of the tree, the exits, the root block ## More - [Versions and changes](https://api.gtogecko.com/docs/changes): change policy and changelog - [Support and data](https://api.gtogecko.com/docs/support): contact, where data is processed, how long it is kept - [Fair use](https://api.gtogecko.com/docs/fair-use) and [Terms of Service](https://api.gtogecko.com/docs/terms) ## Machine-readable - [OpenAPI file](https://api.gtogecko.com/openapi.json) - [Interactive reference](https://api.gtogecko.com/reference): try a call in the browser - [Search index of the documentation](https://api.gtogecko.com/docs/search.json): every heading of every page - [A complete real result](https://api.gtogecko.com/docs/assets/sample-result.json): 228 KB, the flop As Ks 7h of the quick start - [Price list](https://api.gtogecko.com/v1/pricing) - [Prices as a page](https://api.gtogecko.com/pricing): the plans and the packs, with what a call is and what it will cost