How do I validate and normalize poker card strings with Pokerai API?
Send one compact card string to the public PokerKit normalization endpoint before using it in a card-aware workflow.
POST /v1/pokerkit/cards/normalize with the required cards string. The public CardsRequest example is AsKsQs; use the current Reference before depending on any response field.Quick facts
| Fact | Public contract |
|---|---|
| Operation | POST /v1/pokerkit/cards/normalize |
| Required body | cards, a string. |
| Public example | AsKsQs. |
| Card notation | Each card is two characters: rank AKQJT98765432 followed by suit c, d, h, or s; concatenate cards without separators. |
| Success shape | HTTP 200 is documented, but its public OpenAPI schema is open. Treat returned JSON fields as response data to inspect, not a fixed field-level contract. |
Minimal OpenAPI-backed request
curl -s https://pokerai.bet/v1/pokerkit/cards/normalize \
-H "Authorization: Bearer $POKERAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"cards":"AsKsQs"}'
This request uses the public CardsRequest example. A real successful call returns JSON with HTTP 200; because the current public snapshot deliberately leaves that response schema open, inspect the actual returned JSON and do not hard-code undocumented field names.
Accepted input and normalization boundary
Use compact two-character cards such as As, Kd, and Th, concatenated as one string such as AsKsQs. This endpoint validates and normalizes card input; it does not calculate equity, evaluate a hand, recommend an action, or infer a strategy.
Common errors and privacy
| Signal | Public contract | What to do |
|---|---|---|
HTTP 422 | HTTPValidationError | Check that cards is present and is a JSON string, then compare the submitted notation with the current Reference. |
| Authentication | The operation lists Authorization and X-API-Key request headers. | Send one supported API-key header; see Authentication. |
| Privacy | Cards can be sensitive game or user data. | Send only what is needed, keep API keys out of request bodies and logs, and redact card strings from support material when they could identify a player or hand history. |
Use normalization in training, coaching, hand review, study, and research workflows. It is not real-money real-time assistance (RTA), does not provide strategy, and must not be used to guide live-table action.
Related documentation
- Docs hub — PokerKit and GTO API overview.
- Poker hand analysis guide — use normalized card input in post-session analysis workflows.
- API Reference — current operation-level request and response details.
- OpenAPI snapshot — the public
CardsRequestand response contract. - Python SDK, TypeScript / JavaScript SDK, and MCP server — official package entry points.
Real-time assistance at real-money tables is prohibited.