Skip to content

CodeBuddy

WorkBuddy / CodeBuddy is an AI agent + coding assistant that loads model providers from a local JSON config file. Since it speaks OpenAI-compatible Chat Completions, plugging in WRouter is a config edit.

Prerequisites

ItemRequirement
WorkBuddy / CodeBuddyInstalled
WRouterA working sk- token

Configure

Find CodeBuddy's local model config JSON (usually in your user directory) and add WRouter models:

json
{
  "models": [
    {
      "id": "claude-sonnet-4-6",
      "name": "Claude Sonnet 4.6 (wrouter)",
      "vendor": "wrouter",
      "url": "https://wrouter.ai/v1/chat/completions",
      "apiKey": "${WROUTER_API_KEY}",
      "maxInputTokens": 200000,
      "maxOutputTokens": 8192,
      "supportsToolCall": true,
      "supportsImages": true
    },
    {
      "id": "gemini-2.5-flash",
      "name": "Gemini 2.5 Flash (wrouter)",
      "vendor": "wrouter",
      "url": "https://wrouter.ai/v1/chat/completions",
      "apiKey": "${WROUTER_API_KEY}",
      "maxInputTokens": 1000000,
      "maxOutputTokens": 8192,
      "supportsToolCall": true,
      "supportsImages": false
    }
  ],
  "availableModels": [
    "claude-sonnet-4-6",
    "gemini-2.5-flash"
  ]
}

Field notes:

FieldNote
urlFull Chat Completions endpoint (include /v1/chat/completions)
idMust match the model ID in your WRouter console
maxInputTokens / maxOutputTokensTune to actual model capability
availableModelsControls which models show in CodeBuddy's UI picker

Set the API key

macOS / Linux

bash
export WROUTER_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Windows (PowerShell)

powershell
$env:WROUTER_API_KEY="sk-xxxx..."

Persist it in your shell profile so the value survives restarts.

Verify

Restart CodeBuddy, pick a WRouter model, and send a test prompt.

Known limitations

  • CodeBuddy only reads OpenAI Chat Completions format; Anthropic-specific features (extended thinking, cache_control) won't surface here. Use Claude Code for those.