EasyRouterEasyRouter
Quick StartAPI DocsConnect Agent Tools

CodeBuddy

WorkBuddy / CodeBuddy tutorial โ€” Add EasyRouter as a custom model provider through a local JSON config file, using the OpenAI-compatible Chat Completions API.

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 EasyRouter.

๐Ÿ“ฆ Prerequisites

What you'll need

  • WorkBuddy / CodeBuddy installed
  • An EasyRouter endpoint (must end with /v1)
  • An EasyRouter API key (generated in the console)
  • A model ID exactly matching one exposed by your EasyRouter 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 EasyRouter models:

{
  "models": [
    {
      "id": "claude-sonnet-4-6",
      "name": "Claude Sonnet 4.6 (EasyRouter)",
      "vendor": "EasyRouter",
      "url": "https://easyrouter.io/v1/chat/completions",
      "apiKey": "${EASYROUTER_API_KEY}",
      "maxInputTokens": 200000,
      "maxOutputTokens": 8192,
      "supportsToolCall": true,
      "supportsImages": true
    },
    {
      "id": "gemini-2.5-flash",
      "name": "Gemini 2.5 Flash (EasyRouter)",
      "vendor": "EasyRouter",
      "url": "https://easyrouter.io/v1/chat/completions",
      "apiKey": "${EASYROUTER_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 EasyRouter 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 EASYROUTER_API_KEY="your-easyrouter-api-key"

Windows (PowerShell)

$env:EASYROUTER_API_KEY="your-easyrouter-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 EasyRouter 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 EasyRouter console
Output truncatedRaise maxOutputTokens