How do I make my first GTO poker API request?
Create a free Pokerai API key, send one authenticated JSON request to POST /v1/gto/preflop, and read the returned action frequencies as a mixed strategy.
Authorization: Bearer <API_KEY> header and send the complete spot as JSON. The response lists the frequency of every available action; it does not choose one recommended move.Quick facts
| Endpoint | POST /v1/gto/preflop |
|---|---|
| Authentication | Bearer API key from the dashboard sign-in |
| Input | Hole cards, hero position, and the full preflop action sequence |
| Output | Fold, call, or raise frequencies, with raise sizing when present |
| Quota | One presolved lookup for this request; Free includes 1,000 presolved lookups per month |
| Allowed use | Training, coaching, hand review, study, and research; no real-money RTA |
When to use this quickstart
Use it to verify authentication, inspect the response shape, or start a trainer, study tool, hand-review workflow, backend service, or AI agent integration.
When not to use it
Do not use this endpoint as live advice during real-money play. For a custom flop, turn, or river tree, follow the real-time solver workflow in the developer docs instead of treating this preflop lookup as a general postflop solver.
Minimal curl request
Create a key, store it locally as POKERAI_API_KEY, and run this request. Never commit the real key or place it in client-side code.
curl -s https://pokerai.bet/v1/gto/preflop \
-H "Authorization: Bearer $POKERAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"hole_cards": "9h9s",
"positions": { "hero": "MP" },
"preflop_actions": [
{ "position": "SB", "action": "small blind", "amount": 0.5 },
{ "position": "BB", "action": "big blind", "amount": 1 },
{ "position": "UTG", "action": "raise", "amount": 2.5 }
]
}'
Real response
This captured response is for MP holding 9h9s after a 2.5bb UTG open:
{
"hole_cards": "9h9s",
"situation": "Raise",
"strategy": [
{ "action": "fold", "frequency": 0.254 },
{ "action": "call", "frequency": 0.106 },
{ "action": "raise", "frequency": 0.64, "amount_bb": 9, "sizing_pot": 1 }
]
}
The three frequencies sum to 1: fold 25.4%, call 10.6%, and raise to 9bb 64%. Treat this as a distribution to study or sample from, not as a promise that one action will win.
Quota
Pokerai API meters presolved lookups separately from real-time solves. This preflop request uses one presolved lookup. The Free tier includes 1,000 presolved lookups and 25 real-time solves per month; both counters reset monthly and current usage is shown in the dashboard. See pricing for the current public limits.
Common errors
The public OpenAPI contract for this endpoint declares these non-success responses:
| HTTP | Meaning | What to do |
|---|---|---|
400 | Invalid JSON, a missing field, invalid cards, position, or action sequence. | Fix the request; do not retry unchanged. |
401 | missing_api_key or invalid_api_key. | Check the Bearer header and key. |
429 | quota_exceeded: the monthly presolved quota is exhausted. | Wait for the monthly reset or change the account quota. |
SDK and MCP options
The official clients follow the same public OpenAPI contract and use the same API key and quota. Full typed examples are in the SDK documentation.
- Python SDK:
pip install pokerai-bet(import aspokerai). - TypeScript / JavaScript SDK:
npm install @pokerai/client. - MCP server for AI agents:
npx @pokerai/mcp. Presolved tools are enabled by default; enabling solver tools consumes the separate solve quota.
No real-money RTA
Once the curl request succeeds, choose the resource that matches what you are building:
- Build a GTO trainer — turn the first request into a small runnable training workflow
- Interactive API reference — inspect the request and response schema for every endpoint
- Developer docs — continue with flop trees, real-time solves, quotas, SDKs, and MCP