This article explains how to connect OpenClaw to the Bluehost AI Gateway so its agents run against your Bluehost AI Credits balance instead of a separate LLM provider account. You'll add your API key to the service environment, load every chat-capable model your key unlocks, and set a default model — after which those models appear in the OpenClaw model dropdown.
It's written for server administrators running the Unmanaged VPS OpenClaw application who are comfortable with SSH, have root access to the server, and already have a Bluehost AI Credits API key. Expect to spend about 10–15 minutes.
If you do not have an API key, please refer to this page.
Before You Begin
This article assumes you are comfortable using SSH and that you have connected via SSH to your server as root to complete the configuration. The server will display a message of the day stating configuration steps — please ignore those for this walkthrough.
This guide is written specifically for the Unmanaged VPS OpenClaw application and was written for OpenClaw 2026.8.2 (0965053). While this process should work for other versions in the future, please be aware that this is rapidly updating software, and this process may need to be updated or modified going forward.
openclaw set up to run OpenClaw as a service, and that an EnvironmentFile=-/etc/default/openclaw line is set for that service. Please use How to Connect Bluehost AI Credits to OpenClaw instead.The key is used in two places, for two different consumers:
/etc/default/openclaw— read by the OpenClaw service at runtime.- An
exportin your setup session — used by thecurlcommand below.
Both hold the same value. The export is only used for the setup-session curl; the copy in /etc/default/openclaw is the permanent one the service resolves at runtime. Setting only one causes a confusing half-working state, so both are required here.
The API key should start with sk- and should look like this example: sk-demo-ABC123XYZ
1. Add Your Key to the Service Environment
Append your key to /etc/default/openclaw, the file the OpenClaw service reads at startup, and export it into your current shell session for the steps that follow:
echo 'BLUEHOST_AI_CREDITS_KEY=YOUR_KEY_HERE' >> /etc/default/openclaw
export BLUEHOST_AI_CREDITS_KEY='YOUR_KEY_HERE'
Restart so the service picks it up:
systemctl restart openclaw
2. Fetch the Model List and Load It into OpenClaw
Your Bluehost AI Credits key unlocks a set of models on the gateway that changes over time. Instead of listing them by hand, pull the current set directly from the gateway and hand it to OpenClaw.
Using the key you exported in Step 1, fetch the model list and hand it to OpenClaw:
MODELS=$(curl -fsS https://gateway.ai.bluehost.com/v1/models \
-H "Authorization: Bearer $BLUEHOST_AI_CREDITS_KEY" \
| jq -c '[.data[] | select(.mode=="chat")
| {id:.id, name:.id,
contextWindow:(.max_input_tokens // 200000),
maxTokens:(.max_output_tokens // 8192)}]')
sudo -u openclaw HOME=/var/lib/openclaw openclaw config set \
models.providers.bluehost-ai-credits \
"{\"baseUrl\":\"https://gateway.ai.bluehost.com/v1\",\"api\":\"openai-completions\",\"models\":$MODELS}" \
--strict-json --merge
This loads every chat-capable model your key unlocks. Image and video models are filtered out, since they can't be used from the chat model dropdown.
3. Attach the Key and Set a Default Model
Point the provider's API key at your environment variable as a SecretRef (not as a literal value in the config), then choose a default model:
sudo -u openclaw HOME=/var/lib/openclaw openclaw config set \
models.providers.bluehost-ai-credits.apiKey \
--ref-provider default --ref-source env --ref-id BLUEHOST_AI_CREDITS_KEY
sudo -u openclaw HOME=/var/lib/openclaw openclaw config set \
agents.defaults.models '{"bluehost-ai-credits/claude-haiku-4-5": {}}' \
--strict-json --merge
--ref-* flags shown above. Writing "apiKey":"env:BLUEHOST_AI_CREDITS_KEY" directly into the provider JSON does not work — OpenClaw sends that literal string as the API key, and the gateway rejects it with HTTP 401.4. Restart Services
systemctl restart openclaw
Verify (Optional)
All chat models should now appear in the OpenClaw model dropdown. Confirm the provider loaded correctly:
sudo -u openclaw HOME=/var/lib/openclaw openclaw config get models.providers.bluehost-ai-credits.models
Refreshing the Model List Later
When new models are added to the gateway, re-run Step 2. It merges the updated list in place, so any models you added manually are preserved.
Cleanup (Optional)
The exported key stays in your current shell session. Your key is also now in your shell history in two places — the echo and the export, both in Step 1. To clear the variable:
unset BLUEHOST_AI_CREDITS_KEY
Then, if you want to clear the history, just be aware that this will clear the entire history of commands for this user:
history -c
The copy in /etc/default/openclaw remains, which is what the service uses and is referred to in the EnvironmentFile directive.
That's it.
If you need the WebUI SSO link, you can see it with the following command:
cat /root/.openclaw_info
Or log in via the Bluehost portal's Manage button for this server. If this is your first login you'll be put into the settings menu initially and can move to the chat/session menu by clicking the top left go back option or hitting escape.
Summary
OpenClaw now authenticates to the Bluehost AI Gateway with your AI Credits key, and every chat-capable model that key unlocks is selectable from the model dropdown. Usage draws down your AI Credits balance rather than a separate LLM provider account.
What was configured:
- The key was written to
/etc/default/openclaw, which the OpenClaw service reads at runtime via itsEnvironmentFiledirective. - The chat-capable models on the gateway were fetched and merged into the
bluehost-ai-creditsprovider. - The provider's API key was attached as a SecretRef pointing at the environment variable, and a default model was set.
When new models are added to the gateway, re-run Step 2 to refresh the list. It merges in place, so anything you added manually is preserved.