OpenClaw
To connect OpenClaw to a third-party API you need to configure the provider, the API protocol, the base URL, the API Key and the default model.
Install and enter the setup wizard
If OpenClaw is not installed yet, run the official install command for your system. The setup wizard starts automatically once the installation finishes.
- Windows PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iex- Windows Cmd
powershell -NoProfile -ExecutionPolicy Bypass -Command "& ([scriptblock]::Create((irm https://openclaw.ai/install.ps1)))"- macOS / Linux
curl -fsSL https://openclaw.ai/install.sh | bashIf OpenClaw is already installed, run this command to enter the setup wizard again:
- Terminal
openclaw onboard --install-daemonComplete the basic setup
In the setup wizard, choose the following:
- For
Continue?chooseYes.

- For
Help make OpenClaw better?chooseNo thanks.

- For
Setup modechooseQuickStart.

- Keep the default agent name
mainand pressEnter.

- For
Model/auth providerchooseSkip for now.

- For
Default modelchooseKeep current. It does not matter if the model shown here is different; you will overwrite it with the HiModels configuration later.

- For
Select channelchooseSkip for now.

- For
Search providerchooseSkip for now.

- For
Install missing skill dependencieschooseSkip for now. This is a multi-select screen: pressSpaceto highlight the option andEnterto submit.

Leave the remaining settings at their defaults, or choose Skip for now.
HiModels is a custom provider, so skip the built-in model configuration for now; the next step writes in the HiModels key and endpoint.
The two setups below use different provider names. You can configure just one of them, or add the other models too; later configurations never overwrite the models you already added.
OpenAI setup
- Pick the command for your system, replace
sk-your-api-keywith the API Key you just created, then paste the whole block into your terminal. - macOS / Linux
cat <<'EOF' | openclaw config patch --stdin
{
"agents": {
"defaults": {
"model": {
"primary": "himodels-openai/gpt-6-astra"
}
}
},
"models": {
"mode": "merge",
"providers": {
"himodels-openai": {
"baseUrl": "https://api.himodels.ai/v1",
"apiKey": "sk-your-api-key",
"api": "openai-responses",
"models": [
{
"id": "gpt-6-astra",
"name": "GPT-6 Astra"
}
]
}
}
}
}
EOFClaude setup
- Pick the command for your system, replace
sk-your-api-keywith the API Key you just created, then paste the whole block into your terminal. - macOS / Linux
cat <<'EOF' | openclaw config patch --stdin
{
"agents": {
"defaults": {
"model": {
"primary": "himodels-claude/claude-sonnet-5-5"
}
}
},
"models": {
"mode": "merge",
"providers": {
"himodels-claude": {
"baseUrl": "https://api.himodels.ai",
"apiKey": "sk-your-api-key",
"api": "anthropic-messages",
"models": [
{
"id": "claude-sonnet-5-5",
"name": "Claude Sonnet 5.5"
}
]
}
}
}
}
EOFCheck the configuration
After either setup, run these commands to check the configuration:
Terminal:
openclaw config validate
openclaw config get agents.defaults.model.primaryIf you see Config valid and the second command prints the model you just configured, the configuration has been written:
- OpenAI:
himodels-openai/gpt-6-astra - Claude:
himodels-claude/claude-sonnet-5-5

Open the Dashboard to verify the connection
Restart Gateway, then open Dashboard:
Terminal:
openclaw gateway restart
openclaw dashboardOnce the browser opens:
- Create a new session.
- Click the model name under the input box and select the model you just configured.
- Send a message.
The model you configured last becomes the default for new sessions; existing sessions may keep the model they were using, so create a new session or switch models manually when you verify. If OpenClaw replies normally and the request shows up in your HiModels usage records, the connection works.
First make sure the API Key is on a group that allows external access, then check the base URL, API mode and model name above. For 401, 403 or 429 errors, see the FAQ.