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:
- Purchase a Self-Managed VPS with gstack Installation
- Purchase a Virtual Dedicated Server with gstack Installation
- Reimage Your Server for gstack Installation
Before You Start
Ensure you have the following prerequisites ready:
- gstack Instance: Installed and reachable over SSH, with the
gstacksystem user available. - Access Level: Root SSH access to your VPS or VDS.
- Bluehost Account: An active account with an available AI credit balance.
Note: You will need an AI Credits API key and Gateway endpoint. If you haven't created a key yet, see How to Manage Your Bluehost API Keys. For an overview of how the system works, see Understanding AI Credits. If you don't have a credit balance yet, see How to Purchase Bluehost AI Credits.
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.
- Log in to your Bluehost Portal.
- In the left-hand menu, click the Hosting tab.

- 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.

- Click the Reset Password.

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

gstack@server-123456:~$ echo $AI_GATEWAY_URL
echo $AI_API_KEY
https://gateway.ai.bluehost.com
sk-abc_123testab12
- 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:Replaceyour_server_ipwith your actual server IP address.ssh root@your_server_ip - Switch to the gstack user session. gstack runs under its own user account for security:
Example Outputmachinectl shell gstack@
root@server-12345:~# machinectl shell gstack@ Connected to the local host. Press ^] three times within 1s to exit session. gstack@server-12345:~$ - 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:
ornano ~/.bashrcAdd the following two lines at the end of the file:vi ~/.bashrcReplace
your_ai_credits_keywith the AI Credits API key from your Bluehost Portal.export ANTHROPIC_BASE_URL="https://gateway.ai.bluehost.com" export ANTHROPIC_AUTH_TOKEN="your_ai_credits_key"Claude Code still requiresANTHROPIC_API_KEYto be set to something — if your gateway authenticates purely throughANTHROPIC_AUTH_TOKEN, you can setANTHROPIC_API_KEYto any placeholder value alongside it. - Save the file (Ctrl+O, Enter, Ctrl+X), then reload it so the variables are active in your current session:
source ~/.bashrc
- Navigate to your project directory and start a Claude Code session as usual:
Becausecd ~/my-project claude
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENare already set, Claude Code skips the interactiveclaude authlogin flow and routes requests through your AI Credits balance instead. - 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 } - Type
/gstackinside the session to confirm gstack's skills are available, then start a sprint (for example,/office-hours).
/v1/messages), not the OpenAI Chat Completions format. Confirm with your Bluehost AI Credits documentation or support that the Gateway endpoint above exposes an Anthropic-compatible route before relying on this in production — if it doesn't, requests from Claude Code/gstack will fail even though the same key works fine in an OpenAI-compatible app like Langflow or Open WebUI.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:
- 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:Replaceyour_server_ipwith your actual server IP address.ssh root@your_server_ip - Switch to the gstack user session. gstack runs under its own user account for security:
Example Outputmachinectl shell gstack@
root@server-12345:~# machinectl shell gstack@ Connected to the local host. Press ^] three times within 1s to exit session. gstack@server-12345:~$ - Check whether the variables are already set:
echo $ANTHROPIC_BASE_URL; echo $ANTHROPIC_API_KEY
- Open
~/.bashrcand either add or update theANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENlines with your AI Credits Gateway endpoint and key, as shown in First Time Setup above. - Save the file and reload it:
source ~/.bashrc
- 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
Note: If you haven't created your project folder yet, run the following command to create the
my-projectdirectory and automatically navigate into it:mkdir -p ~/my-project && cd ~/my-project - Launch Claude Code:
claude
Already have AI Credits connected? If you're just rotating the key, update the ANTHROPIC_AUTH_TOKEN value in ~/.bashrc, reload it with source ~/.bashrc, and start a new Claude Code session. Any session left open from before the change will keep using the old key until it's restarted.
Test Your Connection
Once your AI Credits variables are set, confirm the connection works before starting a sprint:
- From the gstack user session, navigate to a project directory and start Claude Code:
cd ~/my-project claude
Note: If you haven't created your project folder yet, run the following command to create the
my-projectdirectory and automatically navigate into it:mkdir -p ~/my-project && cd ~/my-project - Start it again:
Example Outputclaude
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 - Because you exported
ANTHROPIC_API_KEYandANTHROPIC_BASE_URLinto your.bashrc, Claude Code will detect your environment variables and land you directly at the interactive prompt without forcing a browser login. - 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 - If you get a response, the connection is working. Type
/gstackto 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.