Docs topic · API keys

How do I authenticate with Pokerai API?

Create an API key in the dashboard, keep it secret, and send it with every API request.

Updated Maintained by Pokerai API

Direct answer: send your gto_… API key as Authorization: Bearer $POKERAI_API_KEY. X-API-Key is an equivalent alternative; use one header, not both.

Quick facts

FactValue
Where to create a keyDashboard; the key is shown once, so store it in a secret manager.
HeaderAuthorization: Bearer $POKERAI_API_KEY
AlternativeX-API-Key: $POKERAI_API_KEY (equivalent; send one form only).
Applies toGTO and PokerKit endpoints share the same key.
Free quota1,000 presolved lookups + 25 real-time solves per month.

Minimal authenticated request

curl -s https://pokerai.bet/v1/gto/preflop \
  -H "Authorization: Bearer $POKERAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hole_cards":"AhKh","positions":{"hero":"UTG"},"preflop_actions":[{"position":"SB","action":"small blind","amount":0.5},{"position":"BB","action":"big blind","amount":1}]}'

Authentication errors

HTTPErrorWhat to do
401missing_api_keyAdd one supported API-key header.
401invalid_api_keyCheck the copied key and its environment variable; create a replacement if needed.
502auth_unavailableRetry with exponential backoff; do not expose the key in logs.

Related documentation

Real-time assistance at real-money tables is prohibited.