nanobot logo
AI agents

Use TokenRex with nanobot

Connect the lightweight personal agent and messaging bot to your own TokenRex endpoint.

Use a model that supports tool calling for agent tasks. Review file, terminal and connected-account permissions before allowing actions. Provider setup is documented; a live connection from this app has not been tested. Provider setup checked against the official reference. Live execution inside this third-party tool has not been tested; model limits, streaming and tool behavior must be verified separately.

Before you start

  • nanobot installed in an isolated Python environment
  • A TokenRex API key
  • An enabled tool-capable chat model

Setup methods

1

Provider setup

  1. 1.

    Install the official package with uv tool install nanobot-ai (or python -m pip install nanobot-ai inside a virtual environment), then run nanobot onboard to create ~/.nanobot/config.json.

  2. 2.

    Create a TokenRex API key, then copy an enabled chat model's exact ID from Models & Pricing. The examples use openai/gpt-6-astra; replace it with your selected ID.

  3. 3.

    Make TOKENREX_API_KEY available privately in the environment that starts nanobot. Do not commit the key or put it in a shared screenshot.

  4. 4.

    Merge the JSON below into ~/.nanobot/config.json. The named tokenrex provider uses https://tokenrex.ai/api/public/v1; keep provider explicitly set to tokenrex so the openai/ portion of the model ID is not treated as another provider.

  5. 5.

    Run nanobot agent for a local conversation. In versions with the WebUI, run nanobot webui and select the TokenRex model settings.

  6. 6.

    For Telegram, Discord or other supported channels, follow nanobot's official channel setup separately and enable only the accounts you authorize; start nanobot gateway for channel delivery.

Configuration
json
{
  "providers": {
    "tokenrex": {
      "apiKey": "${TOKENREX_API_KEY}",
      "apiBase": "https://tokenrex.ai/api/public/v1"
    }
  },
  "agents": {
    "defaults": {
      "provider": "tokenrex",
      "model": "openai/gpt-6-astra"
    }
  }
}
Setup reference
2

WebUI model presets

  1. 1.

    In a version with WebUI, open Settings → Models and create or edit a model preset.

  2. 2.

    Select your named custom provider, set https://tokenrex.ai/api/public/v1, and use an exact model ID. Keep provider selection explicit so the vendor prefix is not interpreted as a different provider.

  3. 3.

    Save the preset and test a local message before enabling messaging channels.

Setup reference

Verify the connection

Send a short message with the selected model, read its response, then confirm the exact model appears in your TokenRex usage. Test streaming and tool use separately before larger agent tasks.