- AI Chatbot: Real-time conversation threads via command or dedicated channel auto-replies.
- AI Image Generator: Generate custom illustrations inside Discord using the
/imaginecommand.
1. 🔑 Obtaining API Keys
To activate the AI functionalities, you must configure the Google Gemini API key.Step 1: Generate Google Gemini API Key
- Visit Google AI Studio.
- Log in with your Google account.
- Click the Get API Key button (top left).
- Click Create API Key and select a project.
- Copy the generated key.
Step 2: Configure config.js
Open config.js in the root of your project, find the APIs section, and paste your Gemini key:
2. 💬 Setting Up the AI Chatbot
Once the Gemini API key is configured, members can interact with the AI in two ways:Method A: Slash Commands
Users can execute the/ai-config command followed by their question. The bot will trigger a processing state and reply with the AI’s response formatted in a clean embed.
3. 🎨 AI Image Generation (/imagine)
In Razor v2.0.9 and newer, AI image generation is powered by Pollinations AI, a completely free service that requires no API key or setup configuration. Members can generate custom artwork instantly by executing the /imagine command or interacting with the AI Chatbot!
Zero Setup Required (Razor v2.0.9+)
Razor v2.0.9+ works out of the box with zero setup needed for image generation. Built-in NSFW filters and direct image attachments are automatically handled.
Razor v2.0.9+ works out of the box with zero setup needed for image generation. Built-in NSFW filters and direct image attachments are automatically handled.
📜 Legacy Guide: Rsn Labs API Key Setup (Razor v2.0.8 or Older)
Older versions of Razor (v2.0.8 and below) used the Rsn Labs API to handle dynamic image generation. Follow these steps if you are configuring an older version:- Join the Discord Server — Join the official Rsn Labs Discord Server.
- Locate Bot Commands Channel — Head over to the #bot-commands channel.
- Register Account — Run the slash command
/registerwith your email and password: - Generate Key — Execute the slash command
/generate-keyto retrieve your private API key from the Rsn Labs bot. - Configure
config.js— Copy the API key and paste it into theimageGenAPIfield in yourconfig.js:
