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
Provider setup
- 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
Create a TokenRex API key, then copy an enabled chat model's exact ID from Models & Pricing. The examples use gpt-6-astra; replace it with your selected ID.
- 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
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.
- 5
Run nanobot agent for a local conversation. In versions with the WebUI, run nanobot webui and select the TokenRex model settings.
- 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.
{
"providers": {
"tokenrex": {
"apiKey": "${TOKENREX_API_KEY}",
"apiBase": "https://tokenrex.ai/api/public/v1"
}
},
"agents": {
"defaults": {
"provider": "tokenrex",
"model": "gpt-6-astra"
}
}
}WebUI model presets
- 1
In a version with WebUI, open Settings → Models and create or edit a model preset.
- 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
Save the preset and test a local message before enabling messaging channels.
Troubleshooting
- Authentication fails
- Check that the saved TokenRex key is active and belongs in the tool's API-key field, not its subscription sign-in. Remove accidental spaces, check your wallet balance, and never share the key in screenshots or exported settings.
- The model is missing or the request URL returns 404
- Copy an exact enabled model ID from Models & Pricing. Follow this method's URL field: some tools expect the versioned base, others the root or full completion address. Check the documented API protocol before changing the path.
- Chat works but streaming or tools fail
- Test a short plain-text conversation first. Confirm the selected model and installed tool version support the required protocol and capabilities. Enable agent actions only after separately checking streaming and tool calls.
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.