How to Connect Bluehost AI Credits to gstack

Power gstack directly using the AI Credits balance tied to your Bluehost account. gstack doesn't have its own model settings screen — it's a set of Claude Code skills, so it always uses whatever backend Claude Code itself is authenticated with. Connecting AI Credits to gstack means pointing the underlying Claude Code session at the Bluehost AI Credits Gateway instead of (or in addition to) a personal Anthropic API key.

This article assumes you already have gstack running on a Bluehost Self-Managed VPS or Virtual Dedicated Server (VDS).

If you haven't installed gstack yet, see:

Connect Bluehost AI Credits to gstack

gstack runs entirely on top of Claude Code, so there's no separate "model provider" screen to configure. Instead, Claude Code (and every gstack skill built on it) reads its connection details from environment variables the first time it's launched in a session.

First Time Setup

Follow these steps to connect to your VPS or VDS, switch to the gstack user, and configure your AI Credits key.

  1. Log in to your Bluehost Portal.
  2. In the left-hand menu, click the Hosting tab.

    Self Managed VPS
     

  3. Locate the server you want to manage, then click View Details in the bottom-left corner to expand the section and access additional server information.

    Self Managed VPS
     

  4. Click the Reset Password.

    Self Managed VPS
     

  5. In the pop-up window, type your new root password, then click Reset Password again to confirm and save the changes.

    Self Managed VPS
     

  1. Connect to your server via SSH.
    Use your VPS IP and credentials with an SSH client, follow the prompts, and enter your root password when asked:
    ssh root@your_server_ip
  2. Switch to the gstack user session. gstack runs under its own user account for security:
    machinectl shell gstack@
    Example Output
    root@server-12345:~# machinectl shell gstack@
    Connected to the local host. Press ^] three times within 1s to exit session.
    gstack@server-12345:~$
  3. Set your AI Credits connection details as environment variables in the gstack user's shell profile so they're loaded automatically every time you start a session. Open the profile file:
    nano ~/.bashrc
    or
    vi ~/.bashrc
    Add the following two lines at the end of the file:
    export ANTHROPIC_BASE_URL="https://gateway.ai.bluehost.com"
    export ANTHROPIC_AUTH_TOKEN="your_ai_credits_key"
          
  4. Save the file (Ctrl+O, Enter, Ctrl+X), then reload it so the variables are active in your current session:
    source ~/.bashrc
  5. Navigate to your project directory and start a Claude Code session as usual:
    cd ~/my-project claude
    Because ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN are already set, Claude Code skips the interactive claude auth login flow and routes requests through your AI Credits balance instead.
  6. Example Output
    Welcome to Claude Code v2.1.186
    ..........................................................
    
         *                                       █████▓▓░
                                     *         ███▓░     ░░
                ░░░░░░                        ███▓░
        ░░░   ░░░░░░░░░░                      ███▓░
       ░░░░░░░░░░░░░░░░░░░    *                ██▓░░      ▓
                                                 ░▓▓███▓▓░
     *                                 ░░░░
                                     ░░░░░░░░
                                   ░░░░░░░░░░░░░░░░
           █████████                                        *
          ██▄█████▄██                        *
           █████████      *
    .......█ █   █ █..........................................
    
     Let's get started.
    
     Choose the text style that looks best with your terminal
     To change this later, run /theme
    
       1. Auto (match terminal)
     ❯ 2. Dark mode ✔
       3. Light mode
       4. Dark mode (colorblind-friendly)
       5. Light mode (colorblind-friendly)
       6. Dark mode (ANSI colors only)
       7. Light mode (ANSI colors only)
    
     ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
      1  function greet() {
      2 -  console.log("Hello, World!");
      2 +  console.log("Hello, Claude!");
      3  }
  7. Type /gstack inside the session to confirm gstack's skills are available, then start a sprint (for example, /office-hours).

Adding AI Credits to an Existing gstack Install

If gstack is already authenticated a different way — through claude auth with a Claude subscription, a personal ANTHROPIC_API_KEY, or a third-party platform like Bedrock or Vertex AI — and you want to switch to AI Credits instead:

  1. Connect to your server via SSH.
    Use your VPS IP and credentials with an SSH client, follow the prompts, and enter your root password when asked:
    ssh root@your_server_ip
  2. Switch to the gstack user session. gstack runs under its own user account for security:
    machinectl shell gstack@
    Example Output
    root@server-12345:~# machinectl shell gstack@
    Connected to the local host. Press ^] three times within 1s to exit session.
    gstack@server-12345:~$
  3. Check whether the variables are already set:
    echo $ANTHROPIC_BASE_URL; echo $ANTHROPIC_API_KEY
  4. Open ~/.bashrc and either add or update the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN lines with your AI Credits Gateway endpoint and key, as shown in First Time Setup above.
  5. Save the file and reload it:
    source ~/.bashrc
  6. Start (or restart) your Claude Code session. Environment variables are only read at launch, so any Claude Code session already running needs to be exited and reopened for the change to take effect:
    cd ~/my-project
  7. Launch Claude Code:
    claude

Test Your Connection

