Skip to main content
MegaLLM supports all major AI coding agents. This unified guide covers configuration for Claude Code, Codex/Windsurf, OpenCode, Kilocode, RooCode, and Cline.

Available Agents

Quick Comparison

AgentInterfacesConfig FormatConfig LevelBest For
Claude CodeCLI + VSCodeJSONSystem + ProjectTerminal workflows, VSCode integration
Codex/WindsurfCLI + EditorTOMLSystem onlyAdvanced users, Cascade AI
OpenCodeCLI + EditorJSONSystem + ProjectMulti-model switching, flexibility
KilocodeVSCode (CLI soon)VSCode settingsUser + WorkspaceInline chat, code completion
RooCodeStandalone appJSONApp-levelVisual UI, standalone workflow
ClineVSCode (CLI soon)VSCode settingsUser + WorkspaceAutonomous tasks, terminal ops

Agent Types

CLI-First Agents (with Editor Support)

https://mintcdn.com/ghostlyticspaymentspvtltd/I3Glsm29CAoCIpN0/logo/claude.svg?fit=max&auto=format&n=I3Glsm29CAoCIpN0&q=85&s=26979b4ab3c813d61504095afb8bb1a1

Claude Code

  • CLI-first design
  • VSCode extension available
  • JSON configuration
  • System & project-level
  • Statusline support
https://mintcdn.com/ghostlyticspaymentspvtltd/F9nt7LOHihlPvM1P/logo/codex.svg?fit=max&auto=format&n=F9nt7LOHihlPvM1P&q=85&s=5bbd1c4feca6af0fbfac0ad765b1696b

Codex/Windsurf

  • CLI-first design
  • Editor integrations
  • TOML configuration
  • Cascade AI (Windsurf)
  • Supercomplete features
https://mintcdn.com/ghostlyticspaymentspvtltd/I3Glsm29CAoCIpN0/logo/opencode.svg?fit=max&auto=format&n=I3Glsm29CAoCIpN0&q=85&s=790702f153dab69c5961a9cf9e9db7af

OpenCode

  • CLI-first design
  • Editor plugins available
  • JSON configuration
  • Auto-fetch models
  • Multi-provider support
When to use CLI-first agents:
  • Terminal-based workflows
  • CI/CD integration
  • Server environments
  • Scripting and automation
  • Also work great in editors with extensions

Editor-Only Agents (CLI Coming Soon)

https://mintcdn.com/ghostlyticspaymentspvtltd/I3Glsm29CAoCIpN0/logo/kilocode.svg?fit=max&auto=format&n=I3Glsm29CAoCIpN0&q=85&s=99525076c0546a882a8c731ec28759ac

Kilocode

  • VSCode extension (primary)
  • CLI under maintenance
  • Inline chat interface
  • Code completion
  • File tree integration
https://mintcdn.com/ghostlyticspaymentspvtltd/I3Glsm29CAoCIpN0/logo/roocode.svg?fit=max&auto=format&n=I3Glsm29CAoCIpN0&q=85&s=1517c9f8fa0cb55b8b3409f52e8c172f

RooCode

  • Standalone app
  • Visual interface
  • Multi-project support
  • Code review features
https://mintcdn.com/ghostlyticspaymentspvtltd/I3Glsm29CAoCIpN0/logo/cline.svg?fit=max&auto=format&n=I3Glsm29CAoCIpN0&q=85&s=1f96191dea05c752380d70e31187bf72

Cline

  • VSCode extension (primary)
  • CLI under maintenance
  • Autonomous task execution
  • Terminal integration
  • Git workflow support
CLI Support for Kilocode & Cline: CLI versions are currently under maintenance and will be available soon. Use the VSCode extensions in the meantime.
When to use editor-focused agents:
  • Pure visual editing workflows
  • Inline suggestions and completions
  • Multi-file refactoring
  • Code review workflows
  • IDE-native experience

Getting Started

1

Choose Your Agent

Select a CLI agent for terminal workflows or a GUI agent for visual editing
2

Get Your API Key

Sign up at MegaLLM Dashboard and get your API key starting with sk-mega-
3

Configure Your Agent

Follow the specific configuration guide for your chosen agent (linked below)
4

Start Coding

Launch your agent and start using AI-powered coding assistance

Configuration Guides

CLI-First Agents (also work in editors)

Works as: CLI tool + VSCode extensionConfiguration files:
  • System: ~/.claude/settings.json
  • Project: ./.claude/settings.json
  • Local: ./.claude/settings.local.json
Quick setup:
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://ai.megallm.io",
    "ANTHROPIC_API_KEY": "sk-mega-your-api-key-here"
  }
}
Full Claude Code Configuration Guide →
Works as: CLI tool + Editor integrations (Windsurf is enhanced variant)Configuration file:
  • System: ~/.codex/config.toml (only)
