The AI Bot Providers plugin (ai-bots) lets you hand individual bots to an external decision model. The model chooses the bot’s action; the engine still checks every action against the legal moves, so a model can never make an illegal play or stall a hand. Bots you don’t assign play exactly as before.
Supported providers: Anthropic Claude, the OpenAI Decisions API, TypeSafe Jev (direct or through OpenRouter) and any OpenAI-compatible chat endpoint (xAI, Groq, Together, a self-hosted Ollama or vLLM server, and so on). A built-in Mock provider plays random legal actions offline and costs nothing, so you can try everything before you add a key.
Where to find it
| Place | What you do there |
|---|---|
Extensions › Plugin Pages › AI Bots (/admin/plugins/ai-bots/page/ai-bots) | Kill switches, spend, provider tests, per-bot configuration, decision log, opponent reads, and on the Settings tab every plugin setting |
Extensions › Plugins, then Settings on the AI Bot Providers row (or Open settings in its details panel) (/admin/plugins/ai-bots/settings) | The same settings on the engine’s generic form: API keys, spend caps, time budget, circuit breaker, fallback, retention, badge |
Games › Bots › Bots (/admin/bots) | Each AI-assigned bot shows an AI · model chip. The Edit bot dialog has an AI play section with the same editor as the AI Bots page |
Required permission: an admin account (requireAdmin). Saving settings (on either page) and removing a stored key need a super admin. Every change is logged with the admin’s id.
Activation and capabilities
The plugin ships in plugins/ai-bots. On an install that auto-discovers plugins/, it starts with all of its declared capabilities. Installed as an upload, the consent dialog lists them:
| Capability | Used for |
|---|---|
| Plugin storage | Assignments, spend counters, the decision log, opponent reads, breaker and alert state |
Bot decisions (game:bot-decide) | Choosing an assigned bot’s action |
| Player action hooks | Opponent reads (VPIP, aggression and so on) built from the actions at the table |
| Scheduler | The daily prune of old decision and spend records |
| In-app notifications | Spend and breaker alerts to the accounts in Alert recipients |
Bot table talk (bots:chat) | Letting bots post short lines in table chat, and reading players’ table chat (only to notice a question such as "are you a bot?" and to pace the bots). Without it table talk stays silent |
Setup
- Open the AI Bots page. Until a provider has a key it opens on the Settings tab (you can also use the plugin’s Settings on Extensions › Plugins). Under Providers & keys, enter the key for at least one provider (see the table below) and press Save settings. Keys are stored encrypted and never shown again: a stored key shows Configured, leaving the box blank keeps it, and Remove key deletes it when you save. An environment variable, when set, wins over the stored key.
- Check the caps. The defaults are $10 a day, $100 a month and $2 per bot per day.
- Open the AI Bots page. On Overview, every provider card shows whether it is configured. Press Test decision to run one fixed preflop spot through that provider: you see the action, the latency and the estimated cost. A provider without a key runs the mock instead, so the button always works.
- On Bots, press Assign AI next to a bot, pick a provider and model, set the play style and press Save. The bot uses it from its next decision.
Start with the Mock provider: assign a bot to it, seat it with a human and a scripted bot, and watch decisions and counters appear on the AI Bots page. Then switch the bot to a real model.
AI bots follow the same seating rule as scripted bots, set by the Bot Table Policy. See Where Bots Can Sit.
Keys and providers
| Provider | Setting | Env override | Models (built-in price per 1M tokens, input / output) |
|---|---|---|---|
| Anthropic Claude | Anthropic API key | PLUGIN_AI_BOTS_ANTHROPIC_API_KEY | Claude Haiku 5.5 ($0.10 / $0.50, default), Claude Sonnet 5.5 ($2 / $10), Claude Opus 5.5 ($4 / $20). Cached input is billed at a tenth of the input rate |
| OpenAI Decisions | OpenAI API key | PLUGIN_AI_BOTS_OPENAI_API_KEY | GPT-6 Luna ($0.10 / $0) |
| TypeSafe Jev | TypeSafe (Jev) API key, or OpenRouter API key | PLUGIN_AI_BOTS_TYPESAFE_API_KEY, PLUGIN_AI_BOTS_OPENROUTER_API_KEY | Jev latest and Jev 1.14 ($0.042 / $0). With both keys set, the TypeSafe key is used |
| OpenAI-compatible | OpenAI-compatible base URL (plus an optional key) | PLUGIN_AI_BOTS_OPENAI_COMPAT_API_KEY | Any model the endpoint serves, entered as a custom model id. Priced at $0 unless you add a row to Price table override |
| Scripted | none | The engine’s own strategy (no call). Useful to park a bot’s settings | |
| Mock | none | Random legal actions, free, offline. Test equipment: at a real-money table it never decides, and the bot plays its built-in strategy instead |
The base URL must serve /chat/completions, for example https://api.x.ai/v1. Loopback, private (RFC 1918) and link-local addresses are refused unless Allow private-network base URL is on, which you need for a model running on your own network, such as http://localhost:11434/v1 for Ollama.
Prices change. If a provider bills differently from the built-in table, add the model to Price table override, for example {"claude-haiku-5-5": {"inputPerM": 0.1, "outputPerM": 0.5}}. Rows merge over the built-in table. Spend figures are estimates from token counts and this table, not the provider’s invoice.
Limits and kill switches
Every check runs before a provider is called. When one stops the call, the bot plays its fallback: the engine’s scripted strategy (default) or check-else-fold. Either way the hand goes on without a pause.
| Control | Where | Effect |
|---|---|---|
| Global kill switch | AI Bots > Overview > Turn AI off (or the AI bots enabled setting) | Every AI-assigned bot plays the scripted strategy from its next decision. No provider is called |
| Provider switch | The Enabled box on each provider card (or the per-provider settings) | Bots on that provider play their fallback |
| Daily cap | Daily spend cap (USD) | Reached: AI bots fall back until 00:00 UTC |
| Monthly cap | Monthly spend cap (USD) | Reached: AI bots fall back until the 1st (UTC) |
| Per-bot daily cap | Per-bot daily spend cap (USD), or the bot’s own Daily spend cap | Reached: that bot falls back for the rest of the UTC day |
| Decisions per hour | The bot’s Max decisions per hour | Over the limit: that bot falls back |
| Time budget | Default time budget (ms), or the bot’s Time budget (500 to 30,000 ms) | The call is cancelled when it runs out. The engine’s own action timer always wins |
| Circuit breaker | Circuit breaker failures and cooldown | After that many failures in a row (errors, timeouts, refusals, unusable answers), the provider is skipped for the cooldown, then one trial call decides. Reset breaker on the provider card closes it at once |
Soft alert at (%) sends one alert per cap and period when spend reaches that share of a cap, and one more when the cap is reached. Alerts go to the player accounts listed in Alert recipients as in-app messages (admin accounts can’t receive plugin messages), are written to the server log, and are listed under Recent alerts on the Overview tab.
To reach admins directly, set Alert channels to include webhook and fill in Alert webhook URL (https; private addresses are blocked unless the private-network toggle is on). Each alert is POSTed as JSON: type (cap-soft, cap-hard, breaker-open, breaker-closed, provider-disabled), severity, provider, botId, period, percentUsed, capUsd, usedUsd, message, ts and source: "ai-bots". If you set Alert webhook secret, the X-AiBots-Signature header holds sha256= plus the HMAC-SHA256 of the raw body, so your endpoint can verify the sender. Delivery times out after 5 seconds and is retried once; a failing webhook is logged and never affects play.
To get alerts by email, include email in Alert channels and list the addresses under Alert email addresses (up to 20). The plugin sends through the mail server (SMTP) you configured in the Admin Panel, once per cap per period like the other channels, as a short plain-text email whose subject starts with the plugin name. The plugin needs the "Email addresses you configure" permission, which you grant when you activate it (a plugin updated from an older version asks again). If SMTP is not set up or the send fails, the alert is logged and the other channels still go out. The engine allows a plugin 60 emails per hour.
Reset today’s spend (Overview, with a reason) zeroes today’s counters and records who did it and why. It doesn’t change the month.
A reached cap or an open breaker does not make the plugin unhealthy: on Extensions › Plugins it stays Healthy, because bots keep playing through their fallback.
With more than one server node, each node checks caps against the other nodes’ totals as of a few seconds ago, so a cap can be passed by what the other nodes spend in that window. Set the caps a little below your real limit.
Configuring a bot
The editor (Bots tab, or AI play in the Edit Bot dialog) has these fields:
| Field | Meaning |
|---|---|
| AI play enabled | Off keeps the settings but the bot plays the scripted strategy |
| Provider, Model | The model that decides. For OpenAI-compatible, tick Use a custom model id to enter the endpoint’s model name |
| Effort | How long a reasoning model may think (low, medium, high). Higher costs more and takes longer |
| Fallback | Overrides the plugin’s Fallback mode for this bot |
| Persona name, Personality | Free text (up to 2,000 characters) describing who the bot is and how it plays. Only the model sees it |
| Aggression, Tightness, Bluff frequency, Risk appetite | 1 (low) to 5 (high) |
| Table talk tone | A short description of the bot’s manner; only the model sees it |
| Target (bb/100), Session stop-loss, Session win limit, Adapt to results | The result the bot aims for. The model is told its session result, the target and how far it is from the stop-loss and win limit. With Adapt on, it is asked to tighten up when well below target or near the stop-loss, and allowed more calculated risks when comfortably above target. The limits guide the model; they don’t make the bot leave the table |
| Time budget, Daily spend cap, Max decisions per hour | Per-bot limits (empty uses the plugin settings) |
Remove deletes the assignment; the bot plays the engine strategy again.
What the model sees: fairness
The model sees only what a human player in that seat would see. That is the bot’s own two cards, the board, stack sizes, bets, the pot, the actions so far in this hand, the legal moves, and statistics about each opponent built from earlier hands at the table, including hands they showed down. It never sees another player’s hole cards, the deck or anything only the server knows.
This is enforced in code, not by trusting the model. The engine hands the plugin no other player’s cards, the plugin copies the spot field by field into its own description (so nothing extra can slip through), and a test renders hundreds of random spots with opponents’ cards planted in hidden fields and fails if any of them reach a prompt.
Rationales are never shown to players. A model’s short explanation of its decision is kept in the admin decision log (only while Store rationales is on) and appears nowhere else: not at the table, not in chat, not in hand histories. Players see at most a small AI badge on the bot’s seat, which you can turn off with Show AI badge to players. The badge says only that the seat is played by an AI and, for the named providers, which model.
Whether and how you tell players that some opponents are AI-driven is your decision and may be a regulatory question in your market. The badge setting is there so you can follow whatever rule applies.
AI Bots page
| Tab | What it shows |
|---|---|
| Overview | Global kill switch; spend today and this month against the caps; the last 24 hours: decisions, fallback rate and reasons, latency p50 / p95; a card per provider with key status, on/off switch, breaker state and Reset breaker, latency, today’s spend and Test decision; recent alerts |
| Bots | Every bot with its provider, table and spend today. Assign AI / Edit opens the editor |
| Decisions | The decision log for one UTC day, filtered by bot, provider or fallbacks only. Details shows the spot, the legal actions, what the model answered, what was played, the fallback reason, tokens, cost, latency and the rationale |
| Reads | The statistics AI bots hold about each player at a table: hands seen, VPIP, PFR, 3-bet, aggression factor, c-bet, fold to c-bet, WTSD, W$SD and showdown notes. Pick a table from today’s decisions or enter its id |
| Table talk | Whether table talk is on, today’s table-talk spend against its cap, and on this server the last lines bots said and why other lines were not sent (too soon, repeated, late, a hidden card, and so on) |
| Explain | Paste a core bot decision trace to read it: the options the bot weighed with their probabilities and values, how its tier and character changed them, and the roll that picked the action. With an explanation provider set, a model adds a short explanation, marked as generated |
Test decision calls are not counted in the spend counters, not written to the decision log and don’t affect the circuit breaker. Each one is still a real, billed request (a fraction of a cent on the default models).
Table talk
Off by default. Turn on Table talk enabled in the Table talk section of the AI Bots page’s Settings tab (and grant the bot table talk capability). Bots then occasionally say a short line after a big pot, a showdown, or when someone sits down or leaves, in a voice that fits their character. Most hands nobody says anything, quiet characters almost never speak, bots never chat among themselves at a table without players, and a line that is late or repeated is never sent. Lines go through the same chat filter and length limit as players’ messages, and a line the filter would change is not sent at all.
- Canned mode (the default, and the safe choice) uses a small set of fixed phrases and needs no API key. It is deliberately very quiet and never repeats a phrase at a table within four hours. A greeting may use the new player’s name, but only if the name looks like a name.
- Model mode (beta) lets a model write short lines about the hand that just ended (Claude Haiku 5.5 by default). Model lines never name or address a player, mention cards only after a showdown and only cards that were shown, and are filtered for talk about being a person or a program, money, results and nudges to keep playing, in English, German, French, Spanish, Italian, Dutch and Portuguese only. This filtering is strong but cannot be guaranteed for free text written by a model; use canned mode if you need certainty. Model mode cannot be saved with another language. It uses your keys, kill switches and the global spend caps, plus its own daily cap (Table talk daily spend cap, $1 by default).
Switching table talk off takes effect for lines already being written, too.
When a player asks whether someone at the table is a bot (in most languages), the answer follows the game setting for the bot badge. With the badge on, one bot answers truthfully from a short fixed set of lines such as "Yes, I’m one of the house bots." (never written by a model). With the badge off, no bot replies, and nothing else changes. No bot ever claims or implies it is a person.
What the capability allows: a plugin with bot table talk can make any house bot seated on your server post in that table’s chat, at any table, private and tournament tables included, and it receives the moderated chat players write at every table on your server. This plugin uses that chat only to notice the "are you a bot?" question and to pace the bots; it never stores it or sends it to a model.
Explanations of a bot’s decisions are for admins only and never shown to players.
Marketing: play against AI
While showAiBadgeToPlayers is on, signed-in players see:
- a "Play against AI" banner at the top of the lobby (headline "Play against Claude & ChatGPT" when a Claude or OpenAI model is seated), listing each table that has an AI bot seated with its model names, linked to the table;
- a one-line teaser under the front-page hero;
- an "AI" badge on AI seats, whose tooltip names the model ("AI · Claude Haiku 5.5").
The banner disappears when no AI table exists or when you turn the player badge setting off; there is no separate switch. It is cached for 15 seconds and never shows configuration, personas or rationales.
Keep the positioning honest. AI bots are entertaining opponents, not strong ones: they play with the same information a human has (their own cards and the table), they are not solvers, and the AI Bots page is marked Beta for that reason. Do not advertise them as unbeatable or as solver-strength.
What it costs
A decision sends roughly 600 to 1,500 input tokens (more on later streets with a long action history and several opponents). Reasoning models add output tokens for their thinking. As a rough guide, per decision:
| Model | About |
|---|---|
| Jev, GPT-6 Luna | $0.0001 or less |
| Claude Haiku 5.5 | $0.0003 to $0.001 |
| Claude Sonnet 5.5 | $0.005 to $0.02 |
| Claude Opus 5.5 | $0.01 to $0.04 |
A bot at a busy six-handed table makes something like 100 decisions an hour, so one bot on Claude Haiku costs in the order of $0.05 to $0.10 an hour, and on Sonnet $0.50 to $2. Use Test decision and the Overview figures to see your real numbers, and set the caps before you assign many bots.
Data and retention
Everything lives in plugin storage. Decision records and daily spend records older than Audit retention (days) (default 7) are deleted every night at 03:15 UTC; month totals are kept for 13 months.
Audit cap and storage. Each node records at most Audit daily cap decisions per UTC day (default 25,000; 500 to 200,000). Once it is reached the Overview and Decisions tabs show "Audit cap reached today: N decisions not recorded. Raise the cap in Settings." and the latency and fallback figures stop updating, while spend keeps being metered. A record is about 750 bytes, mostly the rationale (turning Store rationales off roughly halves it). Worst-case storage per node is 750 B x cap x retention days: with the defaults 25,000 x 7 days is about 130 MB (about 18 MB per day). Raise the cap only as far as your decision volume needs, and lower the retention to bound storage.
Deactivating the plugin keeps the data and every bot plays the engine strategy. Deleting the plugin removes it all.
Troubleshooting
| Symptom | Check |
|---|---|
| Bot never uses the model | Overview: is AI play on, is the provider enabled and configured? Is the bot’s assignment enabled? The Decisions tab shows the fallback reason (missing-key, provider-disabled, daily-cap and so on) |
Many timeout fallbacks | Raise the bot’s time budget, choose a faster model or lower the effort. The engine’s action timer is the upper bound |
breaker-open | The provider failed repeatedly. Use Test decision to see the error, fix it, then Reset breaker |
| OpenAI-compatible URL refused | A local or private address needs Allow private-network base URL |
| Spend shows $0 for a custom model | Add a row for it to Price table override |
See also: Bots, Plugins, and for developers Writing an AI bot provider.