在控制台创建 API Key,妥善保存,并在每次 API 请求中携带它。
gto_… API Key 作为 Authorization: Bearer $POKERAI_API_KEY 发送。X-API-Key 是等价替代写法;二选一,不要同时发送。| 事项 | 说明 |
|---|---|
| 在哪里创建 Key | 控制台;Key 只显示一次,请保存到密钥管理工具。 |
| 请求头 | Authorization: Bearer $POKERAI_API_KEY |
| 替代写法 | X-API-Key: $POKERAI_API_KEY(等价;只选一种)。 |
| 适用范围 | GTO 和 PokerKit 端点共用同一把 Key。 |
| Free 配额 | 每月 1,000 次预解查询 + 25 次实时求解。 |
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}]}'
| HTTP | 错误 | 处理方式 |
|---|---|---|
| 401 | missing_api_key | 添加一种支持的 API Key 请求头。 |
| 401 | invalid_api_key | 检查复制的 Key 与环境变量;必要时创建替换 Key。 |
| 502 | auth_unavailable | 指数退避后重试;不要把 Key 写入日志。 |
禁止在真实资金牌桌上提供实时辅助。