xAI Grok Setup
xAI Grok is accessible via the official xAI Console and offers outstanding compliance with formatting templates. It is an excellent cloud choice for developers looking for highly creative and clean categorizations.
1. Getting an API Key
[!WARNING] xAI API keys require a funded billing account on the xAI Console. Check your account settings to ensure you have active credits before testing the connection.
- Navigate to the xAI Console.
- Log in using your X (Twitter) or xAI developer account.
- Add billing credits in the billing menu.
- Navigate to the API Keys section.
- Click Create API Key and copy the resulting string (starts with
xai-).
2. Configuring Unity
- Open Unity Project Settings:
Edit ➔ Project Settings... - Select AI Scene Organizer from the left-hand panel.
- Select
Grokin the Active Provider dropdown. - Paste the API key into the Grok API Key input.
- Click Apply & Save Settings.
3. Recommended Models
Specify the desired Grok model ID in the settings:
grok-3-mini: Fast responses, low latency, and superb structuring accuracy. (Recommended for general scene sorting)grok-3: Ultra-high intelligence, ideal for complex categorizations and parsing large layouts.
4. Troubleshooting Grok Connection
- Error
401 Invalid API Key: Double-check the key starts withxai-and is active in your console. - Error
429 Quota Limit: Your prepay credit has run out or you are rate-limited on the free trial. Ensure you have pre-funded credits.