Razor features a built-in AI module powered by leading large language models (Google Gemini, OpenAI, and Anthropic). It supports two primary systems:
  1. AI Chatbot: Real-time conversation threads via command or dedicated channel auto-replies.
  2. AI Image Generator: Generate custom illustrations inside Discord using the /imagine command.

1. 🔑 Obtaining API Keys

To activate the AI functionalities, you must configure the Google Gemini API key.

Step 1: Generate Google Gemini API Key

  1. Visit Google AI Studio.
  2. Log in with your Google account.
  3. Click the Get API Key button (top left).
  4. Click Create API Key and select a project.
  5. 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:
  // APIs
  gemini_api: "PASTE_YOUR_GEMINI_API_KEY_HERE",   // Critical: For AI chat

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!
/imagine prompt:A futuristic cybernetic city under neon rain, detailed, 4k
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.

📜 Legacy Guide: Rsn Labs API Key Setup (Razor v2.0.8 or Older)

Legacy Instructions (Razor v2.0.8 or older)
This guide is exclusively for users running Razor v2.0.8 or older. If you are using Razor v2.0.9 or newer, no API key is needed and you can ignore the steps below.
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:
  1. Join the Discord Server — Join the official Rsn Labs Discord Server.
  2. Locate Bot Commands Channel — Head over to the #bot-commands channel.
  3. Register Account — Run the slash command /register with your email and password:
    /register email:your_email@example.com password:your_secure_password
    
  4. Generate Key — Execute the slash command /generate-key to retrieve your private API key from the Rsn Labs bot.
  5. Configure config.js — Copy the API key and paste it into the imageGenAPI field in your config.js:
    // APIs
    imageGenAPI: "PASTE_YOUR_RSN_LABS_API_KEY_HERE",