Connect Agent Tools

CodeBuddy

**Project Introduction**

CodeBuddy

Project Introduction

WorkBuddy / CodeBuddy is an AI agent and coding assistant that manages available models via a local JSON config file. It talks to models through the standard OpenAI-compatible Chat Completions API, making it easy to point at AutoRouter.

📦 Prerequisites

What you'll need

  • WorkBuddy / CodeBuddy installed
  • An AutoRouter endpoint (must end with /v1)
  • An AutoRouter API key (generated in the console)
  • A model ID exactly matching one exposed by your AutoRouter console (e.g. claude-sonnet-4-6, gemini-2.5-flash)

🚀 Step 1: Edit the model config file

Find the local JSON model config (usually under your user directory). Add the AutoRouter models:

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

Field notes

  • url must be the full Chat Completions endpoint (including /v1/chat/completions)
  • id must match the model ID exposed by your AutoRouter console
  • Adjust maxInputTokens / maxOutputTokens to the real capability of each model
  • availableModels controls which models appear in the UI

🔑 Step 2: Set the API key environment variable

Linux / macOS

export AUTOROUTER_API_KEY="your-autorouter-api-key"

Windows (PowerShell)

$env:AUTOROUTER_API_KEY="your-autorouter-api-key"

Persist it in your shell profile (~/.bashrc / ~/.zshrc / PowerShell Profile) so you don't have to re-export every session.

✅ Step 3: Verify

Launch WorkBuddy / CodeBuddy, pick an AutoRouter model (e.g. claude-sonnet-4-6) from the model switcher, and send a test message:

Write a quicksort implementation in TypeScript.

A normal response means you're set.

❓ Troubleshooting

IssueFix
New model doesn't show in the pickerCheck availableModels contains the ID and restart the app
401 / Invalid API keyConfirm the env var is set and the process picked up the new value
url must end with /chat/completionsUse the full endpoint, not just /v1
Model not foundMake sure id exactly matches your AutoRouter console
Output truncatedRaise maxOutputTokens

On this page