Skip to main content
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

1

Open RooCode Settings

  • Launch RooCode application
  • Click the gear icon ⚙️ (bottom-left corner)
  • Navigate to: Settings → API Configuration
2

Select Provider Type

  • Provider Type: Select OpenAI Compatible
  • This enables custom base URL configuration
  • Allows MegaLLM integration
3

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
4

Choose Default Model

  • Default Model: gpt-5
  • Fallback Model: gpt-4o (optional)
  • Temperature: 0.7 (balanced creativity)
  • Max Tokens: 4096
5

Enable Features

  • Code Completion
  • Chat Interface
  • Code Review
  • Refactoring Assistant
  • Multi-File Edit

Scenario Examples

Scenario 1: First-Time Installation

Complete setup from downloading to first use:
1

Download and Install RooCode

  1. Visit RooCode.io (example URL)
  2. Download for your OS (Windows/macOS/Linux)
  3. Install the application
  4. Launch RooCode
2

Get MegaLLM API Key

  1. Visit MegaLLM Dashboard
  2. Sign up or log in
  3. Navigate to API Keys section
  4. Click Create New Key
  5. Copy the key (starts with sk-mega-)
3

Configure API Provider

In RooCode:
  1. Click ⚙️ Settings icon
  2. Go to API Configuration
  3. Select Provider: OpenAI Compatible
  4. Enter Base URL: https://ai.megallm.io/v1
  5. Paste API Key: sk-mega-your-key
  6. Click Test Connection (should show ✓ Success)
  7. Click Save
4

Choose Your First Model

  1. In Settings → Model Selection
  2. Select: gpt-5 (recommended for general use)
  3. Or browse available models
  4. Set Temperature: 0.7 (balanced)
  5. Save settings
5

Test Configuration

  1. Open a new chat in RooCode
  2. Type: Hello! What model are you using?
  3. Should respond with model information
  4. 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'

Scenario 4: Migration from Cursor/Other AI Tools

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:
1

Export Current Preferences

From Cursor (if possible):
  • Note your preferred models
  • Save any custom prompts
  • Document keyboard shortcuts you use
2

Install RooCode

Download and install RooCode for your OS
3

Configure MegaLLM

{
  "provider": "openai-compatible",
  "api": {
    "baseURL": "https://ai.megallm.io/v1",
    "apiKey": "sk-mega-your-megallm-key",
    "model": "gpt-5"
  }
}
4

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"
  }
}
5

Test Functionality

Compare side-by-side:
  1. Open same code in both tools
  2. Ask same questions
  3. Compare code generation quality
  4. Evaluate response speed
Comparison Table:
FeatureCursorRooCode + MegaLLM
Editor IntegrationVS Code forkStandalone + Any Editor
Models AvailableGPT-4, GPT-3.5GPT, Claude, Gemini, and more
API KeyOpenAI onlyOne key for all models
PricingPer-seat subscriptionPay-per-use
CustomizationLimitedExtensive
Offline ModeNoNo

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:
  1. Click model dropdown (top bar)
  2. Select profile: Fast / Balanced / Quality / Creative / Analysis
  3. 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

TaskRecommended ModelWhy
Quick Completionsgpt-4o-miniFastest, cost-effective
Code Reviewclaude-sonnet-4Excellent analysis
Complex Logicclaude-opus-4-1-20250805Superior reasoning
Web Developmentgpt-5Best for JS/TS/React
Documentationgpt-5Clear, engaging writing
Data Scienceclaude-sonnet-4Strong with pandas/numpy
Systems Codegemini-2.5-proPrecise, mathematical

Verification

Test 1: Chat Functionality

  1. Open RooCode
  2. Click New Chat
  3. Type: Write a function to sort an array of objects by a property
  4. 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

  1. Paste this code:
def divide(a, b):
    return a / b
  1. Click Review Code button
  2. Should identify: Missing zero division check

Test 3: Multi-File Edit

  1. Open multi-file view
  2. Request: “Add error handling to all API calls”
  3. Should show changes across multiple files
  4. 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

Symptoms:
  • “Failed to connect to API”
  • Requests timeout after 30s
  • Chat messages don’t send
Solutions:
  1. 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
    
  2. Test connectivity:
    # Test connection
    curl -I https://ai.megallm.io/v1/models
    
    # Should return: HTTP/2 200
    
  3. Check firewall:
    • Allow RooCode through firewall
    • Check corporate proxy settings
    • Verify no VPN blocking
  4. Increase timeout:
    {
      "api": {
        "timeout": 60000  // Increase to 60 seconds
      }
    }
    
  5. 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:
  1. 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
  2. Check key is active:
    • Login to Dashboard
    • Go to API Keys
    • Verify key shows as “Active”
    • Check it’s not revoked or expired
  3. Re-enter the key:
    • Copy key from dashboard
    • Delete old key from RooCode settings
    • Paste new key
    • Save and restart RooCode
  4. 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:
  1. Provide better context:
    • Set project language in settings
    • Add framework information
    • Use custom prompts
  2. Adjust temperature:
    {
      "api": {
        "temperature": 0.3  // Lower = more focused (0.2-0.4 for code)
      }
    }
    
  3. Try different model:
    {
      "api": {
        "model": "claude-sonnet-4"  // Better for analysis
      }
    }
    
  4. Increase max tokens:
    {
      "api": {
        "maxTokens": 8192  // Longer, more complete responses
      }
    }
    
  5. Use specific prompts:
    {
      "customPrompts": {
        "generate": "Generate production-ready TypeScript code following best practices"
      }
    }
    
Symptoms:
  • Settings revert after restart
  • Changes don’t apply
  • Using default configuration
Solutions:
  1. Check config file location:
    # Should be:
    C:\Users\YourName\AppData\Roaming\RooCode\config.json
    
    # Not:
    C:\Program Files\RooCode\config.json  # Wrong!
    
  2. Validate JSON syntax:
    # Check for errors
    cat config.json | python3 -m json.tool
    
    # Should show formatted JSON or error
    
  3. Check file permissions:
    # Linux/macOS
    chmod 644 ~/.config/RooCode/config.json
    
    # Windows: Ensure user has read/write access
    
  4. Reset to defaults:
    • Backup current config
    • Delete config.json
    • Restart RooCode (creates new config)
    • Reapply settings via UI
Symptoms:
  • RooCode crashes on startup
  • Freezes during long responses
  • Unresponsive UI
Solutions:
  1. Check system resources:
    • Close other applications
    • Ensure 4GB+ RAM available
    • Check CPU usage
  2. Reduce max tokens:
    {
      "api": {
        "maxTokens": 2048  // Reduce from 8192
      }
    }
    
  3. Disable streaming:
    {
      "advanced": {
        "streamResponses": false
      }
    }
    
  4. Clear cache:
    # Windows
    rmdir /s "%APPDATA%\RooCode\cache"
    
    # macOS/Linux
    rm -rf ~/Library/Application\ Support/RooCode/cache
    rm -rf ~/.config/RooCode/cache
    
  5. 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