Skip to main content

Getting Your API Key

Your API key is what tells our servers "this Minecraft server is allowed to use CraftyAI." Every server gets its own key, and keys are free.

When you start your server for the first time, the plugin generates a key and prints it to the console. You'll see a line that looks like this:

[CraftyAI] Your new API key: cai_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In CraftyAI v1.3.0+, the key is saved directly to your config automatically — you don't need to copy it manually. Just start the server and the plugin handles everything.

If you're on an older version or need to paste it manually:

  • Plugin: Paste it into plugins/CraftyAI/config.yml under server.secret
  • Mod: Press M in-game to open the settings screen, paste it in the API Key field, and click Save

The key shows in the console only once. If you lose it, run /crafty apikey in-game and a new one will be printed.

Method 2: Discord bot

If you'd rather get the key through Discord:

  1. Join our Discord
  2. Find the CraftyAI bot in #crafty and click "Get API Key"
  3. It will ask for your Session ID, which is printed in your server console when CraftyAI starts
  4. The bot DMs you the new key

What the key does

The key authenticates your server with our backend. CraftyAI rate-limits by key, so each server gets its own quota. Keys are tied to your session and can be rotated any time.

If you think your key leaked, run /crafty apikey in-game. It generates a fresh one and invalidates the old.

Where do I find my Session ID?

If you used Method 1 (auto-mint), you don't need it, your session was created with the same startup that printed the key.

If you used Method 2 or need it for Discord, start your server. The Session ID prints to the console on startup. It looks like srv-xxxxxxxx.