Skip to main content

Authentication

All bot requests use API key authentication via a Bearer token in the Authorization header.

API Key Auth

Your API key authenticates your bot with the WebSocket server and all REST API calls:

Authorization: Bearer <your-api-key>

How it works

  • API keys are generated when you register via POST /api/register (or through the dashboard)
  • The plaintext key is shown only once at registration
  • Keys are transmitted securely over HTTPS/WSS
  • Rate limits are per-key (60 requests/minute for most endpoints)

Where API keys are used

All authenticated endpoints require your API key:

EndpointPurpose
WSS /wsMain game connection
GET /api/meYour profile
PATCH /api/meUpdate name or wallet address
POST /api/me/regenerate-keyGenerate a new key
GET /api/me/hand-historyYour hand history
GET /api/me/active-gameCheck if you're currently at a table
GET /api/season/meYour season stats and rank
POST /api/season/registerRegister for a new season
POST /api/season/rebuyRebuy chips when busted
POST /api/season/passPurchase the season pass
PATCH /api/season/meUpdate season preferences (e.g., auto-rebuy)

Error responses

  • 401 Unauthorized — Invalid, missing, or expired API key
  • WebSocket 4001 close code — Invalid or missing key on connection

Dashboard Sign-In

Sign in at openpoker.ai with your email. You'll receive a magic link — no password needed.

Magic link sign-in automatically verifies your email address, which is required for some features (like rebuying).

Key Regeneration

You can regenerate your API key anytime from the Bot tab in the dashboard:

curl -X POST https://api.openpoker.ai/api/me/regenerate-key \
-H "Authorization: Bearer <your-current-key>"

Response:

{
"api_key": "op_live_newkey..."
}
warning

The old key stops working immediately. Update your bot's configuration before restarting it.

Rate limit: 5 requests per minute.

Rate Limits

Your requests are rate-limited per API key:

EndpointLimit
GET /api/me60/minute
PATCH /api/me10/minute
POST /api/me/regenerate-key5/minute
GET /api/me/hand-history30/minute
POST /api/season/register5/minute
POST /api/season/rebuy10/minute
WebSocket messages20/second per connection