Quick setup:
model_provider = "megallm"
model = "gpt-5"

[model_providers.megallm]
name = "OpenAI using Chat Completions"
base_url = "https://ai.megallm.io/v1"
env_key = "MEGALLM_API_KEY"

[tools]
web_search = true
file_browser = true
Full Codex/Windsurf Configuration Guide →
Works as: CLI tool + Editor plugins (VSCode, Vim, etc.)Configuration files:
  • System: ~/.config/opencode/opencode.json
  • Project: ./.opencode/opencode.json
Quick setup:
{
  "providers": [
    {
      "id": "megallm",
      "name": "MegaLLM",
      "type": "openai",
      "baseURL": "https://ai.megallm.io/v1",
      "apiKey": "sk-mega-your-api-key-here"
    }
  ],
  "defaultProvider": "megallm"
}
Full OpenCode Configuration Guide →

Editor-Only Agents

Configuration location:
  • User Settings (global): VSCode Settings UI or settings.json
  • Workspace Settings (project): .vscode/settings.json
Quick setup (settings.json):
{
  "kilocode.apiProvider": "custom",
  "kilocode.customProvider": {
    "name": "MegaLLM",
    "baseURL": "https://ai.megallm.io/v1",
    "apiKey": "${env:MEGALLM_API_KEY}"
  },
  "kilocode.defaultModel": "gpt-5"
}
Environment variable:
export MEGALLM_API_KEY="sk-mega-your-api-key-here"
Full Kilocode Configuration Guide →
Configuration location:
  • Windows: %APPDATA%\RooCode\config.json
  • macOS: ~/Library/Application Support/RooCode/config.json
  • Linux: ~/.config/roocode/config.json
Quick setup:
{
  "provider": "openai-compatible",
  "api": {
    "baseURL": "https://ai.megallm.io/v1",
    "apiKey": "sk-mega-your-api-key-here",
    "model": "gpt-5"
  },
  "features": {
    "codeCompletion": true,
    "chatInterface": true,
    "codeReview": true,
    "terminalIntegration": false
  }
}
Full RooCode Configuration Guide →
Configuration location:
  • User Settings (global): VSCode Settings UI or settings.json
  • Workspace Settings (project): .vscode/settings.json
Quick setup for GPT models (OpenAI format):
{
  "cline.apiProvider": "openai",
  "cline.openai": {
    "apiKey": "${env:MEGALLM_API_KEY}",
    "baseURL": "https://ai.megallm.io/v1"
  },
  "cline.defaultModel": "gpt-5"
}
Quick setup for Claude models (Anthropic format):
{
  "cline.apiProvider": "anthropic",
  "cline.anthropic": {
    "apiKey": "${env:MEGALLM_API_KEY}",
    "baseURL": "https://ai.megallm.io"
  },
  "cline.defaultModel": "claude-sonnet-4"
}
Environment variable:
export MEGALLM_API_KEY="sk-mega-your-api-key-here"
Full Cline Configuration Guide →

Model Selection

All agents support the same models through MegaLLM:

GPT Models

  • gpt-5 - Latest GPT model (recommended)
  • gpt-4 - GPT-4
  • gpt-4o - GPT-4 Optimized
  • gpt-4o-mini - Fast, cost-effective

Claude Models

  • claude-opus-4-1-20250805 - Most capable
  • claude-sonnet-4 - Balanced (recommended)
  • claude-haiku-4 - Fast, efficient

Gemini Models

  • gemini-2.5-pro - Latest Gemini
  • gemini-2.0-flash - Fast responses
See Full Model Catalog →

Environment Variables

Most agents support environment variables for API keys:
# For CLI agents and some GUI agents
export MEGALLM_API_KEY="sk-mega-your-api-key-here"

# For Claude Code specifically
export ANTHROPIC_BASE_URL="https://ai.megallm.io"
export ANTHROPIC_API_KEY="sk-mega-your-api-key-here"
Add to your shell configuration:
  • Bash: ~/.bashrc
  • Zsh: ~/.zshrc
  • Fish: ~/.config/fish/config.fish

Common Configuration Patterns

Pattern 1: System-Level for Personal Use

Best for: Personal projects, single user
  • Claude Code
  • Kilocode
  • RooCode
# System configuration
~/.claude/settings.json

# Environment variables
export ANTHROPIC_BASE_URL="https://ai.megallm.io"
export ANTHROPIC_API_KEY="sk-mega-your-key"

Pattern 2: Project-Level for Teams

Best for: Team projects, shared configuration
  • Claude Code
  • Kilocode
  • OpenCode
# Shared config (committed)
.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://ai.megallm.io"
  }
}

# Personal key (not committed)
.claude/settings.local.json
{
  "env": {
    "ANTHROPIC_API_KEY": "your-personal-key"
  }
}

