Loading...

How to Connect Bluehost AI Credits to NanoClaw

This article assumes you're familiar with SSH, have an API key for Claude via Bluehost's LLM gateway, a VPS, and have purchased/added the Bluehost application installation of NanoClaw as described in Installing NanoClaw on Self-Managed VPS/VDS.

If you haven't created an AI Credits API key yet, see How to Manage Your Bluehost API Keys first. Your gateway endpoint is https://gateway.ai.bluehost.com.

First Login

Log in to your server over SSH. Your first login should look like this:

user@local-machine:~$ ssh root@YOUR_SERVER_IP
The authenticity of host 'YOUR_SERVER_IP (YOUR_SERVER_IP)' can't be established.
ED25519 key fingerprint is SHA256:eso3l9pxPDlTac4DfOmQwRIEBgs/cwqVg8jBOPpbju8.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'YOUR_SERVER_IP' (ED25519) to the list of known hosts.
root@YOUR_SERVER_IP's password:
Welcome to Ubuntu 24.04.4 LTS (GNU/Linux 6.8.0-124-generic x86_64)
***************************************************************

  Nanoclaw AI Agent installed but NOT started -- initial setup required.

--------------------------------------------------------------------------
  FIRST-TIME SETUP
--------------------------------------------------------------------------

  Step 1 -- on the HOST (as root), enter the nanoclaw user session:
    machinectl shell nanoclaw@

  The remaining steps run INSIDE the machinectl shell:
  Step 2 -- run the setup script:
    cd ~/nanoclaw
    bash nanoclaw.sh

  During setup, Nanoclaw generates a long-lived OAuth token and prints:
    export CLAUDE_CODE_OAUTH_TOKEN=<token>

  Step 3 -- copy and run that export command in the same shell once setup finishes:
    export CLAUDE_CODE_OAUTH_TOKEN=<token-shown-above>

--------------------------------------------------------------------------
  RETURNING USERS (2nd login onwards)
--------------------------------------------------------------------------

  Nanoclaw auto-starts on every boot (linger is enabled).

  To use Claude Code (INSIDE machinectl shell nanoclaw@):
    machinectl shell nanoclaw@   <-- run on the HOST
    claude                       <-- run inside machinectl shell
    /exit                        <-- to exit Claude Code

--------------------------------------------------------------------------
  TROUBLESHOOTING   (all commands run INSIDE machinectl shell nanoclaw@)
--------------------------------------------------------------------------

  Enter user session first (on the HOST):
    machinectl shell nanoclaw@

  Check service status:
    systemctl --user list-unit-files | grep nanoclaw
    systemctl --user status 'nanoclaw-v2-*' --no-pager -l

  View live logs:
    journalctl --user -u 'nanoclaw-v2-*' -f

  Restart service:
    systemctl --user restart 'nanoclaw-v2-*'

  Re-run setup (e.g. "FATAL: No channels connected"):
    cd ~/nanoclaw && bash nanoclaw.sh

--------------------------------------------------------------------------
  Files & Documents
--------------------------------------------------------------------------

  App     : /home/nanoclaw/nanoclaw
  Env     : /home/nanoclaw/nanoclaw/.env
  README  : /home/nanoclaw/README.md | /root/README.md

  Nanoclaw AI Agent : https://nanoclaw.dev/

***************************************************************
To delete this MOTD: rm -rf /etc/update-motd.d/99-nanoclaw

Why this differs from the default setup: NanoClaw's built-in first-run setup (shown above) walks you through its own onboarding path using a Claude Code OAuth token, which isn't built around an AI Credits gateway key. The steps below use the Advanced setup path instead, so you can ignore the default OAuth token prompts described in the server's welcome message.

First-Time Setup

Step 1 – on the HOST (as root), enter the NanoClaw user session with this command:

machinectl shell nanoclaw@

The remaining steps run inside the machinectl shell, not on the host.

Step 2 – run the setup script:

cd ~/nanoclaw bash nanoclaw.sh

