EasyRouterEasyRouter
Quick StartAPI DocsConnect Agent Tools

nanobot

nanobot tutorial โ€” Lightweight AI agent that reads its API endpoint from a single config.json, making EasyRouter integration trivial.

Project Introduction

nanobot is a lightweight AI agent that plugs into common chat tools. Configuration lives in a single config.json, so pointing it at EasyRouter is a two-line change. It relies on uv for Python environment management, keeping install and launch simple.

๐Ÿ“ฆ Prerequisites

What you'll need

  • uv 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: Install nanobot

uv tool install nanobot-ai

Extra step for Windows

Add .local/bin to your PATH so the nanobot command is directly callable:

$env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH"

Consider persisting it in your PowerShell Profile.

Verify

nanobot --version

๐Ÿ”ง Step 2: Initialise & edit config

1. Generate the default config

nanobot onboard

The config file is created at:

  • Windows: %USERPROFILE%\.nanobot\config.json
  • Linux / macOS: ~/.nanobot/config.json

2. Edit config.json

Set providers and agents.defaults to point at EasyRouter:

{
  "agents": {
    "defaults": {
      "model": "claude-sonnet-4-6",
      "provider": "easyrouter"
    }
  },
  "providers": {
    "easyrouter": {
      "apiKey": "your-easyrouter-api-key",
      "apiBase": "https://easyrouter.io/v1"
    }
  }
}

Field notes

  • apiBase must end with /v1
  • model must be a real model ID exposed by your EasyRouter console
  • You can declare multiple providers; agents.defaults.provider chooses which one is active

โœ… Step 3: Launch & verify

nanobot agent

Send any test message (e.g. "Hello, what day is today?"). A normal response means you're set.

๐Ÿ”„ Switching models

Edit agents.defaults.model in config.json and restart nanobot agent.

โ“ Troubleshooting

IssueFix
nanobot command not foundWindows: add .local/bin to PATH
401 UnauthorizedConfirm apiKey is correctly set in config.json
Model not foundMake sure model matches your EasyRouter console exactly
Config changes don't applyRestart nanobot agent to reload