# .gitignore
.claude/settings.local.json

Pattern 3: Multi-Model Configuration

Best for: Using different models for different tasks
  • OpenCode
  • RooCode
{
  "providers": [
    {
      "id": "megallm-gpt",
      "type": "openai",
      "baseURL": "https://ai.megallm.io/v1",
      "models": ["gpt-5", "gpt-4o"]
    },
    {
      "id": "megallm-claude",
      "type": "anthropic",
      "baseURL": "https://ai.megallm.io",
      "models": ["claude-sonnet-4", "claude-opus-4"]
    }
  ]
}

Troubleshooting

Verify your API key:
# Check it starts with sk-mega-
echo $MEGALLM_API_KEY

# Test the API directly
curl -H "Authorization: Bearer $MEGALLM_API_KEY" \
     https://ai.megallm.io/v1/models
Common issues:
  • Missing sk-mega- prefix
  • Extra spaces or quotes
  • Wrong environment variable name
  • Shell config not reloaded (run source ~/.bashrc)
Check your base URL:For OpenAI-compatible format (GPT, Gemini):
https://ai.megallm.io/v1  <Icon icon="check" /> (with /v1)
For Anthropic format (Claude):
https://ai.megallm.io  <Icon icon="check" /> (no /v1)
Agent-specific endpoints:
  • Claude Code: https://ai.megallm.io (no /v1)
  • Codex/Windsurf: https://ai.megallm.io/v1
  • OpenCode: https://ai.megallm.io/v1
  • Kilocode: https://ai.megallm.io/v1
  • RooCode: https://ai.megallm.io/v1
  • Cline: https://ai.megallm.io (Anthropic) or https://ai.megallm.io/v1 (OpenAI)
Verify model name spelling:Check Models Catalog for exact model names:
# Common mistakes:
"gpt5"           <Icon icon="xmark" />  # Missing dash
"gpt-5"          <Icon icon="check" />

"claude-sonnet"  <Icon icon="xmark" />  # Missing version
"claude-sonnet-4" <Icon icon="check" />

"gemini-pro"     <Icon icon="xmark" />  # Wrong version
"gemini-2.5-pro" <Icon icon="check" />
Check file locations:
# CLI agents
ls -la ~/.claude/settings.json      # Claude Code
ls -la ~/.codex/config.toml         # Codex
ls -la ~/.config/opencode/           # OpenCode

# Project configs
ls -la .claude/settings.json         # Claude Code
ls -la .opencode/opencode.json       # OpenCode
ls -la .vscode/settings.json         # VSCode extensions

# Validate JSON/TOML syntax
jq . ~/.claude/settings.json         # Test JSON
cat ~/.codex/config.toml | grep -    # Test TOML
Check permissions:
chmod 644 ~/.claude/settings.json
chmod 644 ~/.codex/config.toml
Reload your shell config:
# Bash
source ~/.bashrc

# Zsh
source ~/.zshrc

# Fish
source ~/.config/fish/config.fish

# Verify
echo $MEGALLM_API_KEY
echo $ANTHROPIC_BASE_URL
Check where it’s defined:
# Search all shell configs
grep -r "MEGALLM_API_KEY" ~/.*rc ~/.config/

Feature Comparison

Interfaces & Usage

AgentCLI AvailableEditor/GUIChat InterfaceMulti-file Edit
Claude Code  Primary  VSCode ext  CLI + GUI
Codex/Windsurf  Primary  Editor  CLI + GUI
OpenCode  Primary  Plugins  CLI + GUI
Kilocode  Coming soon  VSCode only  GUI
RooCode  Standalone  GUI
Cline  Coming soon  VSCode only  GUI

Integrations

AgentTerminal AccessGit IntegrationFile TreeCode Review
Claude Code  Native CLI  Native  In editor
Codex/Windsurf  Native CLI  Native  In editor
OpenCode  Native CLI  Native  In editor
Kilocode  Via VSCode  VSCode
RooCode  Built-in  Built-in
Cline  VSCode term  VSCode

Configuration Flexibility

AgentSystem ConfigProject ConfigEnv VarsTeam Sharing
Claude Code
Codex/Windsurf  Limited
OpenCode
Kilocode
RooCode  Import  Limited  Export
Cline

Best Practices

Use Environment Variables

Store API keys in environment variables, never commit them to version control

Project-Level for Teams

Use project-level config for shared settings, local files for personal keys

Choose Right Agent

CLI for automation/CI/CD, GUI for interactive coding and visual workflows

Test Configuration

Verify API connection with curl before configuring agents

Keep Keys Secure

Add sensitive files to .gitignore, use different keys for dev/prod

Regular Updates

Keep agents updated for latest features, security patches, and bug fixes

Next Steps