Bring Your Own Key (BYOK)
For server owners who want maximum privacy, isolation, and to bypass the standard CraftyAI rate limits, we offer the BYOK (Bring Your Own Key) feature.
What is BYOK?​
By default, CraftyAI processes requests using our central, private-clustered AI engine. While this is fast and efficient, all requests share the global rate limits of your subscription tier.
With BYOK, you can plug your own Google Gemini API Key directly into the plugin/mod. When configured, CraftyAI will completely bypass our central AI generation engine and communicate directly with Google's API using your personal quota.
Benefits of BYOK​
- Private Quota: You are no longer bound by CraftyAI's tier limits (e.g., 100 requests/day on Free). You are only limited by your Google API quota.
- Data Isolation: Your chat prompts go directly to Google and are never processed by the CraftyAI central engine.
- Cost Control: You manage your own billing and usage limits directly through Google Cloud.
:::caution Usage Responsibility When using BYOK, you are responsible for any costs incurred on your Google API account. CraftyAI is not liable for API charges resulting from player usage on your server. :::
How to Set Up BYOK​
Step 1: Get a Gemini API Key​
- Go to Google AI Studio.
- Sign in with your Google account and create a new API key.
- Copy the key.
Step 2: Configure CraftyAI​
For the Spigot/Paper Plugin (config.yml):
Locate the custom_provider section and update it:
custom_provider:
enabled: true
url: "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent"
api_key: "YOUR_GOOGLE_GEMINI_KEY"
For the Fabric/Forge Mod (craftyai.json):
Add or update these keys in your JSON config:
{
"custom_provider_url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent",
"custom_provider_key": "YOUR_GOOGLE_GEMINI_KEY"
}
Step 3: Reload​
Run /crafty reload or restart your server. All future AI requests will now be routed directly through your Gemini API key!