Documentation Index Fetch the complete documentation index at: https://docs.megallm.io/llms.txt
Use this file to discover all available pages before exploring further.
RooCode is a powerful standalone AI coding assistant application with an interactive chat interface, code review capabilities, and multi-file editing. Configure it to use MegaLLM for access to multiple AI models.
Quick Configuration
Via Application Settings
Via Configuration File
Import Configuration
Step-by-Step Setup
Open RooCode Settings
Launch RooCode application
Click the gear icon ⚙️ (bottom-left corner)
Navigate to: Settings → API Configuration
Select Provider Type
Provider Type : Select OpenAI Compatible
This enables custom base URL configuration
Allows MegaLLM integration
Configure API Endpoint
Base URL : https://ai.megallm.io/v1
API Key : sk-mega-your-api-key-here
Organization : Leave empty (not required)
Click Save
Choose Default Model
Default Model : gpt-5
Fallback Model : gpt-4o (optional)
Temperature : 0.7 (balanced creativity)
Max Tokens : 4096
Enable Features
Code Completion
Chat Interface
Code Review
Refactoring Assistant
Multi-File Edit
Direct File Edit Configuration File Locations: %APPDATA%\RooCode\config.json
# Full path: C:\Users\YourName\AppData\Roaming\RooCode\config.json
Configuration Content: {
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "sk-mega-your-api-key-here" ,
"organization" : "" ,
"model" : "gpt-5" ,
"temperature" : 0.7 ,
"maxTokens" : 4096
},
"features" : {
"codeCompletion" : true ,
"chatInterface" : true ,
"codeReview" : true ,
"refactoring" : true ,
"multiFileEdit" : true
},
"ui" : {
"theme" : "dark" ,
"showInlineHints" : true ,
"autoSaveChats" : true ,
"fontSize" : 14
}
}
After editing the config file, restart RooCode for changes to take effect.
Import Pre-Made Config Step 1 : Create roocode-megallm-config.json{
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "REPLACE_WITH_YOUR_KEY" ,
"model" : "gpt-5"
},
"features" : {
"codeCompletion" : true ,
"chatInterface" : true ,
"codeReview" : true ,
"refactoring" : true
}
}
Step 2 : Import in RooCode
Open RooCode
Go to: File → Import Configuration
Select your roocode-megallm-config.json
Replace REPLACE_WITH_YOUR_KEY with actual API key
Click Apply
Restart RooCode
Configuration imported successfully!
Scenario Examples
Scenario 1: First-Time Installation
Complete setup from downloading to first use:
Download and Install RooCode
Visit RooCode.io (example URL)
Download for your OS (Windows/macOS/Linux)
Install the application
Launch RooCode
Get MegaLLM API Key
Visit MegaLLM Dashboard
Sign up or log in
Navigate to API Keys section
Click Create New Key
Copy the key (starts with sk-mega-)
Configure API Provider
In RooCode:
Click ⚙️ Settings icon
Go to API Configuration
Select Provider : OpenAI Compatible
Enter Base URL : https://ai.megallm.io/v1
Paste API Key : sk-mega-your-key
Click Test Connection (should show ✓ Success)
Click Save
Choose Your First Model
In Settings → Model Selection
Select: gpt-5 (recommended for general use)
Or browse available models
Set Temperature : 0.7 (balanced)
Save settings
Test Configuration
Open a new chat in RooCode
Type: Hello! What model are you using?
Should respond with model information
Try: Write a hello world function in Python
Expected Response: def hello_world ():
print ( "Hello, World!" )
if __name__ == "__main__" :
hello_world()
Scenario 2: Team Setup with Shared Configuration
Set up RooCode for an entire development team:
Scenario: Development team of 10 people need consistent RooCode configuration
Step 1: Team Lead Creates Base Config
team-roocode-config.json:
{
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "TEAM_MEMBER_REPLACES_THIS" ,
"model" : "gpt-5" ,
"temperature" : 0.7 ,
"maxTokens" : 4096
},
"features" : {
"codeCompletion" : true ,
"chatInterface" : true ,
"codeReview" : true ,
"refactoring" : true ,
"multiFileEdit" : true
},
"projectSettings" : {
"language" : "typescript" ,
"framework" : "react" ,
"codingStyle" : "airbnb" ,
"testFramework" : "jest"
},
"customPrompts" : {
"review" : "Review this code following our team's Airbnb style guide and best practices" ,
"test" : "Generate Jest unit tests with at least 80% coverage" ,
"doc" : "Generate JSDoc comments for this function" ,
"refactor" : "Refactor this code for better maintainability and TypeScript strict mode"
},
"ui" : {
"theme" : "dark" ,
"showInlineHints" : true ,
"autoSaveChats" : true ,
"fontSize" : 14
}
}
Step 2: Create Setup Instructions
ROOCODE_SETUP.md:
# RooCode Team Setup Guide
## Prerequisites
- RooCode application installed ([ Download ]( https://roocode.io ))
- MegaLLM API key ([ Get yours ]( https://megallm.io/dashboard ))
## Setup Steps
### 1. Get Your Personal API Key
1. Go to https://megallm.io/dashboard
2. Navigate to **API Keys**
3. Click **Create New Key**
4. Copy your key (starts with `sk-mega-` )
### 2. Import Team Configuration
1. Download `team-roocode-config.json` from this repo
2. Open RooCode
3. Go to: `File → Import Configuration`
4. Select `team-roocode-config.json`
### 3. Add Your Personal API Key
1. After import, go to: `Settings → API Configuration`
2. Replace `TEAM_MEMBER_REPLACES_THIS` with your actual key
3. Click **Test Connection** (should show ✓ Success)
4. Click **Save**
### 4. Restart RooCode
Close and reopen RooCode to apply all settings.
## Verification
1. Open a new chat
2. Type: `Generate a React component for a login form`
3. Should generate TypeScript code following Airbnb style
## Troubleshooting
- **Connection failed** : Check API key is correct
- **Wrong code style** : Verify configuration imported correctly
- **Model errors** : Ensure using `gpt-5` or other supported models
## Support
Contact team lead or check [ MegaLLM Docs ]( https://docs.megallm.io )
Step 3: Distribute to Team
# Team lead commits to repo
git add team-roocode-config.json ROOCODE_SETUP.md
git commit -m "Add RooCode team configuration"
git push
# Team members clone and setup
git pull
# Follow instructions in ROOCODE_SETUP.md
Result: Entire team uses consistent:
Same AI model (gpt-5)
Same temperature and settings
Same custom prompts
Same coding standards
Personal API keys (not shared)
Scenario 3: Project-Specific Configurations
Use different RooCode configurations for different project types:
Python Data Science Project:
roocode-datascience.json:
{
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "${env:MEGALLM_API_KEY}" ,
"model" : "claude-opus-4-1-20250805" ,
"temperature" : 0.5
},
"projectSettings" : {
"language" : "python" ,
"libraries" : [ "numpy" , "pandas" , "scikit-learn" , "matplotlib" ],
"codingStyle" : "pep8"
},
"customPrompts" : {
"analyze" : "Analyze this data processing code for efficiency and correctness" ,
"optimize" : "Optimize this pandas operation for large datasets" ,
"visualize" : "Suggest matplotlib visualization for this data" ,
"doc" : "Generate numpy-style docstring"
}
}
React Web Application:
roocode-webapp.json:
{
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "${env:MEGALLM_API_KEY}" ,
"model" : "gpt-5" ,
"temperature" : 0.7
},
"projectSettings" : {
"language" : "typescript" ,
"framework" : "react" ,
"stateManagement" : "zustand" ,
"styling" : "tailwind"
},
"customPrompts" : {
"component" : "Generate a React functional component with TypeScript and Tailwind" ,
"test" : "Write React Testing Library tests for this component" ,
"hook" : "Create a custom React hook for this functionality" ,
"api" : "Generate API integration with tanstack-query"
}
}
Systems Programming (Rust):
roocode-systems.json:
{
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "${env:MEGALLM_API_KEY}" ,
"model" : "gemini-2.5-pro" ,
"temperature" : 0.3
},
"projectSettings" : {
"language" : "rust" ,
"codingStyle" : "rust-fmt"
},
"customPrompts" : {
"review" : "Review this Rust code for memory safety and performance" ,
"optimize" : "Suggest optimizations for this performance-critical code" ,
"test" : "Generate comprehensive Rust tests" ,
"unsafe" : "Analyze this unsafe block for correctness"
}
}
Switching Between Projects:
# Create aliases in ~/.bashrc or ~/.zshrc
alias roocode-ds = 'cp ~/configs/roocode-datascience.json ~/.config/RooCode/config.json && roocode'
alias roocode-web = 'cp ~/configs/roocode-webapp.json ~/.config/RooCode/config.json && roocode'
alias roocode-sys = 'cp ~/configs/roocode-systems.json ~/.config/RooCode/config.json && roocode'
Switching from another AI coding tool to RooCode with MegaLLM:
Current Setup: Using Cursor with OpenAI
Why Switch to RooCode + MegaLLM:
Access to multiple models (GPT, Claude, Gemini) with one key
Standalone app (not tied to specific editor)
Better pricing and no seat limits
More customization options
Migration Steps:
Export Current Preferences
From Cursor (if possible):
Note your preferred models
Save any custom prompts
Document keyboard shortcuts you use
Install RooCode
Download and install RooCode for your OS
Configure MegaLLM
{
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "sk-mega-your-megallm-key" ,
"model" : "gpt-5"
}
}
Recreate Custom Prompts
Add your frequently used prompts: {
"customPrompts" : {
"explain" : "Explain this code in detail" ,
"fix" : "Find and fix bugs in this code" ,
"improve" : "Suggest improvements for this code"
}
}
Test Functionality
Compare side-by-side:
Open same code in both tools
Ask same questions
Compare code generation quality
Evaluate response speed
Comparison Table:
Feature Cursor RooCode + MegaLLM Editor Integration VS Code fork Standalone + Any Editor Models Available GPT-4, GPT-3.5 GPT, Claude, Gemini, and more API Key OpenAI only One key for all models Pricing Per-seat subscription Pay-per-use Customization Limited Extensive Offline Mode No No
Scenario 5: Multi-Model Workflow
Use different models for different types of tasks:
Configuration with Model Profiles:
{
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "sk-mega-your-api-key-here" ,
"model" : "gpt-5"
},
"modelProfiles" : {
"fast" : {
"model" : "gpt-4o-mini" ,
"temperature" : 0.5 ,
"maxTokens" : 1000 ,
"description" : "Fast completions for simple tasks"
},
"balanced" : {
"model" : "gpt-5" ,
"temperature" : 0.7 ,
"maxTokens" : 4096 ,
"description" : "Balanced quality and speed"
},
"quality" : {
"model" : "claude-opus-4-1-20250805" ,
"temperature" : 0.3 ,
"maxTokens" : 8192 ,
"description" : "Highest quality for complex tasks"
},
"creative" : {
"model" : "gpt-5" ,
"temperature" : 0.9 ,
"maxTokens" : 4096 ,
"description" : "Creative documentation and naming"
},
"analysis" : {
"model" : "claude-sonnet-4" ,
"temperature" : 0.4 ,
"maxTokens" : 6000 ,
"description" : "Code review and analysis"
}
}
}
Workflow Example:
Morning: Rapid Prototyping
→ Switch to "fast" profile (gpt-4o-mini)
→ Quick code generation
→ Fast iterations
Afternoon: Production Code
→ Switch to "quality" profile (claude-opus-4)
→ Generate production-ready code
→ Comprehensive error handling
Code Review Time
→ Switch to "analysis" profile (claude-sonnet-4)
→ Detailed code reviews
→ Security analysis
Documentation
→ Switch to "creative" profile (gpt-5, high temp)
→ Generate engaging docs
→ Creative naming suggestions
Switching Profiles in RooCode:
Click model dropdown (top bar)
Select profile: Fast / Balanced / Quality / Creative / Analysis
Profile applied to current session
Scenario 6: CI/CD Integration
Use RooCode API for automated code reviews in CI/CD:
GitHub Actions Example:
.github/workflows/roocode-review.yml:
name : AI Code Review with RooCode
on :
pull_request :
types : [ opened , synchronize ]
jobs :
ai-review :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- name : Setup RooCode CLI
run : |
curl -O https://roocode.io/cli/install.sh
bash install.sh
- name : Configure MegaLLM
env :
MEGALLM_API_KEY : ${{ secrets.MEGALLM_API_KEY }}
run : |
mkdir -p ~/.config/RooCode
cat > ~/.config/RooCode/config.json << EOF
{
"provider": "openai-compatible",
"api": {
"baseURL": "https://ai.megallm.io/v1",
"apiKey": "$MEGALLM_API_KEY",
"model": "claude-sonnet-4"
}
}
EOF
- name : Run AI Code Review
run : |
roocode review \
--files "$(git diff --name-only origin/main...HEAD)" \
--output review.md
- name : Post Review Comment
uses : actions/github-script@v6
with :
script : |
const fs = require('fs');
const review = fs.readFileSync('review.md', 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## AI Code Review\n\n${review}`
});
Configuration Options
Complete Reference
{
// API Configuration
"provider" : "openai-compatible" ,
"api" : {
"baseURL" : "https://ai.megallm.io/v1" ,
"apiKey" : "sk-mega-your-api-key-here" ,
"organization" : "" ,
"model" : "gpt-5" ,
"temperature" : 0.7 ,
"maxTokens" : 4096 ,
"topP" : 0.9 ,
"frequencyPenalty" : 0.0 ,
"presencePenalty" : 0.0 ,
"timeout" : 30000
},
// Feature Toggles
"features" : {
"codeCompletion" : true ,
"chatInterface" : true ,
"codeReview" : true ,
"refactoring" : true ,
"multiFileEdit" : true ,
"contextAwareness" : true ,
"autoSave" : true
},
// Project Settings
"projectSettings" : {
"language" : "typescript" ,
"framework" : "react" ,
"codingStyle" : "airbnb" ,
"testFramework" : "jest" ,
"linter" : "eslint"
},
// Custom Prompts
"customPrompts" : {
"review" : "Review code for bugs and best practices" ,
"test" : "Generate comprehensive unit tests" ,
"doc" : "Generate detailed documentation" ,
"refactor" : "Refactor for better maintainability" ,
"optimize" : "Optimize for performance" ,
"secure" : "Analyze for security vulnerabilities"
},
// UI Preferences
"ui" : {
"theme" : "dark" ,
"fontSize" : 14 ,
"fontFamily" : "Fira Code" ,
"showInlineHints" : true ,
"showLineNumbers" : true ,
"autoSaveChats" : true ,
"chatPosition" : "right" ,
"enableAnimations" : true
},
// Keyboard Shortcuts
"shortcuts" : {
"newChat" : "Cmd+N" ,
"sendMessage" : "Cmd+Enter" ,
"clearChat" : "Cmd+K" ,
"switchModel" : "Cmd+M" ,
"openSettings" : "Cmd+,"
},
// Advanced
"advanced" : {
"logLevel" : "info" ,
"cacheResponses" : true ,
"maxChatHistory" : 100 ,
"contextWindowSize" : 8000 ,
"streamResponses" : true
}
}
Model Selection Guide
Task Recommended Model Why Quick Completions gpt-4o-miniFastest, cost-effective Code Review claude-sonnet-4Excellent analysis Complex Logic claude-opus-4-1-20250805Superior reasoning Web Development gpt-5Best for JS/TS/React Documentation gpt-5Clear, engaging writing Data Science claude-sonnet-4Strong with pandas/numpy Systems Code gemini-2.5-proPrecise, mathematical
Verification
Test 1: Chat Functionality
Open RooCode
Click New Chat
Type: Write a function to sort an array of objects by a property
Should receive working code
Expected Response:
function sortByProperty ( array , property ) {
return array . sort (( a , b ) => {
if ( a [ property ] < b [ property ]) return - 1 ;
if ( a [ property ] > b [ property ]) return 1 ;
return 0 ;
});
}
Test 2: Code Review
Paste this code:
def divide ( a , b ):
return a / b
Click Review Code button
Should identify: Missing zero division check
Test 3: Multi-File Edit
Open multi-file view
Request: “Add error handling to all API calls”
Should show changes across multiple files
Review and apply changes
Test 4: Connection Status
Check status indicator (top-right):
🟢 Green = Connected to MegaLLM
🟡 Yellow = Connecting…
🔴 Red = Connection failed
Click status to see:
Model: gpt-5
Endpoint: https://ai.megallm.io/v1
Token usage: Current session stats
Troubleshooting
Connection timeout errors
Symptoms:
“Failed to connect to API”
Requests timeout after 30s
Chat messages don’t send
Solutions:
Verify base URL is correct:
https://ai.megallm.io/v1 <Icon icon="check" /> Correct
https://ai.megallm.io <Icon icon="xmark" /> Missing /v1
https://api.openai.com/v1 <Icon icon="xmark" /> Wrong endpoint
Test connectivity:
# Test connection
curl -I https://ai.megallm.io/v1/models
# Should return: HTTP/2 200
Check firewall:
Allow RooCode through firewall
Check corporate proxy settings
Verify no VPN blocking
Increase timeout:
{
"api" : {
"timeout" : 60000 // Increase to 60 seconds
}
}
Test API key manually:
curl -X POST https://ai.megallm.io/v1/chat/completions \
-H "Authorization: Bearer $MEGALLM_API_KEY " \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"test"}]}'
Symptoms:
“Invalid API key” error
401 Unauthorized
Authentication failed
Solutions:
Verify key format:
Must start with sk-mega-
Should be 60+ characters
No extra spaces or line breaks
No quotes in config file around the actual key
Check key is active:
Login to Dashboard
Go to API Keys
Verify key shows as “Active”
Check it’s not revoked or expired
Re-enter the key:
Copy key from dashboard
Delete old key from RooCode settings
Paste new key
Save and restart RooCode
Test key directly:
curl -H "Authorization: Bearer sk-mega-your-actual-key" \
https://ai.megallm.io/v1/models
# Should return JSON list of models
Symptoms:
Irrelevant code suggestions
Wrong programming language
Incomplete responses
Solutions:
Provide better context:
Set project language in settings
Add framework information
Use custom prompts
Adjust temperature:
{
"api" : {
"temperature" : 0.3 // Lower = more focused (0.2-0.4 for code)
}
}
Try different model:
{
"api" : {
"model" : "claude-sonnet-4" // Better for analysis
}
}
Increase max tokens:
{
"api" : {
"maxTokens" : 8192 // Longer, more complete responses
}
}
Use specific prompts:
{
"customPrompts" : {
"generate" : "Generate production-ready TypeScript code following best practices"
}
}
Configuration not loading
Symptoms:
Settings revert after restart
Changes don’t apply
Using default configuration
Solutions:
Check config file location:
# Should be:
C:\Users\YourName\AppData\Roaming\RooCode\config.json
# Not:
C:\Program Files \R ooCode \c onfig.json # Wrong!
Validate JSON syntax:
# Check for errors
cat config.json | python3 -m json.tool
# Should show formatted JSON or error
Check file permissions:
# Linux/macOS
chmod 644 ~/.config/RooCode/config.json
# Windows: Ensure user has read/write access
Reset to defaults:
Backup current config
Delete config.json
Restart RooCode (creates new config)
Reapply settings via UI
Application crashes or freezes
Symptoms:
RooCode crashes on startup
Freezes during long responses
Unresponsive UI
Solutions:
Check system resources:
Close other applications
Ensure 4GB+ RAM available
Check CPU usage
Reduce max tokens:
{
"api" : {
"maxTokens" : 2048 // Reduce from 8192
}
}
Disable streaming:
{
"advanced" : {
"streamResponses" : false
}
}
Clear cache:
# Windows
rmdir /s "%APPDATA%\RooCode\cache"
# macOS/Linux
rm -rf ~/Library/Application \ Support/RooCode/cache
rm -rf ~/.config/RooCode/cache
Reinstall RooCode:
Backup config.json
Uninstall RooCode
Download latest version
Install and restore config
Best Practices
Project Configurations Create separate configs for different project types
Model Profiles Set up profiles for different tasks: fast, quality, creative
Custom Prompts Define reusable prompts for common tasks
Monitor Usage Check Dashboard regularly for token usage
Backup Configs Keep backups of working configurations
Security Use environment variables for API keys in shared configs
Advanced Tips
Environment Variables
RooCode supports environment variable substitution:
{
"api" : {
"apiKey" : "${env:MEGALLM_API_KEY}" ,
"baseURL" : "${env:MEGALLM_BASE_URL}"
}
}
Set variables:
export MEGALLM_API_KEY = "sk-mega-your-key"
export MEGALLM_BASE_URL = "https://ai.megallm.io/v1"
Context Management
Improve responses with better context:
{
"advanced" : {
"contextWindowSize" : 16000 ,
"includeProjectStructure" : true ,
"includeOpenFiles" : true ,
"maxRelevantFiles" : 10
}
}
Response Caching
Save API costs with intelligent caching:
{
"advanced" : {
"cacheResponses" : true ,
"cacheExpiry" : 3600 , // seconds
"maxCacheSize" : 100 // MB
}
}
Next Steps
Kilocode Setup Configure Kilocode VSCode extension
Cline Setup Configure Cline VSCode extension
Models Catalog Browse all available models
Other Agents View all CLI and GUI agents
API Reference Explore the API docs
Discord Community Join for support