AI Companion โ Setup
This page walks you through turning the AI Companion on for your server. For what the Companion is and how it behaves, read the AI Companion concept first.
There are three steps:
- Create an API key with an AI provider (you bring your own).
- Add that key to dzbot under Settings.
- Give the right people the access right.
Step 1 โ Get an API key from a providerโ
The Companion is bring-your-own-key: you choose one provider, create an account there, set up payment, and generate an API key. The provider bills your account directly for usage โ dzbot never charges you for the AI itself.
You only need one provider. Pick whichever you already have an account with, or whichever you prefer. dzbot supports three:
| Provider | Model dzbot uses |
|---|---|
| OpenAI | GPT-5 mini |
| Anthropic | Claude Haiku 4.5 |
| Gemini 2.5 Flash |
These are fast, low-cost models that are more than capable for the Companion's work. You do not choose the model yourself โ dzbot uses the right one for the provider you pick.
The Companion's tasks are small (a few lookups, then some drafting), and these are inexpensive models, so day-to-day cost is typically very low. You control spending entirely through your provider account โ set a budget or spend limit there if you want a hard ceiling.
OpenAIโ
- Create an account at platform.openai.com.
- Open the Billing settings and add a payment method, then add some credit (OpenAI works on a prepaid balance โ start with a small top-up).
- Go to the API keys section and create a new secret key.
- Copy the key immediately โ it is shown only once. It starts with
sk-.
Anthropicโ
- Create an account at console.anthropic.com.
- Open Billing (Plans & Billing) and purchase credits (Anthropic also works on a prepaid balance โ a small amount is enough to start).
- Go to API keys and create a new key.
- Copy the key immediately โ it is shown only once. It starts with
sk-ant-.
Google (Gemini)โ
- Sign in to Google AI Studio (aistudio.google.com) with a Google account.
- Use Get API key to create a key. The key is created inside a Google Cloud project (AI Studio sets one up for you if needed).
- For more than light testing, enable billing on that Google Cloud project so you are on the paid tier with proper rate limits. Google offers a free tier, but it has tight limits and is best treated as a trial.
- Copy the generated key.
An API key is a secret tied to your billing. Don't share it, post it in Discord, or commit it anywhere. If a key leaks, revoke it in the provider's dashboard and create a new one.
Step 2 โ Add the key in dzbotโ
Navigation path:
Server Admin->Settings->Integrations
Find the AI Companion credentials field and:
- Choose your provider from the dropdown (OpenAI, Anthropic, or Google).
- Paste your API key into the key field.
- Click Save.
After saving, the key is masked โ you only ever see a few characters at the start and end (for example sk-โขโขโขโขabcd), never the full value again. To change it later, use Replace key, paste a new one, and save. Changing the provider does not require re-pasting the key unless you actually want to replace it.
Configuring the key requires the admin.settings.edit access right.
Step 3 โ Enable the access rightโ
The Companion only shows up for users who have the AI Companion access right (it lives in the Tickets group of admin rights, as tickets.ai_companion). Grant it to the groups whose members should be able to use the Companion:
Server Admin->Groups-> select a group -> enable AI Companion.
Anyone in a group with this right will see the AI Companion button in the admin header (the sparkles icon, top right) once a key is configured. Users without the right never see it.
For how access rights and groups work in general, see Access control.
Verifying it worksโ
Once a key is saved and you have the access right:
- Reload the admin panel.
- Look for the AI Companion button (sparkles icon) in the top-right header.
- Open it, start a New session, and ask something simple like "search for player <name>".
If you get a sensible answer back, you're set. Head to AI Companion usage to learn what it can do.
Troubleshootingโ
If a session fails, the chat shows a short message describing why:
| Message | What it means | What to do |
|---|---|---|
| Not configured | No provider/key is set for this server | Add a key (Step 2) |
| API key rejected | The stored key is invalid or revoked | A server admin should replace it in Settings |
| Usage or billing limit | The provider reported a quota or billing limit | Top up credit or raise the limit in the provider's dashboard |
| Provider unavailable | A temporary outage at the provider | Wait a moment and try again |
| Maximum steps reached | The task ran long without finishing | Start a new session and break the task into smaller asks |