When the wizard starts, choose Advanced (override defaults) instead of Standard setup — this is what lets you point NanoClaw at the AI Credits gateway instead of a default Anthropic account:

   .:'.
  ':  :
  :'  ':
  .'::::'.    ..'''''..
 ,''    ''..:'      '':.
:'  .::. .::::::.  .::'':
:  :::::::::::::::::::.  :
::::::::::::::::::::::::'
 '::::::::::::::::::::'
   '::::::::::::::::'
     '::::::::::::'

|`\|__ _ ___  ___| |__ ___ __ __
|.`/ _` |  _\/ _ \| / _/ / _` \ V V /
|_|\__,_|_|  \___/|_\__\ \__,_|\_/\_/

              Small.
        Runs on your machine.
          Yours to modify.
------------------------------------------------
◇ Basics ready (4s)
  Let's get you set up.

◇ How would you like to begin?
  ● Standard setup
  ○ Advanced (override defaults)

Select Advanced, then pick Anthropic API base URL from the override list:

◇ Basics ready (4s)
  Let's get you set up.

◇ How would you like to begin?
  Advanced

◆ Pick a setting to override
  ○ OneCLI vault URL (not set)
  ○ OneCLI access token (not set)
  ● Anthropic API base URL (not set)
  ○ Anthropic auth token (not set)
  ○ Done — continue with setup

Set the Anthropic API base URL to your gateway endpoint, then select Anthropic auth token and paste in your AI Credits API key (it starts with sk-). Once both are set, select Done — continue with setup:

◇ How would you like to begin?
  Advanced

◇ Pick a setting to override
  Anthropic API base URL

◇ Anthropic API base URL
  https://gateway.ai.bluehost.com

◇ Pick a setting to override
  Anthropic auth token

◇ Anthropic auth token
  ••••••••••••

◆ Pick a setting to override
  ○ OneCLI vault URL (not set)
  ○ OneCLI access token (not set)
  ○ Anthropic API base URL (https://gateway.ai.bluehost.com)
  ○ Anthropic auth token (••••••••)
  ● Done — continue with setup

From here, continue the setup process normally. You'll be prompted to set up a OneCLI vault, name your assistant, set your timezone, and optionally connect a messaging app such as Telegram, Discord, or WhatsApp. These are beyond the scope of this guide and can be left at their defaults — you can use the existing OneCLI install without issue. Here's what the rest of the wizard looks like, including the built-in connection test:

Your system looks good. (1s)

Your assistant lives in its own sandbox. It can only see what you explicitly share.

The first build pulls a base image and installs a few tools. On a fresh machine this usually takes 3–10 minutes.

● Sandbox ready. (1m 45s)

Your assistant never gets your API keys directly. The vault adds them to approved requests as they leave the sandbox.

◇ Found an existing OneCLI at http://172.17.0.1:10254. What would you like to do?
  Use the existing instance

◇ OneCLI vault ready. (1s)

◇ Claude account connected. (0s)

◇ Access rules set. (1s)

◇ NanoClaw is running. (4s)

◇ What should your assistant call you?
  Alice

◇ Assistant wired up. (1s)

Your assistant runs in an isolated sandbox. I'm going to send it a quick test message (ping) and wait for a reply (pong) to confirm it's responding. First startup typically takes 30–60 seconds while the sandbox warms up.

◇ Your assistant is ready. (11s)

◇ What next?
  Pause here and chat with your agent from the terminal

◇ Alice's Terminal is ready. (1s)

◇ How this works
┌────────────────────────────────────────────────────────────────────┐
│ Your assistant runs in a sandbox on this machine. It wakes up when  │
│ you send a message and goes back to sleep when you're not talking  │
│ — so it isn't burning resources in the background. Its memory and  │
│ environment persist between conversations.                         │
└────────────────────────────────────────────────────────────────────┘

◇ Try a quick hello — or press Enter to continue setup
  Howdy.
Howdy! I'm Alice's Terminal, your personal assistant. I can help with research, coding, running tasks, managing files, scheduling reminders, reaching external services (email, GitHub, etc.), and plenty more. What can I do for you?

◇ Another message? Press Enter to continue setup

◇ Timezone set. (1s)

◇ Your system reports UTC as the timezone. Is that right, or are you somewhere else?
  Keep UTC

◇ Want to chat with your assistant from your phone?
  Skip for now

● No messaging app for now. You can add one later (like Telegram, Discord, WhatsApp, Teams, Slack, or iMessage).

◇ Everything's connected. (1s)

◇ Try these
┌───────────────────────────────────────────────┐
│ Chat in the terminal:  pnpm run chat hi        │
│ See what's happening:  tail -f logs/nanoclaw.log │
│ Open Claude Code:      claude                  │
└───────────────────────────────────────────────┘

◇ Heads up
┌────────────────────────────────────────────────────────────────────┐
│ NanoClaw runs on this machine. It's only reachable while this      │
│ computer is on and connected to the internet. For always-on        │
│ availability, run it on a cloud VM — or keep this machine awake.   │
└────────────────────────────────────────────────────────────────────┘

You're ready! Chat with `pnpm run chat hi`.

Once you're past those prompts, the AI Credits gateway connection is complete. Claude Code is also included in the NanoClaw installation — see the next section to connect it too.

Claude Code Setup

Still inside the machinectl shell, set the same gateway values for Claude Code:

export ANTHROPIC_BASE_URL=https://gateway.ai.bluehost.com export ANTHROPIC_AUTH_TOKEN=YOUR_AI_CREDITS_API_KEY

Start Claude Code:

claude
nanoclaw@YOUR_SERVER_IP:~/nanoclaw$ export ANTHROPIC_BASE_URL=https://gateway.ai.bluehost.com
export ANTHROPIC_AUTH_TOKEN=YOUR_AI_CREDITS_API_KEY
nanoclaw@YOUR_SERVER_IP:~/nanoclaw$ claude
Welcome to Claude Code v2.1.160

Security notes:

1. Claude can make mistakes.
   You're responsible for Claude's actions and should always
   review them, especially when running code.

2. Due to prompt injection risks, only use it with code you trust
   Learn more: https://code.claude.com/docs/en/security

Press Enter to continue…

Complete the initial setup as prompted:

Accessing workspace:

/home/nanoclaw/nanoclaw

Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from your team). If not, take a moment to review what's in this folder first.

Claude Code will be able to read, edit, and execute files here.

Security guide

❯ 1. Yes, I trust this folder
  2. No, exit

Enter to confirm · Esc to cancel

Run /status to confirm Claude Code is talking to the gateway:

/status
nanoclaw@YOUR_SERVER_IP:~/nanoclaw$ claude
Claude Code v2.1.160

Welcome back!
Opus 4.8 (1M context) · API Usage Billing
~/nanoclaw

What's new
Fixed prompt caching for sessions using an LLM gateway or custom base URL
Added a built-in "Concise" output style: Claude leads with results and skips preamble and narration, while doing the work just as thoroughly. Select it under Output style in /config.
Added `ANTHROPIC_DEFAULT_MODEL` environment variable: sets the model new sessions start on, while a `/model` pick still overrides it and persists across restarts (unlike `ANTHROPIC_MODEL`)
/release-notes for more

⚠ installMethod is native, but claude command not found at /home/nanoclaw/.local/bin/claude
  Opus 4.8 is here! Now defaults to high effort · /effort xhigh for your hardest tasks

/status
─────────────────────────────────────────────
Settings   Status   Config   Usage   Stats
─────────────────────────────────────────────
Version:            2.1.160
Session name:       /rename to add a name
Session ID:         993e84ac-ef00-4ccc-b2ee-4c55cc14d62d
cwd:                /home/nanoclaw/nanoclaw
Auth token:          ANTHROPIC_AUTH_TOKEN
Anthropic base URL:  https://gateway.ai.bluehost.com

Model:               Default (claude-opus-4-8[1m])
Setting sources:     User settings, Shared project settings

Esc to cancel

And give it a test message to make sure everything functions as expected. Here we've entered the prompt "howdy!" and Claude has responded appropriately:

/status
  Settings dialog dismissed

howdy!

● Howdy!

Ready to help you with NanoClaw. I can see a few things in your working tree right now:

- Deleted: groups/global/CLAUDE.md and groups/main/CLAUDE.md (these are installation-specific group files)
- Modified: src/providers/index.ts
- Untracked: package-lock.json (heads-up — this project uses pnpm, so a package-lock.json from npm probably shouldn't be here)

What are you working on? Some things I can jump into:

- Debug a container / channel issue (/debug)
- Wire up a channel — Discord, Slack, Telegram, WhatsApp, etc.
- Customize behavior or add an integration (/customize)
- Pull in upstream updates (/update-nanoclaw)
- Look at that src/providers/index.ts change or the stray package-lock.json

What's on your mind?

* Worked for 6s

To make the API key persistent across every terminal/session instead of re-exporting each time, put it in ~/.claude/settings.json (the global file, not the project's checked-in one, since that file gets committed and shared):

{ "env": { "ANTHROPIC_BASE_URL": "https://gateway.ai.bluehost.com", "ANTHROPIC_AUTH_TOKEN": "YOUR_AI_CREDITS_API_KEY" } }

Returning Users (2nd Login Onwards)

NanoClaw auto-starts on every boot (linger is enabled).

To use Claude Code (inside machinectl shell nanoclaw@):

machinectl shell nanoclaw@ <-- run on the HOST claude <-- run inside machinectl shell /exit <-- to exit Claude Code

Troubleshooting Quick Reference

All commands below run inside the machinectl shell (machinectl shell nanoclaw@ on the host first):

## Check service status systemctl --user list-unit-files | grep nanoclaw systemctl --user status 'nanoclaw-v2-*' --no-pager -l ## View live logs journalctl --user -u 'nanoclaw-v2-*' -f ## Restart service systemctl --user restart 'nanoclaw-v2-*' ## Re-run setup (e.g. "FATAL: No channels connected") cd ~/nanoclaw && bash nanoclaw.sh

For deeper troubleshooting, channel setup, and day-to-day operations, see NanoClaw: Configure and Troubleshoot.

Files & Documents

Item Location
App /home/nanoclaw/nanoclaw
Env /home/nanoclaw/nanoclaw/.env
README /home/nanoclaw/README.md | /root/README.md

NanoClaw AI Agent: https://nanoclaw.dev/
NanoClaw AI Agent documentation: https://docs.nanoclaw.dev/

To delete the MOTD:

rm -rf /etc/update-motd.d/99-nanoclaw

Summary

NanoClaw's default first-run setup uses a Claude Code OAuth token, which doesn't route through your AI Credits balance — connecting AI Credits means choosing Advanced (override defaults) in the setup wizard instead of Standard, then overriding the Anthropic API base URL and Anthropic auth token with your gateway endpoint and AI Credits API key. Claude Code, bundled with the NanoClaw installation, is connected separately inside the same machinectl shell by exporting ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, which can be made persistent in ~/.claude/settings.json. Since NanoClaw auto-starts on boot, returning logins only need machinectl shell nanoclaw@ followed by claude to get back into Claude Code.

Loading...