How do I calculate poker range equity with an API?
Send each player's range, an optional board, and reproducible Monte-Carlo controls to the PokerKit equity endpoint; use the returned shares to explain a supplied scenario, not to predict an outcome.
POST /v1/pokerkit/equity with ranges containing one notation array per player. Optionally include a board, sample_count, and seed. The response returns one Monte-Carlo equity per supplied range plus the sample count used.Quick facts
| Endpoint | POST /v1/pokerkit/equity |
|---|---|
| Input | Two or more per-player ranges in PokerKit range notation; board is optional. |
| Method | Monte-Carlo equity estimation. It returns an estimate for the supplied ranges and board, not an odds guarantee. |
| Response | result.equities is ordered to match ranges; result.sample_count reports the sampling context. |
| Quota | This endpoint charges 1 solve quota. The current Free tier includes 25 real-time solves per month. |
| Access | PokerKit and GTO endpoints use the same API key. Send one supported API-key header. |
Input semantics
Use one nested range array for each player. The array order is significant because returned equities use the same order. A board, when supplied, is an unseparated card string such as AhKhQh.
| Field | Meaning |
|---|---|
ranges | Required. Per-player arrays of range-notation strings, for example [["AA"], ["KK"]]. |
board | Optional card string for the known board; omit or use an empty string when no board is known. |
sample_count | Optional Monte-Carlo sample count. The documented service cap applies; the default is used when it is unset. |
seed | Optional seed for reproducible sampling. |
Minimal API request
This public docs-code example compares AA and KK before the board, with a fixed sample count and seed. Add your API key as the authentication header when making the HTTP request.
{"ranges": [["AA"], ["KK"]], "board": "", "sample_count": 2000, "seed": 7}
Example response and interpretation
{"result": {"equities": [0.8235, 0.1765], "sample_count": 2000}}
The first value, 0.8235, corresponds to the first input range (AA); the second, 0.1765, corresponds to KK. Preserve this ordering in your UI or report.
Read sample_count: 2000 as the number of Monte-Carlo samples used for this response. It describes this estimate's sampling context; it is not a promise about a future deal, a wager, or performance.
When to use this
Use the endpoint in training products, completed-hand review, coaching tools, research, or an explanation UI where the ranges and board are explicit to the user. Store the supplied inputs beside the result so the estimate remains auditable.
When not to use this
Do not use an equity estimate as a real-money, in-hand action prompt; it does not replace player judgment, a complete game model, or a solver strategy. Do not imply that one estimate guarantees a win, a future card, or a betting outcome.
Quota and authentication
Send Authorization: Bearer $POKERAI_API_KEY (or the equivalent X-API-Key) with the request. The endpoint consumes 1 solve quota; the current Free tier has 25 real-time solves per month. Check current usage in the dashboard and read the quotas topic before designing batch work.
Errors
| HTTP | Meaning | What to do |
|---|---|---|
| 401 | missing_api_key or invalid_api_key. | Send one valid API-key header and keep the key out of client logs. |
| Quota | quota_exceeded when the applicable monthly quota is exhausted. | Wait for the monthly reset or adjust the workload; do not retry unchanged requests. |
| 422 | Request validation failed, such as an invalid body shape. | Check the current Reference or OpenAPI schema and correct the input. |
Training and review only
Related resources
- Developer docs — authentication, quota behavior, SDKs, and API concepts
- Quota guide — current Free limits and quota-error handling
- Interactive API reference — the current equity operation schema
- OpenAPI specification — the machine-readable English contract
- Python SDK — the official Python package
- TypeScript / JavaScript SDK — the official npm client
- Official MCP server — the documented MCP package for agent workflows
- Poker hand review API guide — put equity in a post-session review workflow
- llms.txt — the concise LLM entry point for Pokerai API