Models Hub
Agent Tools

Use nanobot with Models Hub: Edit config.json

Configure nanobot's providers and agents.defaults in config.json to point at Models Hub, with install steps, recommended models, and error fixes.

Edit this page

nanobot (project: HKUDS/nanobot) is a lightweight, open-source personal AI agent framework with a web UI, Telegram, Discord, and Slack channels, plus tool calling and long-term memory. It configures model providers through a single config.json file; point a provider at Models Hub and nanobot's conversations and automations draw on your Models Hub balance. This page covers only the connection step — see the project docs for everything else.

Three things you need

A Models Hub API key, the endpoint https://modelsok.com/v1 (must end with /v1), and a model name.

Prerequisites

  • uv installed.
  • A Models Hub API key from the Tokens page, in a group that can access the models you want.
Use caseModelPricingLive status
First choice for everyday chat, a balance of speed and qualityclaude-sonnet-4-6PriceAvailability and latency
Complex reasoning and long contextgpt-5.5PriceAvailability and latency
Cheap and fast, good for high-frequency tasksgpt-5.4-miniPriceAvailability and latency

Model names are authoritative on the pricing page.

Setup

  1. Install nanobot:

    uv tool install nanobot-ai

    Windows users need to add .local/bin to their environment variables to invoke nanobot directly:

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

    Run nanobot --version to confirm it installed.

  2. Initialize the configuration:

    nanobot onboard

    This creates a config file in your home directory: %USERPROFILE%\.nanobot\config.json on Windows, ~/.nanobot/config.json on Linux/macOS.

  3. Edit config.json to point providers and agents.defaults at Models Hub:

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

    apiBase must end with /v1; model must be a model ID actually exposed in the Models Hub console. Multiple providers can be configured side by side; agents.defaults.provider picks which one is used by default. Note: newer versions also support defining multiple models under modelPresets and referencing one by name via modelPreset — the direct fields shown here are the backward-compatible form; check your installed version if unsure.

Verify

Start an interactive conversation:

nanobot

Type any question, such as "Hello, tell me what day of the week it is today." A normal response means the configuration worked. Then check Usage logs in the Models Hub console; a request under that model name appears within seconds, confirming traffic went through Models Hub.

Common errors

SymptomCauseFix
nanobot command not foundWindows users haven't added .local/bin to PATHRun the PATH command above and reopen your terminal
401 UnauthorizedapiKey isn't filled in correctly, or the token is disabledRe-copy from the Tokens page
Model not foundmodel doesn't match a model ID in the Models Hub console, or apiBase is missing /v1Check the model name and URL against the pricing page
Configuration changes have no effectConfig changes require a restart to take effectSave the file and re-run nanobot

More in Troubleshooting.

FAQ

How is it billed? Per input and output token actually consumed per request, at the price on each model's pricing page.

How is this different from using the official API directly? Same request format; only apiBase changes to the Models Hub endpoint.

How do I switch models? Edit agents.defaults.model in config.json, save it, and restart nanobot.

On this page