Once your AI Credits variables are set, confirm the connection works before starting a sprint:

  1. From the gstack user session, navigate to a project directory and start Claude Code:
    cd ~/my-project claude
  2. Start it again:
    claude
    Example Output
    gstack@server-123456:~$ claude
    Welcome to Claude Code v2.1.186
    ..........................................................
    
         *                                       █████▓▓░
                                     *         ███▓░     ░░
                ░░░░░░                        ███▓░
        ░░░   ░░░░░░░░░░                      ███▓░
       ░░░░░░░░░░░░░░░░░░░    *                ██▓░░      ▓
    Welcome to Claude Code v2.1.186
    ..........................................................
    
         *                                       █████▓▓░
                                     *         ███▓░     ░░
                ░░░░░░                        ███▓░
        ░░░   ░░░░░░░░░░                      ███▓░
       ░░░░░░░░░░░░░░░░░░░    *                ██▓░░      ▓
                                                 ░▓▓███▓▓░
     *                                 ░░░░
                                     ░░░░░░░░
                                   ░░░░░░░░░░░░░░░░
           █████████                                        *
          ██▄█████▄██                        *
           █████████      *
    .......█ █   █ █..........................................
    
    
    ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      Detected a custom API key in your environment
    
      ANTHROPIC_API_KEY: sk-ant-...2_lxabc123test
    
      Do you want to use this API key?
    
       ❯ 1. Yes
       2. No (recommended)
    
      Enter to confirm · Esc to cancel
  3. Because you exported ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL into your .bashrc, Claude Code will detect your environment variables and land you directly at the interactive prompt without forcing a browser login.
  4. Send a simple prompt, such as "Good morning".

    Example Output

    gstack@server-123456:~$ claude
    Welcome to Claude Code v2.1.186
    ..........................................................
         *                                       █████▓▓░
                                     *         ███▓░     ░░
                ░░░░░░                        ███▓░
        ░░░   ░░░░░░░░░░                      ███▓░
       ░░░░░░░░░░░░░░░░░░░    *                ██▓░░      ▓
    ╭─── Claude Code v2.1.186 ─────────────────────────────────────────────────────────────────────────────────────────────╮
    │                                               │ Tips for getting started                                             │
    │                 Welcome back!                 │ Run /init to create a CLAUDE.md file with instructions for Claude    │
    │                                               │ Note: You have launched claude in your home directory. For the best… │
    │                    ▐▛███▜▌                    │ ──────────────────────────────────────────────────────────────────── │
    │                   ▝▜█████▛▘                   │ What's new                                                           │
    │                     ▘▘ ▝▝                     │ Added `--restricted` (or `CLAUDE_CODE_RESTRICTED=1`): removes the b… │
    │                                               │ Added `experimental.cacheTtl` (`"5m"` or `"1h"`) to agent frontmatt… │
    │   Opus 4.8 (1M context) · API Usage Billing   │ Added `claude self-hosted-runner --client-label label` (or `SELF_… │
    │                 /home/gstack                  │ /release-notes for more                                              │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    ❯ goodmorning
    ● Good morning! ☀️
      Anything on the agenda today, or want me to help you get oriented with what's in progress?
    ✻ Cogitated for 4s
    ❯ I want coffee
    ● Ha — that's the one bug I can't fix from here. ☕
      Want me to help with anything code-related while you go brew a cup? Or should I be quiet until you're properly
      caffeinated?
    ✻ Cogitated for 6s
    ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    ❯ 
    ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
      ? for shortcuts · ← for agents
  5. If you get a response, the connection is working. Type /gstack to confirm the skill set loads normally.

    Example Output

      
        
    ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    ❯ /gstack
    ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    /gstack                       Fast headless browser for QA testing and site dogfooding. (gstack) (user)
    /gstack-upgrade               Upgrade gstack to the latest version. (user)
    /open-gstack-browser          Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in.
                                  (user)
    /benchmark-models             Cross-model benchmark for gstack skills. (gstack) (user)
    /ios-sync                     Regenerate the iOS debug bridge against the latest upstream gstack templates. (gstack)
                                  (user)
    /plan-tune                    Self-tuning question sensitivity + developer psychographic for gstack (v1:
                                  observational). (gstack) (user)
    /sync-gbrain                  Keep gbrain current with this repo's code and refresh agent search guidance in
                                  CLAUDE.md. Wraps the gstack-gbrain-sync orchestrator with state (gstack) (user)
    /autoplan                     Auto-review pipeline — reads the full CEO, design, eng, and DX review skills from disk
                                  and runs them sequentially with auto-decisions using 6 decision principles. (gstack) …
    /benchmark                    Performance regression detection using the browse daemon. (gstack) (user)
    /browse                       Fast headless browser for QA testing and site dogfooding. (gstack) (user)
     

Troubleshooting

If your connection test doesn't work as expected, use the table below to identify the likely cause and next steps.

Issue Likely Cause What to Check
Claude Code still prompts for claude auth login Environment variables weren't loaded before Claude Code started Run source ~/.bashrc, confirm with echo $ANTHROPIC_BASE_URL, and restart the claude session
"Insufficient credits" or similar error AI credit balance is depleted Check your balance in the Bluehost Portal AI Tooling page and add more credits
"Invalid API key" or authentication error Key was mistyped, expired, or deleted Re-copy the key from the Bluehost Portal, update ANTHROPIC_AUTH_TOKEN, and reload the shell profile
Requests fail even with a valid key The Gateway endpoint doesn't expose an Anthropic-compatible /v1/messages route Confirm with Bluehost support or documentation whether the AI Credits Gateway supports the Anthropic Messages API, not just an OpenAI-compatible format
Change to ~/.bashrc doesn't seem to apply An existing Claude Code session is still running with the old environment Exit the running claude session and start a new one after updating the variables

Summary

gstack itself has no connection settings — it inherits whatever backend the underlying Claude Code session is authenticated with. To run gstack on AI Credits, set ANTHROPIC_BASE_URL to the Bluehost AI Credits Gateway and ANTHROPIC_AUTH_TOKEN to your AI Credits key in the gstack user's shell profile, then start (or restart) a Claude Code session. Confirm the Gateway supports the Anthropic Messages API before relying on this in production, and test with a simple prompt before starting a full sprint.